public class PoolablePreparedStatement extends DelegatingPreparedStatement implements PreparedStatement
DelegatingPreparedStatement
that cooperates with
PoolingConnection
to implement a pool of PreparedStatement
s.
My close()
method returns me to my containing pool. (See PoolingConnection
.)
PoolingConnection
Modifier and Type | Field and Description |
---|---|
protected Object |
_key
My "key" as used by
KeyedObjectPool . |
protected KeyedObjectPool |
_pool
The
KeyedObjectPool from which I was obtained. |
_closed, _conn, _stmt
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
Constructor and Description |
---|
PoolablePreparedStatement(PreparedStatement stmt,
Object key,
KeyedObjectPool pool,
Connection conn)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
activate() |
void |
addBatch()
Add batch.
|
void |
clearBatch()
Clear Batch.
|
void |
close()
Return me to my pool.
|
protected void |
passivate() |
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, setUnicodeStream, setURL, toString
addBatch, cancel, checkOpen, clearWarnings, closeOnCompletion, 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, isCloseOnCompletion, 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
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, 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
isWrapperFor, unwrap
protected KeyedObjectPool _pool
KeyedObjectPool
from which I was obtained.protected Object _key
KeyedObjectPool
.public PoolablePreparedStatement(PreparedStatement stmt, Object key, KeyedObjectPool pool, Connection 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 SQLException
addBatch
in interface PreparedStatement
addBatch
in class DelegatingPreparedStatement
SQLException
public void clearBatch() throws SQLException
clearBatch
in interface Statement
clearBatch
in class DelegatingStatement
SQLException
public void close() throws SQLException
close
in interface AutoCloseable
close
in interface Statement
close
in class DelegatingStatement
SQLException
protected void activate() throws SQLException
activate
in class DelegatingStatement
SQLException
protected void passivate() throws SQLException
passivate
in class DelegatingStatement
SQLException
Copyright © 2015. All rights reserved.