Package com.sun.gjc.spi.jdbc40
Class ConnectionWrapper40
- java.lang.Object
-
- com.sun.gjc.spi.base.ConnectionHolder
-
- com.sun.gjc.spi.jdbc40.ConnectionHolder40
-
- com.sun.gjc.spi.jdbc40.ConnectionWrapper40
-
- All Implemented Interfaces:
ConnectionWrapper
,AutoCloseable
,Connection
,Wrapper
public class ConnectionWrapper40 extends ConnectionHolder40 implements ConnectionWrapper
Wrapper class that aids to provide wrapper for the following JDBC objects :
Statement, PreparedStatement, CallableStatement, DatabaseMetaData
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.sun.gjc.spi.base.ConnectionHolder
ConnectionHolder.ConnectionType
-
-
Field Summary
-
Fields inherited from class com.sun.gjc.spi.jdbc40.ConnectionHolder40
defaultClientInfo, localStrings
-
Fields inherited from class com.sun.gjc.spi.base.ConnectionHolder
active, con, isClosed, mc, sm, statementTimeout, statementTimeoutEnabled, valid, wrappedAlready
-
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
-
-
Constructor Summary
Constructors Constructor Description ConnectionWrapper40(Connection con, ManagedConnectionImpl mc, jakarta.resource.spi.ConnectionRequestInfo cxRequestInfo)
Instantiates connection wrapper to wrap JDBC objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CallableStatementWrapper40
callableCachedStatement(String sql, int resultSetType, int resultSetConcurrency, boolean enableCaching)
CallableStatementWrapper40
callableCachedStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean enableCaching)
Statement
createStatement()
Creates a statement from the underlying ConnectionStatement
createStatement(int resultSetType, int resultSetConcurrency)
Creates a statement from the underlying Connection.Statement
createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
Creates a statement from the underlying Connection.DatabaseMetaData
getMetaData()
Retrieves theDatabaseMetaData
object from the underlyingConnection
object.PreparedStatementWrapper40
prepareCachedStatement(String sql, int[] columnIndexes, boolean enableCaching)
PreparedStatementWrapper40
prepareCachedStatement(String sql, int autoGeneratedKeys, boolean enableCaching)
PreparedStatementWrapper40
prepareCachedStatement(String sql, int resultSetType, int resultSetConcurrency, boolean enableCaching)
PreparedStatementWrapper40
prepareCachedStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean enableCaching)
PreparedStatementWrapper40
prepareCachedStatement(String sql, String[] columnNames, boolean enableCaching)
CallableStatement
prepareCall(String sql)
Creates aCallableStatement
object for calling database stored procedures.CallableStatement
prepareCall(String sql, int resultSetType, int resultSetConcurrency)
Creates aCallableStatement
object for calling database stored procedures.CallableStatement
prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
Creates aCallableStatement
object for calling database stored procedures.PreparedStatement
prepareStatement(String sql)
Creates aPreparedStatement
object for sending parameterized SQL statements to databasePreparedStatement
prepareStatement(String sql, int autoGeneratedKeys)
Creates aPreparedStatement
object for sending parameterized SQL statements to databasePreparedStatement
prepareStatement(String sql, int[] columnIndexes)
Creates aPreparedStatement
object for sending parameterized SQL statements to databasePreparedStatement
prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
Creates aPreparedStatement
object for sending parameterized SQL statements to databasePreparedStatement
prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
Creates aPreparedStatement
object for sending parameterized SQL statements to databasePreparedStatement
prepareStatement(String sql, String[] columnNames)
Creates aPreparedStatement
object for sending parameterized SQL statements to database-
Methods inherited from class com.sun.gjc.spi.jdbc40.ConnectionHolder40
abort, close, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStruct, getClientInfo, getClientInfo, getNetworkTimeout, getSchema, init, isValid, isWrapperFor, setClientInfo, setClientInfo, setNetworkTimeout, setSchema, unwrap
-
Methods inherited from class com.sun.gjc.spi.base.ConnectionHolder
associateConnection, checkValidity, clearWarnings, commit, dissociateConnection, getAutoCommit, getCatalog, getConnection, getConnectionType, getHoldability, getManagedConnection, getMethodExecutor, getTransactionIsolation, getTypeMap, getWarnings, invalidate, isClosed, isReadOnly, isWrapped, jdbcPreInvoke, nativeSQL, performLazyAssociation, performLazyEnlistment, releaseSavepoint, rollback, rollback, setActive, setAutoCommit, setCatalog, setClosed, setConnectionType, setHoldability, setLazyAssociatableConnectionManager, setLazyEnlistableConnectionManager, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap, wrapped
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
-
-
-
Constructor Detail
-
ConnectionWrapper40
public ConnectionWrapper40(Connection con, ManagedConnectionImpl mc, jakarta.resource.spi.ConnectionRequestInfo cxRequestInfo)
Instantiates connection wrapper to wrap JDBC objects.- Parameters:
con
- Connection that is wrappedmc
- Managed ConnectioncxRequestInfo
- Connection Request Info
-
-
Method Detail
-
createStatement
public Statement createStatement() throws SQLException
Creates a statement from the underlying Connection- Specified by:
createStatement
in interfaceConnection
- Overrides:
createStatement
in classConnectionHolder
- Returns:
Statement
object.- Throws:
SQLException
- In case of a database error.
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
Creates a statement from the underlying Connection.- Specified by:
createStatement
in interfaceConnection
- Overrides:
createStatement
in classConnectionHolder
- Parameters:
resultSetType
- Type of the ResultSetresultSetConcurrency
- ResultSet Concurrency.- Returns:
Statement
object.- Throws:
SQLException
- In case of a database error.
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
Creates a statement from the underlying Connection.- Specified by:
createStatement
in interfaceConnection
- Overrides:
createStatement
in classConnectionHolder
- Parameters:
resultSetType
- Type of the ResultSetresultSetConcurrency
- ResultSet Concurrency.resultSetHoldability
- ResultSet Holdability.- Returns:
Statement
object.- Throws:
SQLException
- In case of a database error.
-
getMetaData
public DatabaseMetaData getMetaData() throws SQLException
Retrieves theDatabaseMetaData
object from the underlyingConnection
object.- Specified by:
getMetaData
in interfaceConnection
- Overrides:
getMetaData
in classConnectionHolder
- Returns:
DatabaseMetaData
object.- Throws:
SQLException
- In case of a database error.
-
prepareCall
public CallableStatement prepareCall(String sql) throws SQLException
Creates aCallableStatement
object for calling database stored procedures.- Specified by:
prepareCall
in interfaceConnection
- Overrides:
prepareCall
in classConnectionHolder
- Parameters:
sql
- SQL Statement- Returns:
CallableStatement
object.- Throws:
SQLException
- In case of a database error.
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
Creates aCallableStatement
object for calling database stored procedures.- Specified by:
prepareCall
in interfaceConnection
- Overrides:
prepareCall
in classConnectionHolder
- Parameters:
sql
- SQL StatementresultSetType
- Type of the ResultSetresultSetConcurrency
- ResultSet Concurrency.- Returns:
CallableStatement
object.- Throws:
SQLException
- In case of a database error.
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
Creates aCallableStatement
object for calling database stored procedures.- Specified by:
prepareCall
in interfaceConnection
- Overrides:
prepareCall
in classConnectionHolder
- Parameters:
sql
- SQL StatementresultSetType
- Type of the ResultSetresultSetConcurrency
- ResultSet Concurrency.resultSetHoldability
- ResultSet Holdability.- Returns:
CallableStatement
object.- Throws:
SQLException
- In case of a database error.
-
prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException
Creates aPreparedStatement
object for sending parameterized SQL statements to database- Specified by:
prepareStatement
in interfaceConnection
- Overrides:
prepareStatement
in classConnectionHolder
- Parameters:
sql
- SQL Statement- Returns:
PreparedStatement
object.- Throws:
SQLException
- In case of a database error.
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
Creates aPreparedStatement
object for sending parameterized SQL statements to database- Specified by:
prepareStatement
in interfaceConnection
- Overrides:
prepareStatement
in classConnectionHolder
- Parameters:
sql
- SQL StatementautoGeneratedKeys
- a flag indicating AutoGeneratedKeys need to be returned.- Returns:
PreparedStatement
object.- Throws:
SQLException
- In case of a database error.
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
Creates aPreparedStatement
object for sending parameterized SQL statements to database- Specified by:
prepareStatement
in interfaceConnection
- Overrides:
prepareStatement
in classConnectionHolder
- Parameters:
sql
- SQL StatementcolumnIndexes
- an array of column indexes indicating the columns that should be returned from the inserted row or rows.- Returns:
PreparedStatement
object.- Throws:
SQLException
- In case of a database error.
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
Creates aPreparedStatement
object for sending parameterized SQL statements to database- Specified by:
prepareStatement
in interfaceConnection
- Overrides:
prepareStatement
in classConnectionHolder
- Parameters:
sql
- SQL StatementresultSetType
- Type of the ResultSetresultSetConcurrency
- ResultSet Concurrency.- Returns:
PreparedStatement
object.- Throws:
SQLException
- In case of a database error.
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
Creates aPreparedStatement
object for sending parameterized SQL statements to database- Specified by:
prepareStatement
in interfaceConnection
- Overrides:
prepareStatement
in classConnectionHolder
- Parameters:
sql
- SQL StatementresultSetType
- Type of the ResultSetresultSetConcurrency
- ResultSet Concurrency.resultSetHoldability
- ResultSet Holdability.- Returns:
PreparedStatement
object.- Throws:
SQLException
- In case of a database error.
-
prepareStatement
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
Creates aPreparedStatement
object for sending parameterized SQL statements to database- Specified by:
prepareStatement
in interfaceConnection
- Overrides:
prepareStatement
in classConnectionHolder
- Parameters:
sql
- SQL StatementcolumnNames
- Name of bound columns.- Returns:
PreparedStatement
object.- Throws:
SQLException
- In case of a database error.
-
prepareCachedStatement
public PreparedStatementWrapper40 prepareCachedStatement(String sql, int resultSetType, int resultSetConcurrency, boolean enableCaching) throws SQLException
- Specified by:
prepareCachedStatement
in interfaceConnectionWrapper
- Throws:
SQLException
-
prepareCachedStatement
public PreparedStatementWrapper40 prepareCachedStatement(String sql, String[] columnNames, boolean enableCaching) throws SQLException
- Specified by:
prepareCachedStatement
in interfaceConnectionWrapper
- Throws:
SQLException
-
prepareCachedStatement
public PreparedStatementWrapper40 prepareCachedStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean enableCaching) throws SQLException
- Specified by:
prepareCachedStatement
in interfaceConnectionWrapper
- Throws:
SQLException
-
prepareCachedStatement
public PreparedStatementWrapper40 prepareCachedStatement(String sql, int[] columnIndexes, boolean enableCaching) throws SQLException
- Specified by:
prepareCachedStatement
in interfaceConnectionWrapper
- Throws:
SQLException
-
prepareCachedStatement
public PreparedStatementWrapper40 prepareCachedStatement(String sql, int autoGeneratedKeys, boolean enableCaching) throws SQLException
- Specified by:
prepareCachedStatement
in interfaceConnectionWrapper
- Throws:
SQLException
-
callableCachedStatement
public CallableStatementWrapper40 callableCachedStatement(String sql, int resultSetType, int resultSetConcurrency, boolean enableCaching) throws SQLException
- Specified by:
callableCachedStatement
in interfaceConnectionWrapper
- Throws:
SQLException
-
callableCachedStatement
public CallableStatementWrapper40 callableCachedStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean enableCaching) throws SQLException
- Specified by:
callableCachedStatement
in interfaceConnectionWrapper
- Throws:
SQLException
-
-