Class PoolablePreparedStatement

    • Field Detail

      • _pool

        protected org.apache.commons.pool.KeyedObjectPool _pool
        The KeyedObjectPool from which I was obtained.
      • _key

        protected java.lang.Object _key
        My "key" as used by KeyedObjectPool.
      • batchAdded

        private volatile boolean batchAdded
    • Constructor Detail

      • PoolablePreparedStatement

        public PoolablePreparedStatement​(java.sql.PreparedStatement stmt,
                                         java.lang.Object key,
                                         org.apache.commons.pool.KeyedObjectPool pool,
                                         java.sql.Connection conn)
        Constructor
        Parameters:
        stmt - my underlying PreparedStatement
        key - my key" as used by KeyedObjectPool
        pool - the KeyedObjectPool from which I was obtained.
        conn - the Connection from which I was created
    • Method Detail

      • addBatch

        public void addBatch()
                      throws java.sql.SQLException
        Add batch.
        Specified by:
        addBatch in interface java.sql.PreparedStatement
        Overrides:
        addBatch in class DelegatingPreparedStatement
        Throws:
        java.sql.SQLException
      • clearBatch

        public void clearBatch()
                        throws java.sql.SQLException
        Clear Batch.
        Specified by:
        clearBatch in interface java.sql.Statement
        Overrides:
        clearBatch in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • close

        public void close()
                   throws java.sql.SQLException
        Return me to my pool.
        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
      • activate

        protected void activate()
                         throws java.sql.SQLException
        Overrides:
        activate in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • passivate

        protected void passivate()
                          throws java.sql.SQLException
        Overrides:
        passivate in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • isCloseOnCompletion

        public boolean isCloseOnCompletion()
                                    throws java.sql.SQLException
        Specified by:
        isCloseOnCompletion in interface java.sql.Statement
        Overrides:
        isCloseOnCompletion in class DelegatingPreparedStatement
        Throws:
        java.sql.SQLException
      • closeOnCompletion

        public void closeOnCompletion()
                               throws java.sql.SQLException
        Specified by:
        closeOnCompletion in interface java.sql.Statement
        Overrides:
        closeOnCompletion in class DelegatingPreparedStatement
        Throws:
        java.sql.SQLException