鸿蒙OS StatementEvent

StatementEvent

java.lang.Object

|—java.util.EventObject

|—|—javax.sql.StatementEvent

public class StatementEvent
extends EventObject

StatementEvent 被发送到所有向 PooledConnection 注册的 StatementEventListener。 当驱动程序确定与 PooledConnection 关联的 PreparedStatement 已关闭或驱动程序确定无效时,会发生这种情况。

Since:

1.6

字段摘要

从类 java.util.EventObject 继承的字段
source

构造函数摘要

构造函数描述
StatementEvent(PooledConnection con, PreparedStatement statement)使用指定的 PooledConnection 和 PreparedStatement 构造一个 StatementEvent。
StatementEvent(PooledConnection con, PreparedStatement statement, SQLException exception)使用指定的 PooledConnection、PreparedStatement 和 SQLException 构造一个 StatementEvent

方法总结

修饰符和类型方法描述
SQLExceptiongetSQLException()返回驱动程序即将抛出的 SQLException
PreparedStatementgetStatement()返回正在关闭或无效的 PreparedStatement
从类 java.util.EventObject 继承的方法
getSource, toString
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

构造函数详细信息

StatementEvent

public StatementEvent(PooledConnection con, PreparedStatement statement)

使用指定的 PooledConnection 和 PreparedStatement 构造一个 StatementEvent。 事件中包含的 SQLException 默认为 null。

参数:

参数名称参数描述
con与关闭或无效 PreparedStatement 关联的 PooledConnection。
statement正在关闭或无效的 PreparedStatement

Throws:

Throw名称Throw描述
IllegalArgumentException如果 con 为空。

Since:

1.6

StatementEvent

public StatementEvent(PooledConnection con, PreparedStatement statement, SQLException exception)

使用指定的 PooledConnection、PreparedStatement 和 SQLException 构造一个 StatementEvent

参数:

参数名称参数描述
con与关闭或无效 PreparedStatement 关联的 PooledConnection。
statement正在关闭或无效的 PreparedStatement
exception驱动程序即将向应用程序抛出的 SQLException

Throws:

Throw名称Throw描述
IllegalArgumentException如果 con 为空。

Since:

1.6

方法详情

getStatement

public PreparedStatement getStatement()

返回正在关闭或无效的 PreparedStatement

返回:

正在关闭或无效的 PreparedStatement

Since:

1.6

getSQLException

public SQLException getSQLException()

返回驱动程序即将抛出的 SQLException

返回:

驱动程序即将抛出的 SQLException

Since:

1.6

版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《鸿蒙OS StatementEvent》
文章链接:https://zhuji.vsping.com/314885.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。