public interface ConnectionEventListener extends EventListener
注册通知一个由一个PooledConnection对象生成的事件的对象。
ConnectionEventListener接口由连接池组件实现。 连接池组件通常由JDBC驱动程序供应商或其他系统软件供应商提供。 当应用程序完成使用侦听器注册的池连接时,JDBC驱动程序通知ConnectionEventListener对象。 该通知发生在应用程序在PooledConnection对象的close上调用方法close之后。 由于PooledConnection不适合将来使用 - 例如服务器已经崩溃,因此当发生连接错误时,还会通知A ConnectionEventListener 。 在驱动程序使用PooledConnection对象向应用程序SQLException之前,JDBC驱动程序通知监听器。
| Modifier and Type | Method and Description |
|---|---|
void |
connectionClosed(ConnectionEvent event)
通知此
ConnectionEventListener应用程序已调用的方法
close在其一个池连接的表示。
|
void |
connectionErrorOccurred(ConnectionEvent event)
通知此
ConnectionEventListener发生了致命错误,并且无法再使用池连接。
|
void connectionClosed(ConnectionEvent event)
ConnectionEventListener该应用程序已经调用了方法
close其汇集连接的表示。
event - 描述事件源的事件对象
void connectionErrorOccurred(ConnectionEvent event)
ConnectionEventListener发生了致命错误,并且无法再使用合并的连接。
该驱动程序使这个通知它抛出的应用程序之前SQLException包含在给定ConnectionEvent对象。
event - 描述事件源的事件对象,其中包含驱动程序即将抛出的
SQLException
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.