Package org.apache.tomcat.dbcp.dbcp2
Class DelegatingPreparedStatement
java.lang.Object
org.apache.tomcat.dbcp.dbcp2.AbandonedTrace
org.apache.tomcat.dbcp.dbcp2.DelegatingStatement
org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement
- All Implemented Interfaces:
- AutoCloseable,- PreparedStatement,- Statement,- Wrapper,- TrackedUse
- Direct Known Subclasses:
- DelegatingCallableStatement,- PoolablePreparedStatement
A base delegating implementation of 
PreparedStatement.
 
 All of the methods from the PreparedStatement interface simply check to see that the
 PreparedStatement is active, and call the corresponding method on the "delegate" provided in my constructor.
 
Extends AbandonedTrace to implement Statement tracking and logging of code which created the Statement. Tracking the Statement ensures that the Connection which created it can close any open Statement's on Connection close.
- Since:
- 2.0
- 
Field SummaryFields inherited from interface java.sql.StatementCLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
- 
Constructor SummaryConstructorsConstructorDescriptionDelegatingPreparedStatement(DelegatingConnection<?> connection, PreparedStatement statement) Create a wrapper for the Statement which traces this Statement to the Connection which created it and the code which created it.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddBatch()voidbooleanexecute()longintprotected voidvoidvoidsetAsciiStream(int parameterIndex, InputStream inputStream) voidsetAsciiStream(int parameterIndex, InputStream x, int length) voidsetAsciiStream(int parameterIndex, InputStream inputStream, long length) voidsetBigDecimal(int parameterIndex, BigDecimal x) voidsetBinaryStream(int parameterIndex, InputStream inputStream) voidsetBinaryStream(int parameterIndex, InputStream x, int length) voidsetBinaryStream(int parameterIndex, InputStream inputStream, long length) voidsetBlob(int parameterIndex, InputStream inputStream) voidsetBlob(int parameterIndex, InputStream inputStream, long length) voidvoidsetBoolean(int parameterIndex, boolean x) voidsetByte(int parameterIndex, byte x) voidsetBytes(int parameterIndex, byte[] x) voidsetCharacterStream(int parameterIndex, Reader reader) voidsetCharacterStream(int parameterIndex, Reader reader, int length) voidsetCharacterStream(int parameterIndex, Reader reader, long length) voidvoidvoidvoidvoidvoidsetDouble(int parameterIndex, double x) voidsetFloat(int parameterIndex, float x) voidsetInt(int parameterIndex, int x) voidsetLong(int parameterIndex, long x) voidsetNCharacterStream(int parameterIndex, Reader reader) voidsetNCharacterStream(int parameterIndex, Reader value, long length) voidvoidvoidvoidsetNString(int parameterIndex, String value) voidsetNull(int parameterIndex, int sqlType) voidvoidvoidvoidvoidvoidvoidvoidvoidsetShort(int parameterIndex, short x) voidvoidvoidvoidvoidsetTimestamp(int parameterIndex, Timestamp x) voidsetTimestamp(int parameterIndex, Timestamp x, Calendar cal) voidsetUnicodeStream(int parameterIndex, InputStream x, int length) Deprecated.Use setAsciiStream(), setCharacterStream() or setNCharacterStream()voidtoString()Returns a String representation of this object.Methods inherited from class org.apache.tomcat.dbcp.dbcp2.DelegatingStatementactivate, addBatch, cancel, checkOpen, clearBatch, clearWarnings, close, 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, passivate, setClosedInternal, setCursorName, setDelegate, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrapMethods inherited from class org.apache.tomcat.dbcp.dbcp2.AbandonedTraceaddTrace, clearTrace, close, getLastUsed, getLastUsedInstant, getTrace, removeThisTrace, removeTrace, setLastUsed, setLastUsed, setLastUsedMethods inherited from class java.lang.Objectclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.sql.StatementaddBatch, cancel, clearBatch, clearWarnings, close, 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, setQueryTimeoutMethods inherited from interface java.sql.WrapperisWrapperFor, unwrap
- 
Constructor Details- 
DelegatingPreparedStatementCreate a wrapper for the Statement which traces this Statement to the Connection which created it and the code which created it.- Parameters:
- statement- the- PreparedStatementto delegate all calls to.
- connection- the- DelegatingConnectionthat created this statement.
 
 
- 
- 
Method Details- 
addBatch- Specified by:
- addBatchin interface- PreparedStatement
- Throws:
- SQLException
 
