|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jdbc.support.nativejdbc.JBossNativeJdbcExtractor
Implementation of the NativeJdbcExtractor interface for the JBoss 3.2 connection pool. Returns the underlying native Connection, Statement, etc to application code instead of JBoss' wrapper implementations. The returned JDBC classes can then safely be cast, e.g. to OracleResultSet.
This NativeJdbcExtractor can be set just to allow working with a JBoss connection pool: If a given object is not a JBoss wrapper, it will be returned as-is.
JdbcTemplate.setNativeJdbcExtractor(org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor)
Constructor Summary | |
JBossNativeJdbcExtractor()
|
Method Summary | |
java.sql.CallableStatement |
getNativeCallableStatement(java.sql.CallableStatement cs)
Retrieve the underlying native JDBC CallableStatement for the given statement. |
java.sql.Connection |
getNativeConnection(java.sql.Connection con)
Retrieve the underlying native JDBC Connection for the given Connection. |
java.sql.Connection |
getNativeConnectionFromStatement(java.sql.Statement stmt)
Retrieve the underlying native JDBC Connection for the given Statement. |
java.sql.PreparedStatement |
getNativePreparedStatement(java.sql.PreparedStatement ps)
Retrieve the underlying native JDBC PreparedStatement for the given statement. |
java.sql.ResultSet |
getNativeResultSet(java.sql.ResultSet rs)
Retrieve the underlying native JDBC ResultSet for the given statement. |
java.sql.Statement |
getNativeStatement(java.sql.Statement stmt)
Retrieve the underlying native JDBC Statement for the given Statement. |
boolean |
isNativeConnectionNecessaryForNativeCallableStatements()
Return whether it is necessary to work on the native Connection to receive native CallableStatements. |
boolean |
isNativeConnectionNecessaryForNativePreparedStatements()
Return whether it is necessary to work on the native Connection to receive native PreparedStatements. |
boolean |
isNativeConnectionNecessaryForNativeStatements()
Return whether it is necessary to work on the native Connection to receive native Statements. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JBossNativeJdbcExtractor()
Method Detail |
public boolean isNativeConnectionNecessaryForNativeStatements()
NativeJdbcExtractor
This should be true if the connection pool does not allow to extract the native JDBC objects from its Statement wrapper but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.
isNativeConnectionNecessaryForNativeStatements
in interface NativeJdbcExtractor
public boolean isNativeConnectionNecessaryForNativePreparedStatements()
NativeJdbcExtractor
This should be true if the connection pool does not allow to extract the native JDBC objects from its PreparedStatement wrappers but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.
isNativeConnectionNecessaryForNativePreparedStatements
in interface NativeJdbcExtractor
public boolean isNativeConnectionNecessaryForNativeCallableStatements()
NativeJdbcExtractor
This should be true if the connection pool does not allow to extract the native JDBC objects from its CallableStatement wrappers but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.
isNativeConnectionNecessaryForNativeCallableStatements
in interface NativeJdbcExtractor
public java.sql.Connection getNativeConnection(java.sql.Connection con) throws java.sql.SQLException
NativeJdbcExtractor
getNativeConnection
in interface NativeJdbcExtractor
con
- the Connection handle, potentially wrapped by a connection pool
java.sql.SQLException
- if thrown by JDBC methodspublic java.sql.Connection getNativeConnectionFromStatement(java.sql.Statement stmt) throws java.sql.SQLException
NativeJdbcExtractor
Having this extra method allows for more efficient unwrapping if data access code already has a Statement. Statement.getConnection() often returns the native JDBC Connection even if the Statement itself is wrapped by a pool.
getNativeConnectionFromStatement
in interface NativeJdbcExtractor
stmt
- the Statement handle, potentially wrapped by a connection pool
java.sql.SQLException
- if thrown by JDBC methodspublic java.sql.Statement getNativeStatement(java.sql.Statement stmt) throws java.sql.SQLException
NativeJdbcExtractor
getNativeStatement
in interface NativeJdbcExtractor
stmt
- the Statement handle, potentially wrapped by a connection pool
java.sql.SQLException
- if thrown by JDBC methodspublic java.sql.PreparedStatement getNativePreparedStatement(java.sql.PreparedStatement ps) throws java.sql.SQLException
NativeJdbcExtractor
getNativePreparedStatement
in interface NativeJdbcExtractor
ps
- the PreparedStatement handle, potentially wrapped by a connection pool
java.sql.SQLException
- if thrown by JDBC methodspublic java.sql.CallableStatement getNativeCallableStatement(java.sql.CallableStatement cs) throws java.sql.SQLException
NativeJdbcExtractor
getNativeCallableStatement
in interface NativeJdbcExtractor
cs
- the CallableStatement handle, potentially wrapped by a connection pool
java.sql.SQLException
- if thrown by JDBC methodspublic java.sql.ResultSet getNativeResultSet(java.sql.ResultSet rs) throws java.sql.SQLException
NativeJdbcExtractor
getNativeResultSet
in interface NativeJdbcExtractor
rs
- the ResultSet handle, potentially wrapped by a connection pool
java.sql.SQLException
- if thrown by JDBC methods
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |