public <T> T getObject(String columnLabel, Class<T> type) throws SQLException { throw new SQLFeatureNotSupportedException(); } }
public boolean isCloseOnCompletion() throws SQLException { throw new SQLFeatureNotSupportedException(); } }
public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException { throw new SQLFeatureNotSupportedException(); }
public <T> T getObject(String parameterName, Class<T> type) throws SQLException { throw new SQLFeatureNotSupportedException(); }
public void abort(Executor executor) throws SQLException { throw new SQLFeatureNotSupportedException(); }
public void closeOnCompletion() throws SQLException { throw new SQLFeatureNotSupportedException(); }
public <T> T getObject(String parameterName, Class<T> type) throws SQLException { throw new SQLFeatureNotSupportedException(); }
public Logger getParentLogger() throws SQLFeatureNotSupportedException { throw new SQLFeatureNotSupportedException(); }
public <T> T getObject(int columnIndex, Class<T> type) throws SQLException { throw new SQLFeatureNotSupportedException(); }
public int getNetworkTimeout() throws SQLException { throw new SQLFeatureNotSupportedException(); }
public Logger getParentLogger() throws SQLFeatureNotSupportedException { throw new SQLFeatureNotSupportedException(); }
public boolean isCloseOnCompletion() throws SQLException { throw new SQLFeatureNotSupportedException(); }
public void setSchema(String schema) throws SQLException { throw new SQLFeatureNotSupportedException(); }
public void closeOnCompletion() throws SQLException { throw new SQLFeatureNotSupportedException(); }
public void abort(Executor executor) throws SQLException { throw new SQLFeatureNotSupportedException(); }
public Logger getParentLogger() throws SQLFeatureNotSupportedException { throw new SQLFeatureNotSupportedException(); }
public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException { throw new SQLFeatureNotSupportedException(); }
public static SQLException newSQLFeatureNotSupportedException(String reason, String SQLState, int vendorCode) { return new SQLFeatureNotSupportedException(reason, SQLState, vendorCode); }
@Test(expected = TypeMismatchDataAccessException.class) // SPR-16483 public void doesNotUseConversionService() throws SQLException { SingleColumnRowMapper<LocalDateTime> rowMapper = SingleColumnRowMapper.newInstance(LocalDateTime.class, null); ResultSet resultSet = mock(ResultSet.class); ResultSetMetaData metaData = mock(ResultSetMetaData.class); given(metaData.getColumnCount()).willReturn(1); given(resultSet.getMetaData()).willReturn(metaData); given(resultSet.getObject(1, LocalDateTime.class)) .willThrow(new SQLFeatureNotSupportedException()); given(resultSet.getTimestamp(1)).willReturn(new Timestamp(0)); rowMapper.mapRow(resultSet, 1); }
@Test // SPR-16483 public void useDefaultConversionService() throws SQLException { Timestamp timestamp = new Timestamp(0); SingleColumnRowMapper<LocalDateTime> rowMapper = SingleColumnRowMapper.newInstance(LocalDateTime.class); ResultSet resultSet = mock(ResultSet.class); ResultSetMetaData metaData = mock(ResultSetMetaData.class); given(metaData.getColumnCount()).willReturn(1); given(resultSet.getMetaData()).willReturn(metaData); given(resultSet.getObject(1, LocalDateTime.class)) .willThrow(new SQLFeatureNotSupportedException()); given(resultSet.getTimestamp(1)).willReturn(timestamp); LocalDateTime actualLocalDateTime = rowMapper.mapRow(resultSet, 1); assertEquals(timestamp.toLocalDateTime(), actualLocalDateTime); }