-
- All Superinterfaces:
- EventListener
public interface ConnectionEventListener extends EventListener
An object that registers to be notified of events generated by a
PooledConnection
object.The
ConnectionEventListener
interface is implemented by a connection pooling component. A connection pooling component will usually be provided by a JDBC driver vendor or another system software vendor. A JDBC driver notifies aConnectionEventListener
object when an application is finished using a pooled connection with which the listener has registered. The notification occurs after the application calls the methodclose
on its representation of aPooledConnection
object. AConnectionEventListener
is also notified when a connection error occurs due to the fact that thePooledConnection
is unfit for future use---the server has crashed, for example. The listener is notified by the JDBC driver just before the driver throws anSQLException
to the application using thePooledConnection
object.- Since:
- 1.4
-
-
Method Summary
Methods Modifier and Type Method and Description void
connectionClosed(ConnectionEvent event)
Notifies thisConnectionEventListener
that the application has called the methodclose
on its representation of a pooled connection.void
connectionErrorOccurred(ConnectionEvent event)
Notifies thisConnectionEventListener
that a fatal error has occurred and the pooled connection can no longer be used.
-
-
-
Method Detail
-
connectionClosed
void connectionClosed(ConnectionEvent event)
Notifies thisConnectionEventListener
that the application has called the methodclose
on its representation of a pooled connection.- Parameters:
event
- an event object describing the source of the event
-
connectionErrorOccurred
void connectionErrorOccurred(ConnectionEvent event)
Notifies thisConnectionEventListener
that a fatal error has occurred and the pooled connection can no longer be used. The driver makes this notification just before it throws the application theSQLException
contained in the givenConnectionEvent
object.- Parameters:
event
- an event object describing the source of the event and containing theSQLException
that the driver is about to throw
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/sql/ConnectionEventListener.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.