APIdia Launch Partner
Top Description Fields Constructors Methods
javax.sql

public Class ConnectionEvent

extends EventObject
Class Inheritance
Imports
java.sql.SQLException

An Event object that provides information about the source of a connection-related event. ConnectionEvent objects are generated when an application closes a pooled connection and when an error occurs. The ConnectionEvent object contains two kinds of information:

Since
1.4

Field Summary

Modifier and TypeField and Description
private SQLException
ex

The SQLException that the driver will throw to the application when an error occurs and the pooled connection is no longer usable.

pack-priv static final long
serialVersionUID

Hides java.util.EventObject.serialVersionUID.

Private serial version unique ID to ensure serialization compatibility.
Inherited from java.util.EventObject:
source

Constructor Summary

AccessConstructor and Description
public
ConnectionEvent(PooledConnection
the pooled connection that is the source of the event
con
)

Constructs a ConnectionEvent object initialized with the given PooledConnection object.

public
ConnectionEvent(PooledConnection
the pooled connection that is the source of the event
con
,
SQLException
the SQLException about to be thrown to the application
ex
)

Constructs a ConnectionEvent object initialized with the given PooledConnection object and SQLException object.

Method Summary

Modifier and TypeMethod and Description
public SQLException

Returns:

the SQLException about to be thrown or null
getSQLException
()

Retrieves the SQLException for this ConnectionEvent object.

Inherited from java.util.EventObject:
getSourcetoString

Field Detail

exback to summary
private SQLException ex

The SQLException that the driver will throw to the application when an error occurs and the pooled connection is no longer usable.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides java.util.EventObject.serialVersionUID.

Private serial version unique ID to ensure serialization compatibility.

Constructor Detail

ConnectionEventback to summary
public ConnectionEvent(PooledConnection con)

Constructs a ConnectionEvent object initialized with the given PooledConnection object. SQLException defaults to null.

Parameters
con:PooledConnection

the pooled connection that is the source of the event

Exceptions
IllegalArgumentException:
if con is null.
ConnectionEventback to summary
public ConnectionEvent(PooledConnection con, SQLException ex)

Constructs a ConnectionEvent object initialized with the given PooledConnection object and SQLException object.

Parameters
con:PooledConnection

the pooled connection that is the source of the event

ex:SQLException

the SQLException about to be thrown to the application

Exceptions
IllegalArgumentException:
if con is null.

Method Detail

getSQLExceptionback to summary
public SQLException getSQLException()

Retrieves the SQLException for this ConnectionEvent object. May be null.

Returns:SQLException

the SQLException about to be thrown or null