Name
ConnectionEventListener
Synopsis
Interface Name:
javax.sql.ConnectionEventListener
Superclass: java.util.EventListener
Immediate Subclasses: None
Interfaces Implemented: None
Availability: New as of JDK 1.2
Description
This interface is implemented by classes wishing to know about events happening to pooled connections. A JDBC driver vendor implements this interface to be notified when a given connection has closed or thrown an exception.
Class Summary
public interface ConnectionEventListener
extends java.util.EventListener {
void connectionClosed(ConnectionEvent evt);
void connectionErrorOccurred(ConnectionEvent evt);
}Object Methods
connectionClosed( )
public void connectionClosed(ConnectionEvent evt);
- Description
This method is called by a pooled connection when the
close( )method has been called.
connectionErrorOccurred( )
public void connectionErrorOccurred(ConnectionEvent evt);
- Description
This method is called by a pooled connection whenever a fatal error occurs during communications with a database. For example, if the server goes down, the connection needs to notify the pool to discard this connection from the pool and attempt a reconnect.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access