|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor
public class WebSphereNativeJdbcExtractor
Implementation of the NativeJdbcExtractor interface for WebSphere.
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.
Supports both WebSphere 5 and WebSphere 4. Currently tested with IBM WebSphere 5.1.0, 5.0.2 and 4.0.6. Thanks to Dave Keller and Victor for figuring out how to do the unwrapping on WebSphere 5 and 4!
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection
,
com.ibm.ws.rsadapter.jdbc.WSJdbcUtil#getNativeConnection
,
com.ibm.ejs.cm.proxy.ConnectionProxy#getPhysicalConnection
Field Summary | |
---|---|
protected Log |
logger
|
Constructor Summary | |
---|---|
WebSphereNativeJdbcExtractor()
This constructor retrieves WebSphere JDBC adapter classes, so we can get the underlying vendor connection using reflection. |
Method Summary | |
---|---|
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. |
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 |
Field Detail |
---|
protected final Log logger
Constructor Detail |
---|
public WebSphereNativeJdbcExtractor()
Method Detail |
---|
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
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |