public interface ConnectionEventListener
implements EventListener
| javax.sql.ConnectionEventListener |
一个对象,用于注册以通知由 PooledConnection对象生成的事件。
ConnectionEventListener接口由连接池组件实现。 连接池组件通常由JDBC驱动程序供应商或其他系统软件供应商提供。 当应用程序使用监听器注册的池式连接完成时,JDBC驱动程序通知ConnectionEventListener对象。 通知发生在应用程序调用方法PooledConnection对象close的表示形式之后。 例如, ConnectionEventListener也会在发生连接错误时通知,因为PooledConnection不适合将来使用 - 服务器崩溃。 在驱动程序使用PooledConnection对象向应用程序抛出SQLException之前,JDBC驱动程序会通知侦听器。
公共方法(Public methods) |
|
|---|---|
abstract void |
connectionClosed(ConnectionEvent event) 通知此 |
abstract void |
connectionErrorOccurred(ConnectionEvent event) 通知此 |
void connectionClosed (ConnectionEvent event)
通知此 ConnectionEventListener该应用程序已调用方法 close对其池连接的表示。
| 参数(Parameters) | |
|---|---|
event |
ConnectionEvent: an event object describing the source of the event |
void connectionErrorOccurred (ConnectionEvent event)
通知此ConnectionEventListener发生了致命错误,并且不能再使用池连接。 驱动程序在将应用程序抛出给定的ConnectionEvent对象中的SQLException之前发出此通知。
| 参数(Parameters) | |
|---|---|
event |
ConnectionEvent: an event object describing the source of the event and containing the SQLException that the driver is about to throw |