阅读(2907) (0)

鸿蒙OS StatementEvent

2022-11-02 10:17:44 更新

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

方法总结

修饰符和类型 方法 描述
SQLException getSQLException() 返回驱动程序即将抛出的 SQLException
PreparedStatement getStatement() 返回正在关闭或无效的 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