public class ConnectionEvent extends EventObject
一个Event对象,提供有关连接相关事件源的信息。 ConnectionEvent对象在应用程序关闭池化连接和发生错误时生成。 ConnectionEvent对象包含两种信息:
SQLException即将被抛出到应用程序中 source| Constructor and Description |
|---|
ConnectionEvent(PooledConnection con)
构造一个
ConnectionEvent给定初始化的对象
PooledConnection对象。
|
ConnectionEvent(PooledConnection con, SQLException ex)
构造一个
ConnectionEvent给定初始化的对象
PooledConnection对象和
SQLException对象。
|
| Modifier and Type | Method and Description |
|---|---|
SQLException |
getSQLException()
检索
SQLException这个
ConnectionEvent对象。
|
getSource, toStringpublic ConnectionEvent(PooledConnection con)
构造一个ConnectionEvent给定初始化的对象PooledConnection对象。 SQLException默认为null 。
con - 作为事件源的池化连接
IllegalArgumentException - 如果
con为空。
public ConnectionEvent(PooledConnection con, SQLException ex)
构造一个ConnectionEvent对象,该对象使用给定的PooledConnection对象和SQLException对象初始化。
con - 作为事件源的池化连接
ex - 将要抛出的SQLException应用程序
IllegalArgumentException - 如果
con为空。
public SQLException getSQLException()
获取SQLException对于这个ConnectionEvent对象。 可能是null 。
null或
null
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.