Package bitronix.tm.resource.jdbc
Class JdbcPreparedStatementHandle
java.lang.Object
bitronix.tm.resource.jdbc.BaseProxyHandlerClass
bitronix.tm.resource.jdbc.JdbcPreparedStatementHandle
- All Implemented Interfaces:
InvocationHandler
Caching
PreparedStatement wrapper.
This class is a proxy handler for a PreparedStatement. It does not
implement the PreparedStatement interface or extend a class directly,
but you methods implemented here will override those of the
underlying delegate. Simply implement a method with the same
signature, and the local method will be called rather than the delegate.
- Author:
- lorban, brettw
-
Constructor Summary
ConstructorsConstructorDescriptionJdbcPreparedStatementHandle(String sql, int autoGeneratedKeys) JdbcPreparedStatementHandle(String sql, int[] columnIndexes) JdbcPreparedStatementHandle(String sql, int resultSetType, int resultSetConcurrency) JdbcPreparedStatementHandle(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) JdbcPreparedStatementHandle(String sql, String[] columnNames) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanOverridden equals() that takes all PreparedStatement attributes into account.protected PreparedStatementprotected JdbcPooledConnectionMust be implemented by the sub-class of this class.inthashCode()booleanisClosed()booleanisWrapperFor(Class<?> iface) protected voidsetDelegate(PreparedStatement delegate) protected voidsetPooledConnection(JdbcPooledConnection pooledConnection) Set the parent connection that created this statement.toString()<T> TMethods inherited from class bitronix.tm.resource.jdbc.BaseProxyHandlerClass
invoke
-
Constructor Details
-
JdbcPreparedStatementHandle
-
JdbcPreparedStatementHandle
-
JdbcPreparedStatementHandle
-
JdbcPreparedStatementHandle
public JdbcPreparedStatementHandle(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) -
JdbcPreparedStatementHandle
-
JdbcPreparedStatementHandle
-
-
Method Details
-
isWrapperFor
- Throws:
SQLException
-
unwrap
- Throws:
SQLException
-
setPooledConnection
Set the parent connection that created this statement. We need this to return the PreparedStatement to the pool.- Parameters:
pooledConnection- the parent JdbcPooledConnection
-
getPooledConnection
-
getDelegateUnchecked
-
setDelegate
-
getProxiedDelegate
Description copied from class:BaseProxyHandlerClassMust be implemented by the sub-class of this class. This method should return the "true" object to be delegated to in the case that the method is not overridden by the sub-class.- Specified by:
getProxiedDelegatein classBaseProxyHandlerClass- Returns:
- the true delegate object
- Throws:
Exception- can throw any exception if desired
-
equals
Overridden equals() that takes all PreparedStatement attributes into account. -
hashCode
public int hashCode() -
toString
-
close
- Throws:
SQLException
-
isClosed
- Throws:
SQLException
-