public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter
NativeJdbcExtractor
interface for WebSphere,
supporting WebSphere Application Server 6.1 and higher.
Returns the underlying native Connection to application code instead
of WebSphere's wrapper implementation; 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 WebSphere DataSource: If a given object is not a WebSphere Connection wrapper, it will be returned as-is.
Constructor and Description |
---|
WebSphereNativeJdbcExtractor()
This constructor retrieves WebSphere JDBC adapter classes,
so we can get the underlying vendor connection using reflection.
|
Modifier and Type | Method and Description |
---|---|
protected Connection |
doGetNativeConnection(Connection con)
Retrieve the Connection via WebSphere's
getNativeConnection method. |
boolean |
isNativeConnectionNecessaryForNativeCallableStatements()
Return
true , as WebSphere returns wrapped CallableStatements. |
boolean |
isNativeConnectionNecessaryForNativePreparedStatements()
Return
true , as WebSphere returns wrapped PreparedStatements. |
boolean |
isNativeConnectionNecessaryForNativeStatements()
Return
true , as WebSphere returns wrapped Statements. |
getNativeCallableStatement, getNativeConnection, getNativeConnectionFromStatement, getNativePreparedStatement, getNativeResultSet, getNativeStatement
public WebSphereNativeJdbcExtractor()
public boolean isNativeConnectionNecessaryForNativeStatements()
true
, as WebSphere returns wrapped Statements.isNativeConnectionNecessaryForNativeStatements
in interface NativeJdbcExtractor
isNativeConnectionNecessaryForNativeStatements
in class NativeJdbcExtractorAdapter
public boolean isNativeConnectionNecessaryForNativePreparedStatements()
true
, as WebSphere returns wrapped PreparedStatements.isNativeConnectionNecessaryForNativePreparedStatements
in interface NativeJdbcExtractor
isNativeConnectionNecessaryForNativePreparedStatements
in class NativeJdbcExtractorAdapter
public boolean isNativeConnectionNecessaryForNativeCallableStatements()
true
, as WebSphere returns wrapped CallableStatements.isNativeConnectionNecessaryForNativeCallableStatements
in interface NativeJdbcExtractor
isNativeConnectionNecessaryForNativeCallableStatements
in class NativeJdbcExtractorAdapter
protected Connection doGetNativeConnection(Connection con) throws SQLException
getNativeConnection
method.doGetNativeConnection
in class NativeJdbcExtractorAdapter
SQLException