PoolableCallableStatement (Apache Tomcat 7.0.104 API Documentation)

org.apache.tomcat.dbcp.dbcp

## Class PoolableCallableStatement

- java.lang.Object
- - org.apache.tomcat.dbcp.dbcp.AbandonedTrace
  - - org.apache.tomcat.dbcp.dbcp.DelegatingStatement
    - - org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement
      - - org.apache.tomcat.dbcp.dbcp.DelegatingCallableStatement
        - - org.apache.tomcat.dbcp.dbcp.PoolableCallableStatement

- All Implemented Interfaces:
    AutoCloseable, CallableStatement, PreparedStatement, Statement, Wrapper

      public class PoolableCallableStatement
      extends DelegatingCallableStatement

  A `DelegatingCallableStatement` that cooperates with `PoolingConnection` to implement a pool of `CallableStatement`s.

  The `close()` method returns this statement to its containing pool. (See `PoolingConnection`.)

  Since:
    1.3
  See Also:
    `PoolingConnection`

- - ### Field Summary

    - ### Fields inherited from class org.apache.tomcat.dbcp.dbcp.DelegatingStatement

      `_closed, _conn, _stmt`

    - ### 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 and Description
    `PoolableCallableStatement(CallableStatement stmt, PStmtKey key, KeyedObjectPool<PStmtKey,DelegatingPreparedStatement> pool, Connection conn)` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activate()` Activates after retrieval from the pool.
    `void` | `close()` Returns the CallableStatement to the pool.
    `void` | `passivate()` Passivates to prepare for return to the pool.

    - ### Methods inherited from class org.apache.tomcat.dbcp.dbcp.DelegatingCallableStatement

      `equals, getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, 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, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, wasNull`

    - ### Methods inherited from class org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement

      `addBatch, 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, 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`

    - ### Methods inherited from class org.apache.tomcat.dbcp.dbcp.DelegatingStatement

      `addBatch, cancel, checkOpen, clearBatch, 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`

    - ### Methods inherited from class org.apache.tomcat.dbcp.dbcp.AbandonedTrace

      `addTrace, clearTrace, getConfig, getLastUsed, getTrace, printStackTrace, removeTrace, setLastUsed, setLastUsed, setStackTrace`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.sql.PreparedStatement

      `addBatch, 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`

    - ### Methods inherited from interface java.sql.Statement

      `addBatch, cancel, clearBatch, clearWarnings, closeOnCompletion, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout`

    - ### Methods inherited from interface java.sql.Wrapper

      `isWrapperFor, unwrap`

- - ### Constructor Detail

    - #### PoolableCallableStatement

          public PoolableCallableStatement(CallableStatement stmt,
                                   PStmtKey key,
                                   KeyedObjectPool<PStmtKey,DelegatingPreparedStatement> pool,
                                   Connection conn)

      Constructor.
      Parameters:
        `stmt` - the underlying `CallableStatement`
        `key` - the key for this statement in the `KeyedObjectPool`
        `pool` - the `KeyedObjectPool` from which this CallableStatement was obtained
        `conn` - the `Connection` that created this CallableStatement

  - ### Method Detail

    - #### close

          public void close()
                     throws SQLException

      Returns the CallableStatement to the pool. If {`DelegatingStatement.isClosed()`, this is a No-op.
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `Statement`
      Overrides:
        `close` in class `DelegatingStatement`
      Throws:
        `SQLException`

    - #### activate

          public void activate()
                        throws SQLException

      Activates after retrieval from the pool. Adds a trace for this CallableStatement to the Connection that created it.
      Overrides:
        `activate` in class `DelegatingStatement`
      Throws:
        `SQLException`

    - #### passivate

          public void passivate()
                         throws SQLException

      Passivates to prepare for return to the pool. Removes the trace associated with this CallableStatement from the Connection that created it. Also closes any associated ResultSets.
      Overrides:
        `passivate` in class `DelegatingStatement`
      Throws:
        `SQLException`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.