Package org.apache.commons.dbcp
Class PoolablePreparedStatement
java.lang.Object
org.apache.commons.dbcp.AbandonedTrace
org.apache.commons.dbcp.DelegatingStatement
org.apache.commons.dbcp.DelegatingPreparedStatement
org.apache.commons.dbcp.PoolablePreparedStatement
- All Implemented Interfaces:
AutoCloseable,PreparedStatement,Statement,Wrapper
public class PoolablePreparedStatement
extends DelegatingPreparedStatement
implements PreparedStatement
A
DelegatingPreparedStatement that cooperates with
PoolingConnection to implement a pool of PreparedStatements.
My close() method returns me to my containing pool. (See PoolingConnection.)
- Version:
- $Revision: 745860 $ $Date: 2009-02-19 08:45:07 -0500 (Thu, 19 Feb 2009) $
- Author:
- Rodney Waldhoff, Glenn L. Nielsen, James House, Dirk Verbeeck
- See Also:
-
Field Summary
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO -
Constructor Summary
ConstructorsConstructorDescriptionPoolablePreparedStatement(PreparedStatement stmt, Object key, org.apache.commons.pool.KeyedObjectPool pool, Connection conn) Constructor -
Method Summary
Methods inherited from class org.apache.commons.dbcp.DelegatingPreparedStatement
clearParameters, equals, execute, 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, 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, toStringMethods inherited from class org.apache.commons.dbcp.DelegatingStatement
addBatch, cancel, 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, unwrapMethods inherited from class org.apache.commons.dbcp.AbandonedTrace
printStackTraceMethods inherited from interface java.sql.PreparedStatement
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, setURLMethods inherited from interface java.sql.Statement
addBatch, cancel, clearWarnings, 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, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeoutMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Constructor Details
-
PoolablePreparedStatement
public PoolablePreparedStatement(PreparedStatement stmt, Object key, org.apache.commons.pool.KeyedObjectPool pool, Connection conn) Constructor- Parameters:
stmt- my underlyingPreparedStatementkey- my key" as used byKeyedObjectPoolpool- theKeyedObjectPoolfrom which I was obtained.conn- theConnectionfrom which I was created
-
-
Method Details
-
addBatch
Add batch.- Specified by:
addBatchin interfacePreparedStatement- Overrides:
addBatchin classDelegatingPreparedStatement- Throws:
SQLException
-
clearBatch
Clear Batch.- Specified by:
clearBatchin interfaceStatement- Overrides:
clearBatchin classDelegatingStatement- Throws:
SQLException
-
close
Return me to my pool.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatement- Overrides:
closein classDelegatingStatement- Throws:
SQLException
-
isCloseOnCompletion
- Specified by:
isCloseOnCompletionin interfaceStatement- Overrides:
isCloseOnCompletionin classDelegatingPreparedStatement- Throws:
SQLException
-
closeOnCompletion
- Specified by:
closeOnCompletionin interfaceStatement- Overrides:
closeOnCompletionin classDelegatingPreparedStatement- Throws:
SQLException
-