Most visited

Recently visited

Added in API level 1

ConnectionEvent

public class ConnectionEvent
extends EventObject

java.lang.Object
   ↳ java.util.EventObject
     ↳ javax.sql.ConnectionEvent


提供有关连接相关事件源的信息的Event对象。 ConnectionEvent对象在应用程序关闭池连接并发生错误时生成。 ConnectionEvent对象包含两种信息:

Summary

Inherited fields

From class java.util.EventObject

Public constructors

ConnectionEvent(PooledConnection con)

构造一个用给定的 ConnectionEvent对象初始化的 PooledConnection对象。

ConnectionEvent(PooledConnection con, SQLException ex)

构造一个 ConnectionEvent给定初始化的对象 PooledConnection对象和 SQLException对象。

Public methods

SQLException getSQLException()

检索 SQLExceptionConnectionEvent对象。

Inherited methods

From class java.util.EventObject
From class java.lang.Object

Public constructors

ConnectionEvent

Added in API level 1
ConnectionEvent (PooledConnection con)

构造一个使用给定的ConnectionEvent对象初始化的PooledConnection对象。 SQLException默认为null

Parameters
con PooledConnection: the pooled connection that is the source of the event
Throws
IllegalArgumentException if con is null.

ConnectionEvent

Added in API level 1
ConnectionEvent (PooledConnection con, 
                SQLException ex)

构造一个 ConnectionEvent给定初始化的对象 PooledConnection对象和 SQLException对象。

Parameters
con PooledConnection: the pooled connection that is the source of the event
ex SQLException: the SQLException about to be thrown to the application
Throws
IllegalArgumentException if con is null.

Public methods

getSQLException

Added in API level 1
SQLException getSQLException ()

检索SQLExceptionConnectionEvent对象。 可能是null

Returns
SQLException the SQLException about to be thrown or null

Hooray!