Package org.apache.tomcat.dbcp.dbcp2
Class PoolablePreparedStatement<K>
- java.lang.Object
-
- org.apache.tomcat.dbcp.dbcp2.AbandonedTrace
-
- org.apache.tomcat.dbcp.dbcp2.DelegatingStatement
-
- org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement
-
- org.apache.tomcat.dbcp.dbcp2.PoolablePreparedStatement<K>
-
- Type Parameters:
K- the key type
- All Implemented Interfaces:
AutoCloseable,PreparedStatement,Statement,Wrapper,TrackedUse
public class PoolablePreparedStatement<K> extends DelegatingPreparedStatement
ADelegatingPreparedStatementthat cooperates withPoolingConnectionto implement a pool ofPreparedStatements.My
close()method returns me to my containing pool. (SeePoolingConnection.)- Since:
- 2.0
- See Also:
PoolingConnection
-
-
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
Constructors Constructor Description PoolablePreparedStatement(PreparedStatement stmt, K key, KeyedObjectPool<K,PoolablePreparedStatement<K>> pool, DelegatingConnection<?> conn)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()voidaddBatch()Add batch.voidclearBatch()Clear Batch.voidclose()Return me to my pool.voidpassivate()-
Methods inherited from class org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement
clearParameters, execute, executeLargeUpdate, executeQuery, executeUpdate, getMetaData, getParameterMetaData, prepareToReturn, 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, toString
-
Methods inherited from class org.apache.tomcat.dbcp.dbcp2.DelegatingStatement
addBatch, cancel, checkOpen, clearWarnings, closeOnCompletion, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, finalize, getConnection, getConnectionInternal, getDelegate, getFetchDirection, getFetchSize, getGeneratedKeys, getInnermostDelegate, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, handleException, isClosed, isClosedInternal, isCloseOnCompletion, isPoolable, isWrapperFor, setClosedInternal, setCursorName, setDelegate, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap
-
Methods inherited from class org.apache.tomcat.dbcp.dbcp2.AbandonedTrace
addTrace, clearTrace, close, getLastUsed, getLastUsedInstant, getTrace, removeThisTrace, removeTrace, setLastUsed, setLastUsed, setLastUsed
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.sql.Statement
addBatch, cancel, 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
-
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
-
-
-
Constructor Detail
-
PoolablePreparedStatement
public PoolablePreparedStatement(PreparedStatement stmt, K key, KeyedObjectPool<K,PoolablePreparedStatement<K>> pool, DelegatingConnection<?> conn)
Constructor.- Parameters:
stmt- my underlyingPreparedStatementkey- my key" as used byKeyedObjectPoolpool- theKeyedObjectPoolfrom which I was obtained.conn- theConnectionfrom which I was created
-
-
Method Detail
-
activate
public void activate() throws SQLException- Overrides:
activatein classDelegatingStatement- Throws:
SQLException- thrown by the delegating statement.
-
addBatch
public void addBatch() throws SQLExceptionAdd batch.- Specified by:
addBatchin interfacePreparedStatement- Overrides:
addBatchin classDelegatingPreparedStatement- Throws:
SQLException
-
clearBatch
public void clearBatch() throws SQLExceptionClear Batch.- Specified by:
clearBatchin interfaceStatement- Overrides:
clearBatchin classDelegatingStatement- Throws:
SQLException
-
close
public void close() throws SQLExceptionReturn me to my pool.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatement- Overrides:
closein classDelegatingStatement- Throws:
SQLException- Ignored here, for subclasses.
-
passivate
public void passivate() throws SQLException- Overrides:
passivatein classDelegatingStatement- Throws:
SQLException- thrown by the delegating statement.
-
-