- 
clearParameters- Specified by:
- clearParametersin interface- PreparedStatement
- Throws:
- SQLException
 
- 
execute- Specified by:
- executein interface- PreparedStatement
- Throws:
- SQLException
 
- 
executeLargeUpdate- Specified by:
- executeLargeUpdatein interface- PreparedStatement
- Throws:
- SQLException
- Since:
- 2.5.0
 
- 
executeQuery- Specified by:
- executeQueryin interface- PreparedStatement
- Throws:
- SQLException
 
- 
executeUpdate- Specified by:
- executeUpdatein interface- PreparedStatement
- Throws:
- SQLException
 
- 
getMetaData- Specified by:
- getMetaDatain interface- PreparedStatement
- Throws:
- SQLException
 
- 
getParameterMetaData- Specified by:
- getParameterMetaDatain interface- PreparedStatement
- Throws:
- SQLException
 
- 
setArray- Specified by:
- setArrayin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setAsciiStream- Specified by:
- setAsciiStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setAsciiStream- Specified by:
- setAsciiStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setAsciiStreampublic void setAsciiStream(int parameterIndex, InputStream inputStream, long length) throws SQLException - Specified by:
- setAsciiStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setBigDecimal- Specified by:
- setBigDecimalin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setBinaryStream- Specified by:
- setBinaryStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setBinaryStream- Specified by:
- setBinaryStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setBinaryStreampublic void setBinaryStream(int parameterIndex, InputStream inputStream, long length) throws SQLException - Specified by:
- setBinaryStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setBlob- Specified by:
- setBlobin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setBlob- Specified by:
- setBlobin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setBlob- Specified by:
- setBlobin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setBoolean- Specified by:
- setBooleanin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setByte- Specified by:
- setBytein interface- PreparedStatement
- Throws:
- SQLException
 
- 
setBytes- Specified by:
- setBytesin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setCharacterStream- Specified by:
- setCharacterStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setCharacterStream- Specified by:
- setCharacterStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setCharacterStream- Specified by:
- setCharacterStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setClob- Specified by:
- setClobin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setClob- Specified by:
- setClobin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setClob- Specified by:
- setClobin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setDate- Specified by:
- setDatein interface- PreparedStatement
- Throws:
- SQLException
 
- 
setDate- Specified by:
- setDatein interface- PreparedStatement
- Throws:
- SQLException
 
- 
setDouble- Specified by:
- setDoublein interface- PreparedStatement
- Throws:
- SQLException
 
- 
setFloat- Specified by:
- setFloatin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setInt- Specified by:
- setIntin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setLong- Specified by:
- setLongin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setNCharacterStream- Specified by:
- setNCharacterStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setNCharacterStream- Specified by:
- setNCharacterStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setNClob- Specified by:
- setNClobin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setNClob- Specified by:
- setNClobin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setNClob- Specified by:
- setNClobin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setNString- Specified by:
- setNStringin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setNull- Specified by:
- setNullin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setNull- Specified by:
- setNullin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setObject- Specified by:
- setObjectin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setObject- Specified by:
- setObjectin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setObjectpublic void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException - Specified by:
- setObjectin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setObject- Specified by:
- setObjectin interface- PreparedStatement
- Throws:
- SQLException
- Since:
- 2.5.0
 
- 
setObjectpublic void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException - Specified by:
- setObjectin interface- PreparedStatement
- Throws:
- SQLException
- Since:
- 2.5.0
 
- 
setRef- Specified by:
- setRefin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setRowId- Specified by:
- setRowIdin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setShort- Specified by:
- setShortin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setSQLXML- Specified by:
- setSQLXMLin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setString- Specified by:
- setStringin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setTime- Specified by:
- setTimein interface- PreparedStatement
- Throws:
- SQLException
 
- 
setTime- Specified by:
- setTimein interface- PreparedStatement
- Throws:
- SQLException
 
- 
setTimestamp- Specified by:
- setTimestampin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setTimestamp- Specified by:
- setTimestampin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setUnicodeStream@Deprecated public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException Deprecated.Use setAsciiStream(), setCharacterStream() or setNCharacterStream()- Specified by:
- setUnicodeStreamin interface- PreparedStatement
- Throws:
- SQLException
 
- 
setURL- Specified by:
- setURLin interface- PreparedStatement
- Throws:
- SQLException
 
- 
toStringReturns a String representation of this object.- Overrides:
- toStringin class- DelegatingStatement
- Returns:
- String
 
- 
prepareToReturn- Throws:
- SQLException
 
 
-