public class PoolableCallableStatement extends DelegatingCallableStatement implements java.sql.CallableStatement
DelegatingCallableStatement
that cooperates with
PoolingConnection
to implement a pool of CallableStatement
s.
The close()
method returns this statement to its containing pool. (See PoolingConnection
.)
PoolingConnection
AbandonedTrace.AbandonedObjectException
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
_key
Key for this statement in the containing
KeyedObjectPool . |
private org.apache.commons.pool.KeyedObjectPool |
_pool
The
KeyedObjectPool from which this CallableStatement was obtained. |
_closed, _conn, _stmt
Constructor and Description |
---|
PoolableCallableStatement(java.sql.CallableStatement stmt,
java.lang.Object key,
org.apache.commons.pool.KeyedObjectPool pool,
java.sql.Connection conn)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
activate()
Activates after retrieval from the pool.
|
void |
close()
Returns the CallableStatement to the pool.
|
<T> T |
getObject(int columnIndex,
java.lang.Class<T> type) |
<T> T |
getObject(java.lang.String columnLabel,
java.lang.Class<T> type) |
protected void |
passivate()
Passivates to prepare for return to the pool.
|
equals, getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDelegate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, wasNull
addBatch, clearParameters, closeOnCompletion, execute, executeQuery, executeUpdate, getMetaData, getParameterMetaData, isCloseOnCompletion, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDelegate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL, toString
addBatch, cancel, checkOpen, clearBatch, clearWarnings, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getDelegate, getFetchDirection, getFetchSize, getGeneratedKeys, getInnermostDelegate, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, handleException, hashCode, isClosed, isPoolable, isWrapperFor, setCursorName, setDelegate, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap
addTrace, clearTrace, getConfig, getLastUsed, getTrace, printStackTrace, removeTrace, setLastUsed, setLastUsed, setStackTrace
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, wasNull
addBatch, clearParameters, execute, executeLargeUpdate, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
addBatch, cancel, clearBatch, clearWarnings, closeOnCompletion, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
private final org.apache.commons.pool.KeyedObjectPool _pool
KeyedObjectPool
from which this CallableStatement was obtained.private final java.lang.Object _key
KeyedObjectPool
.public PoolableCallableStatement(java.sql.CallableStatement stmt, java.lang.Object key, org.apache.commons.pool.KeyedObjectPool pool, java.sql.Connection conn)
stmt
- the underlying CallableStatement
key
- the key for this statement in the KeyedObjectPool
pool
- the KeyedObjectPool
from which this CallableStatement was obtainedconn
- the Connection
that created this CallableStatementpublic void close() throws java.sql.SQLException
DelegatingStatement.isClosed()
, this is a No-op.close
in interface java.lang.AutoCloseable
close
in interface java.sql.Statement
close
in class DelegatingStatement
java.sql.SQLException
protected void activate() throws java.sql.SQLException
activate
in class DelegatingStatement
java.sql.SQLException
protected void passivate() throws java.sql.SQLException
passivate
in class DelegatingStatement
java.sql.SQLException
public <T> T getObject(java.lang.String columnLabel, java.lang.Class<T> type) throws java.sql.SQLException
getObject
in interface java.sql.CallableStatement
getObject
in class DelegatingCallableStatement
java.sql.SQLException
public <T> T getObject(int columnIndex, java.lang.Class<T> type) throws java.sql.SQLException
getObject
in interface java.sql.CallableStatement
getObject
in class DelegatingCallableStatement
java.sql.SQLException