com.atlassian.confluence.ext.jdbc.support.nativejdbc
Class C3P0NativeJdbcExtractor
java.lang.Object
org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
com.atlassian.confluence.ext.jdbc.support.nativejdbc.C3P0NativeJdbcExtractor
- All Implemented Interfaces:
- org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
public class C3P0NativeJdbcExtractor
- extends org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Implementation of the 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 OracleResultSet.
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).
- Since:
- 1.1.5
- Author:
- Juergen Hoeller
- See Also:
C3P0ProxyConnection.rawConnectionOperation(java.lang.reflect.Method, java.lang.Object, java.lang.Object[])
| Methods inherited from class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter |
getNativeCallableStatement, getNativeConnection, getNativeConnectionFromStatement, getNativePreparedStatement, getNativeResultSet, getNativeStatement |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
C3P0NativeJdbcExtractor
public C3P0NativeJdbcExtractor()
isNativeConnectionNecessaryForNativeStatements
public boolean isNativeConnectionNecessaryForNativeStatements()
- Specified by:
isNativeConnectionNecessaryForNativeStatements in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor- Overrides:
isNativeConnectionNecessaryForNativeStatements in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
isNativeConnectionNecessaryForNativePreparedStatements
public boolean isNativeConnectionNecessaryForNativePreparedStatements()
- Specified by:
isNativeConnectionNecessaryForNativePreparedStatements in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor- Overrides:
isNativeConnectionNecessaryForNativePreparedStatements in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
isNativeConnectionNecessaryForNativeCallableStatements
public boolean isNativeConnectionNecessaryForNativeCallableStatements()
- Specified by:
isNativeConnectionNecessaryForNativeCallableStatements in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor- Overrides:
isNativeConnectionNecessaryForNativeCallableStatements in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
doGetNativeConnection
protected Connection doGetNativeConnection(Connection con)
throws SQLException
- 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).
- Overrides:
doGetNativeConnection in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
- Throws:
SQLException- See Also:
getRawConnection(java.sql.Connection)
getRawConnection
public 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.
- Parameters:
con - a native Connection handle
- Returns:
- the native Connection handle, as-is