Class PoolableCallableStatement

    • Constructor Detail

      • PoolableCallableStatement

        public PoolableCallableStatement​(java.sql.CallableStatement callableStatement,
                                         PStmtKey key,
                                         org.apache.commons.pool2.KeyedObjectPool<PStmtKey,​DelegatingPreparedStatement> pool,
                                         DelegatingConnection<java.sql.Connection> connection)
        Constructs a new instance.
        Parameters:
        callableStatement - the underlying CallableStatement
        key - the key for this statement in the KeyedObjectPool
        pool - the KeyedObjectPool from which this CallableStatement was obtained
        connection - the DelegatingConnection that created this CallableStatement
    • Method Detail

      • activate

        public void activate()
                      throws java.sql.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:
        java.sql.SQLException - thrown by the delegating statement.
        Since:
        2.4.0 made public, was protected in 2.3.0.
      • 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 - Ignored here, for subclasses.
      • passivate

        public void passivate()
                       throws java.sql.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:
        java.sql.SQLException - thrown by the delegating statement.
        Since:
        2.4.0 made public, was protected in 2.3.0.