Class PooledConnection

  • All Implemented Interfaces:
    javax.sql.PooledConnection
    Direct Known Subclasses:
    JtdsXAConnection

    public class PooledConnection
    extends java.lang.Object
    implements javax.sql.PooledConnection
    jTDS implementation of the PooledConnection interface.
    Version:
    $Id: PooledConnection.java,v 1.11.6.3 2009-12-30 08:45:34 ickzon Exp $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.sql.Connection connection  
      private java.util.ArrayList listeners  
    • Constructor Summary

      Constructors 
      Constructor Description
      PooledConnection​(java.sql.Connection connection)  
    • Field Detail

      • listeners

        private java.util.ArrayList listeners
      • connection

        protected java.sql.Connection connection
    • Constructor Detail

      • PooledConnection

        public PooledConnection​(java.sql.Connection connection)
    • Method Detail

      • close

        public void close()
                   throws java.sql.SQLException
        Closes the database connection.
        Specified by:
        close in interface javax.sql.PooledConnection
        Throws:
        java.sql.SQLException - if an error occurs
      • fireConnectionEvent

        public void fireConnectionEvent​(boolean closed,
                                        java.sql.SQLException sqlException)
        Fires a new connection event on all listeners.
        Parameters:
        closed - true if close has been called on the connection; false if the sqlException represents an error where the connection may not longer be used.
        sqlException - the SQLException to pass to the listeners
      • getConnection

        public java.sql.Connection getConnection()
                                          throws java.sql.SQLException
        Returns a ConnectionProxy.
        Specified by:
        getConnection in interface javax.sql.PooledConnection
        Throws:
        java.sql.SQLException - if an error occurs
      • addStatementEventListener

        public void addStatementEventListener​(javax.sql.StatementEventListener listener)
        Specified by:
        addStatementEventListener in interface javax.sql.PooledConnection
      • removeStatementEventListener

        public void removeStatementEventListener​(javax.sql.StatementEventListener listener)
        Specified by:
        removeStatementEventListener in interface javax.sql.PooledConnection