Class FBPooledConnection

java.lang.Object
org.firebirdsql.ds.FBPooledConnection
All Implemented Interfaces:
PooledConnection
Direct Known Subclasses:
FBXAConnection

public class FBPooledConnection extends Object implements PooledConnection
PooledConnection implementation for FBConnectionPoolDataSource
Since:
2.2
Author:
Mark Rotteveel
  • Constructor Details

    • FBPooledConnection

      protected FBPooledConnection(Connection connection)
  • Method Details

    • getConnection

      public Connection getConnection() throws SQLException
      Specified by:
      getConnection in interface PooledConnection
      Throws:
      SQLException
    • resetConnection

      protected void resetConnection(Connection connection) throws SQLException
      Throws:
      SQLException
    • createConnectionHandler

      protected org.firebirdsql.ds.PooledConnectionHandler createConnectionHandler(Connection connection)
      Creates the PooledConnectionHandler for the connection.

      Subclasses may override this method to return their own subclass of PooledConnectionHandler.

      Parameters:
      connection - Connection
      Returns:
      PooledConnectionHandler
    • close

      public void close() throws SQLException
      Specified by:
      close in interface PooledConnection
      Throws:
      SQLException
    • fireFatalConnectionError

      protected void fireFatalConnectionError(SQLException ex)
      Helper method to fire the connectionErrorOccurred event. To be used with fatal (connection) errors only.
      Parameters:
      ex - The exception
    • fireConnectionError

      protected void fireConnectionError(SQLException ex)
      Helper method to fire the connectionErrorOccurred event.

      This method will decide which errors warrant a connectionErrorOccurred event to be reported or not.

      Parameters:
      ex - The exception
    • fireConnectionClosed

      protected void fireConnectionClosed()
      Helper method to fire the connectionClosed event.
    • releaseConnectionHandler

      protected void releaseConnectionHandler(org.firebirdsql.ds.PooledConnectionHandler pch)
      Releases the current handler if it is equal to the handler passed in pch.

      To be called by the PooledConnectionHandler when it has been closed.

      Parameters:
      pch - PooledConnectionHandler to release.
    • addConnectionEventListener

      public void addConnectionEventListener(ConnectionEventListener listener)
      Specified by:
      addConnectionEventListener in interface PooledConnection
    • removeConnectionEventListener

      public void removeConnectionEventListener(ConnectionEventListener listener)
      Specified by:
      removeConnectionEventListener in interface PooledConnection
    • addStatementEventListener

      public void addStatementEventListener(StatementEventListener listener)
      Specified by:
      addStatementEventListener in interface PooledConnection
    • removeStatementEventListener

      public void removeStatementEventListener(StatementEventListener listener)
      Specified by:
      removeStatementEventListener in interface PooledConnection