Class Jdbc41Bridge
AbstractMethodError) when using a JDBC driver written for JDBC 4.0 (Java 6).
 There should be no need to this kind of code for JDBC 4.2 in Java 8 due to JDBC's use of default methods.
This should probably be moved or at least copied in some form to Apache Commons DbUtils.
- Since:
- 2.6.0
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidabort(Connection connection, Executor executor) Delegates toConnection.abort(Executor)without throwing anAbstractMethodError.static voidcloseOnCompletion(Statement statement) Delegates toStatement.closeOnCompletion()without throwing anAbstractMethodError.static booleangeneratedKeyAlwaysReturned(DatabaseMetaData databaseMetaData) Delegates toDatabaseMetaData.generatedKeyAlwaysReturned()without throwing aAbstractMethodError.static intgetNetworkTimeout(Connection connection) Delegates toConnection.getNetworkTimeout()without throwing anAbstractMethodError.static <T> TDelegates toResultSet.getObject(int, Class)without throwing anAbstractMethodError.static <T> TDelegates toResultSet.getObject(String, Class)without throwing anAbstractMethodError.static LoggergetParentLogger(CommonDataSource commonDataSource) Delegates toCommonDataSource.getParentLogger()without throwing anAbstractMethodError.static ResultSetgetPseudoColumns(DatabaseMetaData databaseMetaData, String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) Delegates toDatabaseMetaData.getPseudoColumns(String, String, String, String)without throwing aAbstractMethodError.static StringgetSchema(Connection connection) Delegates toConnection.getSchema()without throwing anAbstractMethodError.static booleanisCloseOnCompletion(Statement statement) Delegates toStatement.isCloseOnCompletion()without throwing anAbstractMethodError.static voidsetNetworkTimeout(Connection connection, Executor executor, int milliseconds) Delegates toConnection.setNetworkTimeout(Executor, int)without throwing anAbstractMethodError.static voidsetSchema(Connection connection, String schema) Delegates toConnection.setSchema(String)without throwing anAbstractMethodError.
- 
Constructor Details- 
Jdbc41Bridgepublic Jdbc41Bridge()
 
- 
- 
Method Details- 
abortDelegates toConnection.abort(Executor)without throwing anAbstractMethodError.If the JDBC driver does not implement Connection.abort(Executor), then callConnection.close().- Parameters:
- connection- the receiver
- executor- See- Connection.abort(Executor).
- Throws:
- SQLException- See- Connection.abort(Executor).
- See Also:
 
- 
closeOnCompletionDelegates toStatement.closeOnCompletion()without throwing anAbstractMethodError.If the JDBC driver does not implement Statement.closeOnCompletion(), then just check that the connection is closed to then throw an SQLException.- Parameters:
- statement- See- Statement.closeOnCompletion()
- Throws:
- SQLException- See- Statement.closeOnCompletion()
- See Also:
 
- 
generatedKeyAlwaysReturnedpublic static boolean generatedKeyAlwaysReturned(DatabaseMetaData databaseMetaData) throws SQLException Delegates toDatabaseMetaData.generatedKeyAlwaysReturned()without throwing aAbstractMethodError.If the JDBC driver does not implement DatabaseMetaData.generatedKeyAlwaysReturned(), then return false.- Parameters:
- databaseMetaData- See- DatabaseMetaData.generatedKeyAlwaysReturned()
- Returns:
- See DatabaseMetaData.generatedKeyAlwaysReturned()
- Throws:
- SQLException- See- DatabaseMetaData.generatedKeyAlwaysReturned()
- See Also:
 
- 
getNetworkTimeoutDelegates toConnection.getNetworkTimeout()without throwing anAbstractMethodError.If the JDBC driver does not implement Connection.getNetworkTimeout(), then return 0.- Parameters:
- connection- the receiver
- Returns:
- See Connection.getNetworkTimeout()
- Throws:
- SQLException- See- Connection.getNetworkTimeout()
- See Also:
 
- 
getObjectpublic static <T> T getObject(ResultSet resultSet, int columnIndex, Class<T> type) throws SQLException Delegates toResultSet.getObject(int, Class)without throwing anAbstractMethodError.If the JDBC driver does not implement ResultSet.getObject(int, Class), then return 0.- Type Parameters:
- T- See- ResultSet.getObject(int, Class)
- Parameters:
- resultSet- See- ResultSet.getObject(int, Class)
- columnIndex- See- ResultSet.getObject(int, Class)
- type- See- ResultSet.getObject(int, Class)
- Returns:
- See ResultSet.getObject(int, Class)
- Throws:
- SQLException- See- ResultSet.getObject(int, Class)
- See Also:
 
