Package javax.sql

Class ConnectionEvent

java.lang.Object
java.util.EventObject
javax.sql.ConnectionEvent
All Implemented Interfaces:
Serializable

public class ConnectionEvent
extends EventObject
implements Serializable
Sent when specific events happen on a PooledConnection object. These events are a facility to report when an application closes the pooled connection or when an error occurs in the pooled connection.
See Also:
Serialized Form
  • Constructor Details

    • ConnectionEvent

      public ConnectionEvent​(PooledConnection theConnection)
      Creates a connection event initialized with the supplied PooledConnection reporting that the application has closed the connection.
      Parameters:
      theConnection - the connection for which this event is created.
    • ConnectionEvent

      public ConnectionEvent​(PooledConnection theConnection, SQLException theException)
      Creates a ConnectionEvent initialized with the supplied PooledConnection and with the supplied SQLException indicating that an error has occurred within the PooledConnection.
      Parameters:
      theConnection - the connection for which this event is created.
      theException - information about the state of error that has occurred on the application side.
  • Method Details

    • getSQLException

      public SQLException getSQLException()
      Gets the SQLException which holds information about the error which occurred in the PooledConnection.
      Returns:
      a SQLException containing information about the error. May be null if no error has occurred.