Class WebSphereNativeJdbcExtractor
- java.lang.Object
- org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
- org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor
- All Implemented Interfaces:
NativeJdbcExtractor
public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter
Implementation of theNativeJdbcExtractorinterface 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.
- Since:
- 1.1
- Author:
- Juergen Hoeller
Constructor Summary
Constructors Constructor Description WebSphereNativeJdbcExtractor()This constructor retrieves WebSphere JDBC adapter classes, so we can get the underlying vendor connection using reflection.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConnectiondoGetNativeConnection(Connection con)Retrieve the Connection via WebSphere'sgetNativeConnectionmethod.booleanisNativeConnectionNecessaryForNativeCallableStatements()Returntrue, as WebSphere returns wrapped CallableStatements.booleanisNativeConnectionNecessaryForNativePreparedStatements()Returntrue, as WebSphere returns wrapped PreparedStatements.booleanisNativeConnectionNecessaryForNativeStatements()Returntrue, as WebSphere returns wrapped Statements.Methods inherited from class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
getNativeCallableStatement, getNativeConnection, getNativeConnectionFromStatement, getNativePreparedStatement, getNativeResultSet, getNativeStatement
Constructor Detail
WebSphereNativeJdbcExtractor
public WebSphereNativeJdbcExtractor()
This constructor retrieves WebSphere JDBC adapter classes, so we can get the underlying vendor connection using reflection.
Method Detail
isNativeConnectionNecessaryForNativeStatements
public boolean isNativeConnectionNecessaryForNativeStatements()
Returntrue, as WebSphere returns wrapped Statements.- Specified by:
isNativeConnectionNecessaryForNativeStatementsin interfaceNativeJdbcExtractor- Overrides:
isNativeConnectionNecessaryForNativeStatementsin classNativeJdbcExtractorAdapter
isNativeConnectionNecessaryForNativePreparedStatements
public boolean isNativeConnectionNecessaryForNativePreparedStatements()
Returntrue, as WebSphere returns wrapped PreparedStatements.- Specified by:
isNativeConnectionNecessaryForNativePreparedStatementsin interfaceNativeJdbcExtractor- Overrides:
isNativeConnectionNecessaryForNativePreparedStatementsin classNativeJdbcExtractorAdapter
isNativeConnectionNecessaryForNativeCallableStatements
public boolean isNativeConnectionNecessaryForNativeCallableStatements()
Returntrue, as WebSphere returns wrapped CallableStatements.- Specified by:
isNativeConnectionNecessaryForNativeCallableStatementsin interfaceNativeJdbcExtractor- Overrides:
isNativeConnectionNecessaryForNativeCallableStatementsin classNativeJdbcExtractorAdapter
doGetNativeConnection
protected Connection doGetNativeConnection(Connection con) throws SQLException
Retrieve the Connection via WebSphere'sgetNativeConnectionmethod.- Overrides:
doGetNativeConnectionin classNativeJdbcExtractorAdapter- Throws:
SQLException