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 aPooledConnectionobject. 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
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description ConnectionEvent(PooledConnection theConnection)Creates a connection event initialized with the suppliedPooledConnectionreporting that the application has closed the connection.ConnectionEvent(PooledConnection theConnection, SQLException theException)Creates aConnectionEventinitialized with the suppliedPooledConnectionand with the suppliedSQLExceptionindicating that an error has occurred within thePooledConnection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SQLExceptiongetSQLException()Gets theSQLExceptionwhich holds information about the error which occurred in thePooledConnection.-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Constructor Detail
-
ConnectionEvent
public ConnectionEvent(PooledConnection theConnection)
Creates a connection event initialized with the suppliedPooledConnectionreporting 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 aConnectionEventinitialized with the suppliedPooledConnectionand with the suppliedSQLExceptionindicating that an error has occurred within thePooledConnection.- 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 Detail
-
getSQLException
public SQLException getSQLException()
Gets theSQLExceptionwhich holds information about the error which occurred in thePooledConnection.- Returns:
- a
SQLExceptioncontaining information about the error. May benullif no error has occurred.
-
-