public class C3P0NativeJdbcExtractor extends NativeJdbcExtractorAdapter
NativeJdbcExtractor
interface for the
C3P0 connection pool.
Returns underlying native Connections to application code instead of C3P0's
wrapper implementations; unwraps the Connection for native Statements.
The returned JDBC classes can then safely be cast, e.g. to
oracle.jdbc.OracleConnection
.
This NativeJdbcExtractor can be set just to allow working with a C3P0 DataSource: If a given object is not a C3P0 wrapper, it will be returned as-is.
Note that this class requires C3P0 0.8.5 or later; for earlier C3P0 versions, use SimpleNativeJdbcExtractor (which won't work for C3P0 0.8.5 or later).
C3P0ProxyConnection.rawConnectionOperation(java.lang.reflect.Method, java.lang.Object, java.lang.Object[])
,
SimpleNativeJdbcExtractor
Constructor and Description |
---|
C3P0NativeJdbcExtractor() |
Modifier and Type | Method and Description |
---|---|
protected Connection |
doGetNativeConnection(Connection con)
Retrieve the Connection via C3P0's
rawConnectionOperation API,
using the getRawConnection as callback to get access to the
raw Connection (which is otherwise not directly supported by C3P0). |
static Connection |
getRawConnection(Connection con)
This method is not meant to be used directly; it rather serves
as callback method for C3P0's "rawConnectionOperation" API.
|
boolean |
isNativeConnectionNecessaryForNativeCallableStatements()
Return
false by default. |
boolean |
isNativeConnectionNecessaryForNativePreparedStatements()
Return
false by default. |
boolean |
isNativeConnectionNecessaryForNativeStatements()
Return
false by default. |
getNativeCallableStatement, getNativeConnection, getNativeConnectionFromStatement, getNativePreparedStatement, getNativeResultSet, getNativeStatement
public static Connection getRawConnection(Connection con)
con
- a native Connection handlepublic boolean isNativeConnectionNecessaryForNativeStatements()
NativeJdbcExtractorAdapter
false
by default.isNativeConnectionNecessaryForNativeStatements
in interface NativeJdbcExtractor
isNativeConnectionNecessaryForNativeStatements
in class NativeJdbcExtractorAdapter
public boolean isNativeConnectionNecessaryForNativePreparedStatements()
NativeJdbcExtractorAdapter
false
by default.isNativeConnectionNecessaryForNativePreparedStatements
in interface NativeJdbcExtractor
isNativeConnectionNecessaryForNativePreparedStatements
in class NativeJdbcExtractorAdapter
public boolean isNativeConnectionNecessaryForNativeCallableStatements()
NativeJdbcExtractorAdapter
false
by default.isNativeConnectionNecessaryForNativeCallableStatements
in interface NativeJdbcExtractor
isNativeConnectionNecessaryForNativeCallableStatements
in class NativeJdbcExtractorAdapter
protected Connection doGetNativeConnection(Connection con) throws SQLException
rawConnectionOperation
API,
using the getRawConnection
as callback to get access to the
raw Connection (which is otherwise not directly supported by C3P0).doGetNativeConnection
in class NativeJdbcExtractorAdapter
SQLException
getRawConnection(java.sql.Connection)