Package org.apache.commons.dbcp
Class PoolableCallableStatement
- java.lang.Object
-
- org.apache.commons.dbcp.AbandonedTrace
-
- org.apache.commons.dbcp.DelegatingStatement
-
- org.apache.commons.dbcp.DelegatingPreparedStatement
-
- org.apache.commons.dbcp.DelegatingCallableStatement
-
- org.apache.commons.dbcp.PoolableCallableStatement
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,java.sql.CallableStatement
,java.sql.PreparedStatement
,java.sql.Statement
,java.sql.Wrapper
public class PoolableCallableStatement extends DelegatingCallableStatement implements java.sql.CallableStatement
ADelegatingCallableStatement
that cooperates withPoolingConnection
to implement a pool ofCallableStatement
s.The
close()
method returns this statement to its containing pool. (SeePoolingConnection
.)- Since:
- 1.3
- Version:
- $Revision: 883040 $ $Date: 2009-11-22 01:01:20 -0500 (Sun, 22 Nov 2009) $
- See Also:
PoolingConnection
-
-
Constructor Summary
Constructors Constructor Description PoolableCallableStatement(java.sql.CallableStatement stmt, java.lang.Object key, org.apache.commons.pool.KeyedObjectPool pool, java.sql.Connection conn)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
-
Methods inherited from class org.apache.commons.dbcp.DelegatingCallableStatement
equals, getArray, getArray, 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
-
Methods inherited from class org.apache.commons.dbcp.DelegatingPreparedStatement
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, setURL, toString
-
Methods inherited from class org.apache.commons.dbcp.DelegatingStatement
addBatch, cancel, 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, hashCode, isClosed, isPoolable, isWrapperFor, setCursorName, setDelegate, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap
-
Methods inherited from class org.apache.commons.dbcp.AbandonedTrace
printStackTrace
-
Methods inherited from interface java.sql.CallableStatement
getArray, getArray, 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
-
Methods inherited from interface java.sql.PreparedStatement
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, setURL
-
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, 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, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
-
-
-
-
Constructor Detail
-
PoolableCallableStatement
public PoolableCallableStatement(java.sql.CallableStatement stmt, java.lang.Object key, org.apache.commons.pool.KeyedObjectPool pool, java.sql.Connection conn)
Constructor.- Parameters:
stmt
- the underlyingCallableStatement
key
- the key for this statement in theKeyedObjectPool
pool
- theKeyedObjectPool
from which this CallableStatement was obtainedconn
- theConnection
that created this CallableStatement
-
-
Method Detail
-
close
public void close() throws java.sql.SQLException
Returns the CallableStatement to the pool. If {DelegatingStatement.isClosed()
, this is a No-op.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.sql.Statement
- Overrides:
close
in classDelegatingStatement
- Throws:
java.sql.SQLException
-
getObject
public <T> T getObject(java.lang.String columnLabel, java.lang.Class<T> type) throws java.sql.SQLException
- Specified by:
getObject
in interfacejava.sql.CallableStatement
- Overrides:
getObject
in classDelegatingCallableStatement
- Throws:
java.sql.SQLException
-
getObject
public <T> T getObject(int columnIndex, java.lang.Class<T> type) throws java.sql.SQLException
- Specified by:
getObject
in interfacejava.sql.CallableStatement
- Overrides:
getObject
in classDelegatingCallableStatement
- Throws:
java.sql.SQLException
-
-