举报投诉联系我们 手机版 热门标签 名动网
您的位置:名动网 > 鸿蒙系统 鸿蒙OS ConnectionEventListener

鸿蒙系统 鸿蒙OS ConnectionEventListener

2023-04-14 09:20 鸿蒙OS开发文档

鸿蒙系统 鸿蒙OS ConnectionEventListener

鸿蒙系统 鸿蒙OS ConnectionEventListener

鸿蒙系统

ConnectionEventListener

public interface ConnectionEventListener
extends EventListener

注册以接收由 PooledConnection 对象生成的事件的通知的对象。

ConnectionEventListener 接口由连接池组件实现。 连接池组件通常由 JDBC 驱动程序供应商或其他系统软件供应商提供。 当应用程序使用侦听器注册的池连接完成时,JDBC 驱动程序会通知 ConnectionEventListener 对象。 在应用程序在其 PooledConnection 对象的表示上调用 close 方法后,将发生通知。 当由于 PooledConnection 不适合将来使用而发生连接错误时,也会通知 ConnectionEventListener ——例如,服务器已崩溃。 在驱动程序使用 PooledConnection 对象向应用程序抛出 SQLException 之前,JDBC 驱动程序会通知侦听器。

Since:

1.4

方法总结

修饰符和类型 方法 描述
void connectionClosed(ConnectionEvent event) 通知此 ConnectionEventListener 应用程序已在其表示的池连接上调用 close 方法。
void connectionErrorOccurred(ConnectionEvent event) 通知此 ConnectionEventListener 发生了致命错误并且无法再使用池连接。

方法详情

connectionClosed

void connectionClosed(ConnectionEvent event)

通知此 ConnectionEventListener 应用程序已在其表示的池连接上调用 close 方法。

参数:

参数名称 参数描述
event 描述事件源的事件对象

connectionErrorOccurred

void connectionErrorOccurred(ConnectionEvent event)

通知此 ConnectionEventListener 发生了致命错误并且无法再使用池连接。 驱动程序在向应用程序抛出给定 ConnectionEvent 对象中包含的 SQLException 之前发出此通知。

参数:

参数名称 参数描述
event 描述事件源并包含驱动程序即将抛出的 SQLException 的事件对象
阅读全文
以上是名动网为你收集整理的鸿蒙系统 鸿蒙OS ConnectionEventListener全部内容。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。
相关文章
© 2024 名动网 mdwl.vip 版权所有 联系我们