javax.sql
类 StatementEvent
java.lang.Object
java.util.EventObject
javax.sql.StatementEvent
- 所有已实现的接口:
- Serializable
public class StatementEvent
- extends EventObject
StatementEvent
被传送给所有用 PooledConnection
注册的 StatementEventListener
。当驱动程序确定与 PooledConnection
关联的 PreparedStatement
已经关闭或驱动程序确定它无效时,发生此事件。
- 从以下版本开始:
- 1.6
- 另请参见:
- 序列化表格
StatementEvent
public StatementEvent(PooledConnection con,
PreparedStatement statement)
- 用指定的
PooledConnection
和 PreparedStatement
构造 StatementEvent
。包含在事件中的 SQLException
默认为 null。 - 参数:
con
- 与已关闭或无效的 PreparedStatement
关联的 PooledConnection
。 statement
- 正在关闭的或无效的 PreparedStatement
- 抛出:
IllegalArgumentException
- 如果 con
为 null。 - 从以下版本开始:
- 1.6
StatementEvent
public StatementEvent(PooledConnection con,
PreparedStatement statement,
SQLException exception)
- 用指定的
PooledConnection
、PreparedStatement
和 SQLException
构造 StatementEvent
。 - 参数:
con
- 与已关闭或无效的 PreparedStatement
关联的 PooledConnection
。 statement
- 正在关闭的或无效的 PreparedStatement
exception
- 驱动程序将要抛出给应用程序的 SQLException
- 抛出:
IllegalArgumentException
- 如果 con
为 null。 - 从以下版本开始:
- 1.6
getStatement
public PreparedStatement getStatement()
- 返回正在关闭或无效的
PreparedStatement
。 - 返回:
- 正在关闭的或无效的
PreparedStatement
- 从以下版本开始:
- 1.6
getSQLException
public SQLException getSQLException()
- 返回驱动程序将要抛出的
SQLException
。 - 返回:
- 驱动程序将要抛出的
SQLException
- 从以下版本开始:
- 1.6