java.lang.Object | |
↳ | org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter |
Known Direct Subclasses |
Known Indirect Subclasses |
Abstract adapter class for the NativeJdbcExtractor
interface,
for simplified implementation of basic extractors.
Basically 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.
getNativeConnection
also applies a fallback if the first
native extraction process failed, that is, returned the same Connection as
passed in. It assumes that some additional proxying is going in this case:
Hence, it retrieves the underlying native Connection from the DatabaseMetaData
via conHandle.getMetaData().getConnection()
and retries the native
extraction process based on that Connection handle. This works, for example,
for the Connection proxies exposed by Hibernate 3.1's Session.connection()
.
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Not able to unwrap: return passed-in CallableStatement.
| |||||||||||
Check for a ConnectionProxy chain, then delegate to doGetNativeConnection.
| |||||||||||
Retrieve the Connection via the Statement's Connection.
| |||||||||||
Not able to unwrap: return passed-in PreparedStatement.
| |||||||||||
Not able to unwrap: return passed-in ResultSet.
| |||||||||||
Not able to unwrap: return passed-in Statement.
| |||||||||||
Return
false by default. | |||||||||||
Return
false by default. | |||||||||||
Return
false by default. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Not able to unwrap: return passed-in Connection.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
|
Not able to unwrap: return passed-in CallableStatement.
cs | the CallableStatement handle, potentially wrapped by a connection pool |
---|
SQLException |
---|
Check for a ConnectionProxy chain, then delegate to doGetNativeConnection.
ConnectionProxy is used by Spring's TransactionAwareDataSourceProxy and LazyConnectionDataSourceProxy. The target connection behind it is typically one from a local connection pool, to be unwrapped by the doGetNativeConnection implementation of a concrete subclass.
con | the Connection handle, potentially wrapped by a connection pool |
---|
SQLException |
---|
Retrieve the Connection via the Statement's Connection.
stmt | the Statement handle, potentially wrapped by a connection pool |
---|
SQLException |
---|
Not able to unwrap: return passed-in PreparedStatement.
ps | the PreparedStatement handle, potentially wrapped by a connection pool |
---|
SQLException |
---|
Not able to unwrap: return passed-in ResultSet.
rs | the ResultSet handle, potentially wrapped by a connection pool |
---|
SQLException |
---|
Not able to unwrap: return passed-in Statement.
stmt | the Statement handle, potentially wrapped by a connection pool |
---|
SQLException |
---|
Return false
by default.
Return false
by default.
Return false
by default.
Not able to unwrap: return passed-in Connection.
SQLException |
---|