后浪云鸿蒙OS教程:鸿蒙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

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/177146.html<

(0)
运维的头像运维
上一篇2025-03-25 12:14
下一篇 2025-03-25 12:15

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注