- 
getObjectpublic static <T> T getObject(ResultSet resultSet, String columnLabel, Class<T> type) throws SQLException Delegates toResultSet.getObject(String, Class)without throwing anAbstractMethodError.- Type Parameters:
- T- See- ResultSet.getObject(String, Class)
- Parameters:
- resultSet- See- ResultSet.getObject(String, Class)
- columnLabel- See- ResultSet.getObject(String, Class)
- type- See- ResultSet.getObject(String, Class)
- Returns:
- See ResultSet.getObject(String, Class)
- Throws:
- SQLException- See- ResultSet.getObject(String, Class)
- See Also:
 
- 
getParentLoggerpublic static Logger getParentLogger(CommonDataSource commonDataSource) throws SQLFeatureNotSupportedException Delegates toCommonDataSource.getParentLogger()without throwing anAbstractMethodError.If the JDBC driver does not implement CommonDataSource.getParentLogger(), then return null.- Parameters:
- commonDataSource- See- CommonDataSource.getParentLogger()
- Returns:
- See CommonDataSource.getParentLogger()
- Throws:
- SQLFeatureNotSupportedException- See- CommonDataSource.getParentLogger()
 
- 
getPseudoColumnspublic static ResultSet getPseudoColumns(DatabaseMetaData databaseMetaData, String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException Delegates toDatabaseMetaData.getPseudoColumns(String, String, String, String)without throwing aAbstractMethodError.If the JDBC driver does not implement DatabaseMetaData.getPseudoColumns(String, String, String, String), then return null.- Parameters:
- databaseMetaData- the receiver
- catalog- See- DatabaseMetaData.getPseudoColumns(String, String, String, String)
- schemaPattern- See- DatabaseMetaData.getPseudoColumns(String, String, String, String)
- tableNamePattern- See- DatabaseMetaData.getPseudoColumns(String, String, String, String)
- columnNamePattern- See- DatabaseMetaData.getPseudoColumns(String, String, String, String)
- Returns:
- See DatabaseMetaData.getPseudoColumns(String, String, String, String)
- Throws:
- SQLException- See- DatabaseMetaData.getPseudoColumns(String, String, String, String)
- See Also:
 
- 
getSchemaDelegates toConnection.getSchema()without throwing anAbstractMethodError.If the JDBC driver does not implement Connection.getSchema(), then return null.- Parameters:
- connection- the receiver
- Returns:
- null for a JDBC 4 driver or a value per Connection.getSchema().
- Throws:
- SQLException- See- Connection.getSchema().
- See Also:
 
- 
isCloseOnCompletionDelegates toStatement.isCloseOnCompletion()without throwing anAbstractMethodError.If the JDBC driver does not implement Statement.isCloseOnCompletion(), then just check that the connection is closed to then throw an SQLException.- Parameters:
- statement- See- Statement.isCloseOnCompletion()
- Returns:
- See Statement.isCloseOnCompletion()
- Throws:
- SQLException- See- Statement.isCloseOnCompletion()
- See Also:
 
- 
setNetworkTimeoutpublic static void setNetworkTimeout(Connection connection, Executor executor, int milliseconds) throws SQLException Delegates toConnection.setNetworkTimeout(Executor, int)without throwing anAbstractMethodError.If the JDBC driver does not implement Connection.setNetworkTimeout(Executor, int), then do nothing.- Parameters:
- connection- the receiver
- executor- See- Connection.setNetworkTimeout(Executor, int)
- milliseconds-- Connection.setNetworkTimeout(Executor, int)
- Throws:
- SQLException-- Connection.setNetworkTimeout(Executor, int)
- See Also:
 
- 
setSchemaDelegates toConnection.setSchema(String)without throwing anAbstractMethodError.If the JDBC driver does not implement Connection.setSchema(String), then do nothing.- Parameters:
- connection- the receiver
- schema- See- Connection.setSchema(String).
- Throws:
- SQLException- See- Connection.setSchema(String).
- See Also:
 
 
-