Class WebLogicNativeJdbcExtractor
- java.lang.Object
- org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
- org.springframework.jdbc.support.nativejdbc.WebLogicNativeJdbcExtractor
- All Implemented Interfaces:
NativeJdbcExtractor
public class WebLogicNativeJdbcExtractor extends NativeJdbcExtractorAdapter
Implementation of theNativeJdbcExtractor
interface for WebLogic, supporting WebLogic Server 9.0 and higher.Returns the underlying native Connection to application code instead of WebLogic'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 WebLogic DataSource: If a given object is not a WebLogic Connection wrapper, it will be returned as-is.
- Since:
- 1.0.2
- Author:
- Thomas Risberg, Juergen Hoeller
- See Also:
NativeJdbcExtractorAdapter.getNativeConnection(java.sql.Connection)
,weblogic.jdbc.extensions.WLConnection#getVendorConnection
Constructor Summary
Constructors Constructor Description WebLogicNativeJdbcExtractor()
This constructor retrieves the WebLogic JDBC extension interface, so we can get the underlying vendor connection using reflection.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Connection
doGetNativeConnection(Connection con)
Retrieve the Connection via WebLogic'sgetVendorConnection
method.boolean
isNativeConnectionNecessaryForNativeCallableStatements()
Returntrue
, as WebLogic returns wrapped CallableStatements.boolean
isNativeConnectionNecessaryForNativePreparedStatements()
Returntrue
, as WebLogic returns wrapped PreparedStatements.boolean
isNativeConnectionNecessaryForNativeStatements()
Returntrue
, as WebLogic returns wrapped Statements.Methods inherited from class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
getNativeCallableStatement, getNativeConnection, getNativeConnectionFromStatement, getNativePreparedStatement, getNativeResultSet, getNativeStatement
Constructor Detail
WebLogicNativeJdbcExtractor
public WebLogicNativeJdbcExtractor()
This constructor retrieves the WebLogic JDBC extension interface, so we can get the underlying vendor connection using reflection.
Method Detail
isNativeConnectionNecessaryForNativeStatements
public boolean isNativeConnectionNecessaryForNativeStatements()
Returntrue
, as WebLogic returns wrapped Statements.- Specified by:
isNativeConnectionNecessaryForNativeStatements
in interfaceNativeJdbcExtractor
- Overrides:
isNativeConnectionNecessaryForNativeStatements
in classNativeJdbcExtractorAdapter
isNativeConnectionNecessaryForNativePreparedStatements
public boolean isNativeConnectionNecessaryForNativePreparedStatements()
Returntrue
, as WebLogic returns wrapped PreparedStatements.- Specified by:
isNativeConnectionNecessaryForNativePreparedStatements
in interfaceNativeJdbcExtractor
- Overrides:
isNativeConnectionNecessaryForNativePreparedStatements
in classNativeJdbcExtractorAdapter
isNativeConnectionNecessaryForNativeCallableStatements
public boolean isNativeConnectionNecessaryForNativeCallableStatements()
Returntrue
, as WebLogic returns wrapped CallableStatements.- Specified by:
isNativeConnectionNecessaryForNativeCallableStatements
in interfaceNativeJdbcExtractor
- Overrides:
isNativeConnectionNecessaryForNativeCallableStatements
in classNativeJdbcExtractorAdapter
doGetNativeConnection
protected Connection doGetNativeConnection(Connection con) throws SQLException
Retrieve the Connection via WebLogic'sgetVendorConnection
method.- Overrides:
doGetNativeConnection
in classNativeJdbcExtractorAdapter
- Throws:
SQLException