org.springframework.jdbc.support.nativejdbc
Class XAPoolNativeJdbcExtractor

java.lang.Object
  extended byorg.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
      extended byorg.springframework.jdbc.support.nativejdbc.XAPoolNativeJdbcExtractor
All Implemented Interfaces:
NativeJdbcExtractor

public class XAPoolNativeJdbcExtractor
extends NativeJdbcExtractorAdapter

Implementation of the NativeJdbcExtractor interface for ObjectWeb's XAPool. Returns underlying native Connections and native PreparedStatements to application code instead of XAPool's wrapper implementations; unwraps the Connection for native Statements and native CallableStatements. The returned JDBC classes can then safely be cast, e.g. to OracleResultSet.

This NativeJdbcExtractor can be set just to allow working with an XAPool DataSource: If a given object is not an XAPool wrapper, it will be returned as-is.

Since:
06.02.2004
Author:
Juergen Hoeller

Constructor Summary
XAPoolNativeJdbcExtractor()
           
 
Method Summary
protected  Connection doGetNativeConnection(Connection con)
          Not able to unwrap: return passed-in Connection.
 PreparedStatement getNativePreparedStatement(PreparedStatement ps)
          Not able to unwrap: return passed-in PreparedStatement.
 boolean isNativeConnectionNecessaryForNativeCallableStatements()
          Return true, as CoreCallableStatement does not allow access to the underlying Connection.
 boolean isNativeConnectionNecessaryForNativeStatements()
          Return true, as CoreStatement does not allow access to the underlying Connection.
 
Methods inherited from class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
getNativeCallableStatement, getNativeConnection, getNativeConnectionFromStatement, getNativeResultSet, getNativeStatement, isNativeConnectionNecessaryForNativePreparedStatements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XAPoolNativeJdbcExtractor

public XAPoolNativeJdbcExtractor()
Method Detail

isNativeConnectionNecessaryForNativeStatements

public boolean isNativeConnectionNecessaryForNativeStatements()
Return true, as CoreStatement does not allow access to the underlying Connection.

Specified by:
isNativeConnectionNecessaryForNativeStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativeStatements in class NativeJdbcExtractorAdapter

isNativeConnectionNecessaryForNativeCallableStatements

public boolean isNativeConnectionNecessaryForNativeCallableStatements()
Return true, as CoreCallableStatement does not allow access to the underlying Connection.

Specified by:
isNativeConnectionNecessaryForNativeCallableStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativeCallableStatements in class NativeJdbcExtractorAdapter

doGetNativeConnection

protected Connection doGetNativeConnection(Connection con)
                                    throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in Connection.

Overrides:
doGetNativeConnection in class NativeJdbcExtractorAdapter
Throws:
SQLException

getNativePreparedStatement

public PreparedStatement getNativePreparedStatement(PreparedStatement ps)
                                             throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in PreparedStatement.

Specified by:
getNativePreparedStatement in interface NativeJdbcExtractor
Overrides:
getNativePreparedStatement in class NativeJdbcExtractorAdapter
Throws:
SQLException


Copyright (C) 2003-2004 The Spring Framework Project.