鴻蒙OS StatementEvent

2022-11-03 10:46 更新

StatementEvent

java.lang.Object

|---java.util.EventObject

|---|---javax.sql.StatementEvent

public class StatementEvent
extends EventObject

StatementEvent 被發(fā)送到所有向 PooledConnection 注冊的 StatementEventListener。 當(dāng)驅(qū)動(dòng)程序確定與 PooledConnection 關(guān)聯(lián)的 PreparedStatement 已關(guān)閉或驅(qū)動(dòng)程序確定無效時(shí),會(huì)發(fā)生這種情況。

Since:

1.6

字段摘要

從類 java.util.EventObject 繼承的字段
source

構(gòu)造函數(shù)摘要

構(gòu)造函數(shù) 描述
StatementEvent(PooledConnection con, PreparedStatement statement) 使用指定的 PooledConnection 和 PreparedStatement 構(gòu)造一個(gè) StatementEvent。
StatementEvent(PooledConnection con, PreparedStatement statement, SQLException exception) 使用指定的 PooledConnection、PreparedStatement 和 SQLException 構(gòu)造一個(gè) StatementEvent

方法總結(jié)

修飾符和類型 方法 描述
SQLException getSQLException() 返回驅(qū)動(dòng)程序即將拋出的 SQLException
PreparedStatement getStatement() 返回正在關(guān)閉或無效的 PreparedStatement
從類 java.util.EventObject 繼承的方法
getSource, toString
從類 java.lang.Object 繼承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

構(gòu)造函數(shù)詳細(xì)信息

StatementEvent

public StatementEvent(PooledConnection con, PreparedStatement statement)

使用指定的 PooledConnection 和 PreparedStatement 構(gòu)造一個(gè) StatementEvent。 事件中包含的 SQLException 默認(rèn)為 null。

參數(shù):

參數(shù)名稱 參數(shù)描述
con 與關(guān)閉或無效 PreparedStatement 關(guān)聯(lián)的 PooledConnection。
statement 正在關(guān)閉或無效的 PreparedStatement

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果 con 為空。

Since:

1.6

StatementEvent

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

使用指定的 PooledConnection、PreparedStatement 和 SQLException 構(gòu)造一個(gè) StatementEvent

參數(shù):

參數(shù)名稱 參數(shù)描述
con 與關(guān)閉或無效 PreparedStatement 關(guān)聯(lián)的 PooledConnection。
statement 正在關(guān)閉或無效的 PreparedStatement
exception 驅(qū)動(dòng)程序即將向應(yīng)用程序拋出的 SQLException

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果 con 為空。

Since:

1.6

方法詳情

getStatement

public PreparedStatement getStatement()

返回正在關(guān)閉或無效的 PreparedStatement

返回:

正在關(guān)閉或無效的 PreparedStatement

Since:

1.6

getSQLException

public SQLException getSQLException()

返回驅(qū)動(dòng)程序即將拋出的 SQLException

返回:

驅(qū)動(dòng)程序即將拋出的 SQLException

Since:

1.6

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)