Save This Page
Home » commons-dbcp-1.2.2-src » org.apache.commons » dbcp » [javadoc | source]
org.apache.commons.dbcp
public class: DelegatingPreparedStatement [javadoc | source]
java.lang.Object
   org.apache.commons.dbcp.AbandonedTrace
      org.apache.commons.dbcp.DelegatingStatement
         org.apache.commons.dbcp.DelegatingPreparedStatement

All Implemented Interfaces:
    PreparedStatement, Statement

Direct Known Subclasses:
    PoolablePreparedStatement, DelegatingCallableStatement, PoolablePreparedStatementStub

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.

Field Summary
protected  PreparedStatement _stmt    My delegate. 
Fields inherited from org.apache.commons.dbcp.DelegatingStatement:
_stmt,  _conn,  _closed
Constructor:
 public DelegatingPreparedStatement(DelegatingConnection c,
    PreparedStatement s) 
    Create a wrapper for the Statement which traces this Statement to the Connection which created it and the code which created it.
Method from org.apache.commons.dbcp.DelegatingPreparedStatement Summary:
addBatch,   clearParameters,   equals,   execute,   executeQuery,   executeUpdate,   getMetaData,   getParameterMetaData,   setArray,   setAsciiStream,   setBigDecimal,   setBinaryStream,   setBlob,   setBoolean,   setByte,   setBytes,   setCharacterStream,   setClob,   setDate,   setDate,   setDelegate,   setDouble,   setFloat,   setInt,   setLong,   setNull,   setNull,   setObject,   setObject,   setObject,   setRef,   setShort,   setString,   setTime,   setTime,   setTimestamp,   setTimestamp,   setURL,   setUnicodeStream,   toString
Methods from org.apache.commons.dbcp.DelegatingStatement:
activate,   addBatch,   cancel,   checkOpen,   clearBatch,   clearWarnings,   close,   equals,   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,   passivate,   setCursorName,   setDelegate,   setEscapeProcessing,   setFetchDirection,   setFetchSize,   setMaxFieldSize,   setMaxRows,   setQueryTimeout,   toString
Methods from org.apache.commons.dbcp.AbandonedTrace:
addTrace,   clearTrace,   getConfig,   getLastUsed,   getTrace,   printStackTrace,   removeTrace,   setLastUsed,   setLastUsed,   setStackTrace
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.dbcp.DelegatingPreparedStatement Detail:
 public  void addBatch() throws SQLException 
 public  void clearParameters() throws SQLException 
 public boolean equals(Object obj) 
 public boolean execute() throws SQLException 
 public ResultSet executeQuery() throws SQLException 
 public int executeUpdate() throws SQLException 
 public ResultSetMetaData getMetaData() throws SQLException 
 public ParameterMetaData getParameterMetaData() throws SQLException 
 public  void setArray(int i,
    Array x) throws SQLException 
 public  void setAsciiStream(int parameterIndex,
    InputStream x,
    int length) throws SQLException 
 public  void setBigDecimal(int parameterIndex,
    BigDecimal x) throws SQLException 
 public  void setBinaryStream(int parameterIndex,
    InputStream x,
    int length) throws SQLException 
 public  void setBlob(int i,
    Blob x) throws SQLException 
 public  void setBoolean(int parameterIndex,
    boolean x) throws SQLException 
 public  void setByte(int parameterIndex,
    byte x) throws SQLException 
 public  void setBytes(int parameterIndex,
    byte[] x) throws SQLException 
 public  void setCharacterStream(int parameterIndex,
    Reader reader,
    int length) throws SQLException 
 public  void setClob(int i,
    Clob x) throws SQLException 
 public  void setDate(int parameterIndex,
    Date x) throws SQLException 
 public  void setDate(int parameterIndex,
    Date x,
    Calendar cal) throws SQLException 
 public  void setDelegate(PreparedStatement s) 
    Sets my delegate.
 public  void setDouble(int parameterIndex,
    double x) throws SQLException 
 public  void setFloat(int parameterIndex,
    float x) throws SQLException 
 public  void setInt(int parameterIndex,
    int x) throws SQLException 
 public  void setLong(int parameterIndex,
    long x) throws SQLException 
 public  void setNull(int parameterIndex,
    int sqlType) throws SQLException 
 public  void setNull(int paramIndex,
    int sqlType,
    String typeName) throws SQLException 
 public  void setObject(int parameterIndex,
    Object x) throws SQLException 
 public  void setObject(int parameterIndex,
    Object x,
    int targetSqlType) throws SQLException 
 public  void setObject(int parameterIndex,
    Object x,
    int targetSqlType,
    int scale) throws SQLException 
 public  void setRef(int i,
    Ref x) throws SQLException 
 public  void setShort(int parameterIndex,
    short x) throws SQLException 
 public  void setString(int parameterIndex,
    String x) throws SQLException 
 public  void setTime(int parameterIndex,
    Time x) throws SQLException 
 public  void setTime(int parameterIndex,
    Time x,
    Calendar cal) throws SQLException 
 public  void setTimestamp(int parameterIndex,
    Timestamp x) throws SQLException 
 public  void setTimestamp(int parameterIndex,
    Timestamp x,
    Calendar cal) throws SQLException 
 public  void setURL(int parameterIndex,
    URL x) throws SQLException 
 public  void setUnicodeStream(int parameterIndex,
    InputStream x,
    int length) throws SQLException 
Deprecated!
 public String toString() 
    Returns a String representation of this object.