|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Abstract adapter class for the NativeJdbcExtractor interface, for simplified implementation of basic extractors. Returns the passed-in JDBC objects on all methods.
getNativeConnection checks for a ConnectionProxy chain,
for example from a TransactionAwareDataSourceProxy, before delegating to
doGetNativeConnection for actual unwrapping. You can override
either of the two for a specific connection pool, but the latter is
recommended to participate in ConnectionProxy unwrapping.
The getNativeConnectionFromStatement method is implemented
to simply delegate to getNativeConnection with the Statement's
Connection. This is what most extractor implementations will stick to,
unless there's a more efficient version for a specific pool.
getNativeConnection(java.sql.Connection),
getNativeConnectionFromStatement(java.sql.Statement)| Constructor Summary | |
NativeJdbcExtractorAdapter()
|
|
| Method Summary | |
protected Connection |
doGetNativeConnection(Connection con)
Not able to unwrap: return passed-in Connection. |
CallableStatement |
getNativeCallableStatement(CallableStatement cs)
Not able to unwrap: return passed-in CallableStatement. |
Connection |
getNativeConnection(Connection con)
Check for a ConnectionProxy chain, then delegate to doGetNativeConnection. |
Connection |
getNativeConnectionFromStatement(Statement stmt)
Retrieve the Connection via the Statement's Connection. |
PreparedStatement |
getNativePreparedStatement(PreparedStatement ps)
Not able to unwrap: return passed-in PreparedStatement. |
ResultSet |
getNativeResultSet(ResultSet rs)
Not able to unwrap: return passed-in ResultSet. |
Statement |
getNativeStatement(Statement stmt)
Not able to unwrap: return passed-in Statement. |
boolean |
isNativeConnectionNecessaryForNativeCallableStatements()
Return false by default. |
boolean |
isNativeConnectionNecessaryForNativePreparedStatements()
Return false by default. |
boolean |
isNativeConnectionNecessaryForNativeStatements()
Return false by default. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public NativeJdbcExtractorAdapter()
| Method Detail |
public boolean isNativeConnectionNecessaryForNativeStatements()
isNativeConnectionNecessaryForNativeStatements in interface NativeJdbcExtractorpublic boolean isNativeConnectionNecessaryForNativePreparedStatements()
isNativeConnectionNecessaryForNativePreparedStatements in interface NativeJdbcExtractorpublic boolean isNativeConnectionNecessaryForNativeCallableStatements()
isNativeConnectionNecessaryForNativeCallableStatements in interface NativeJdbcExtractor
public Connection getNativeConnection(Connection con)
throws SQLException
ConnectionProxy is used by Spring's TransactionAwareDataSourceProxy and SingleConnectionDataSource. The target connection behind it is typically one from a local connection pool, to be unwrapped by the doGetNativeConnection implementation of a concrete subclass.
getNativeConnection in interface NativeJdbcExtractorcon - the Connection handle, potentially wrapped by a connection pool
SQLException - if thrown by JDBC methodsdoGetNativeConnection(java.sql.Connection),
ConnectionProxy,
TransactionAwareDataSourceProxy,
SingleConnectionDataSource
protected Connection doGetNativeConnection(Connection con)
throws SQLException
SQLException
public Connection getNativeConnectionFromStatement(Statement stmt)
throws SQLException
getNativeConnectionFromStatement in interface NativeJdbcExtractorstmt - the Statement handle, potentially wrapped by a connection pool
SQLException - if thrown by JDBC methodsgetNativeConnection(java.sql.Connection),
Statement.getConnection()
public Statement getNativeStatement(Statement stmt)
throws SQLException
getNativeStatement in interface NativeJdbcExtractorstmt - the Statement handle, potentially wrapped by a connection pool
SQLException - if thrown by JDBC methods
public PreparedStatement getNativePreparedStatement(PreparedStatement ps)
throws SQLException
getNativePreparedStatement in interface NativeJdbcExtractorps - the PreparedStatement handle, potentially wrapped by a connection pool
SQLException - if thrown by JDBC methods
public CallableStatement getNativeCallableStatement(CallableStatement cs)
throws SQLException
getNativeCallableStatement in interface NativeJdbcExtractorcs - the CallableStatement handle, potentially wrapped by a connection pool
SQLException - if thrown by JDBC methods
public ResultSet getNativeResultSet(ResultSet rs)
throws SQLException
getNativeResultSet in interface NativeJdbcExtractorrs - the ResultSet handle, potentially wrapped by a connection pool
SQLException - if thrown by JDBC methods
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||