K
- the key typejava.lang.AutoCloseable
, java.sql.PreparedStatement
, java.sql.Statement
, java.sql.Wrapper
, TrackedUse
public class PoolablePreparedStatement<K> extends DelegatingPreparedStatement
DelegatingPreparedStatement
that cooperates with
PoolingConnection
to implement a pool of PreparedStatement
s.
My close()
method returns me to my containing pool. (See PoolingConnection
.)
PoolingConnection
Constructor | Description |
---|---|
PoolablePreparedStatement(java.sql.PreparedStatement stmt,
K key,
KeyedObjectPool<K,PoolablePreparedStatement<K>> pool,
DelegatingConnection<?> conn) |
Constructor
|
Modifier and Type | Method | Description |
---|---|---|
void |
activate() |
|
void |
addBatch() |
Add batch.
|
void |
clearBatch() |
Clear Batch.
|
void |
close() |
Return me to my pool.
|
void |
passivate() |
addTrace, clearTrace, getLastUsed, getTrace, removeTrace, setLastUsed, setLastUsed
clearParameters, 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, 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, clearWarnings, closeOnCompletion, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, finalize, getConnection, getConnectionInternal, getDelegate, getFetchDirection, getFetchSize, getGeneratedKeys, getInnermostDelegate, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, handleException, isClosed, isClosedInternal, isCloseOnCompletion, isPoolable, isWrapperFor, setClosedInternal, setCursorName, setDelegate, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
executeLargeUpdate, setObject, setObject
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
public PoolablePreparedStatement(java.sql.PreparedStatement stmt, K key, KeyedObjectPool<K,PoolablePreparedStatement<K>> pool, DelegatingConnection<?> conn)
stmt
- my underlying PreparedStatement
key
- my key" as used by KeyedObjectPool
pool
- the KeyedObjectPool
from which I was obtained.conn
- the Connection
from which I was createdpublic void addBatch() throws java.sql.SQLException
addBatch
in interface java.sql.PreparedStatement
addBatch
in class DelegatingPreparedStatement
java.sql.SQLException
public void clearBatch() throws java.sql.SQLException
clearBatch
in interface java.sql.Statement
clearBatch
in class DelegatingStatement
java.sql.SQLException
public void close() throws java.sql.SQLException
close
in interface java.lang.AutoCloseable
close
in interface java.sql.Statement
close
in class DelegatingStatement
java.sql.SQLException
public void activate() throws java.sql.SQLException
activate
in class DelegatingStatement
java.sql.SQLException
public void passivate() throws java.sql.SQLException
passivate
in class DelegatingStatement
java.sql.SQLException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.