Class PoolableCallableStatement

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.sql.CallableStatement, java.sql.PreparedStatement, java.sql.Statement, java.sql.Wrapper, org.apache.commons.pool2.TrackedUse

    public class PoolableCallableStatement
    extends DelegatingCallableStatement
    A DelegatingCallableStatement that cooperates with PoolingConnection to implement a pool of CallableStatements.

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

    Since:
    2.0
    Version:
    $Id: PoolableCallableStatement.java 1658644 2015-02-10 08:59:07Z tn $
    See Also:
    PoolingConnection
    • Constructor Detail

      • PoolableCallableStatement

        public PoolableCallableStatement​(java.sql.CallableStatement stmt,
                                         PStmtKey key,
                                         org.apache.commons.pool2.KeyedObjectPool<PStmtKey,​DelegatingPreparedStatement> pool,
                                         DelegatingConnection<java.sql.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 DelegatingConnection that created this CallableStatement
    • Method Detail

      • close

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