public class ConnectionEvent extends EventObject
接続関連のイベントのソースに関する情報を提供するEvent
オブジェクトです。 ConnectionEvent
オブジェクトは、アプリケーションがプールされた接続を閉じたときやエラーが発生したときに生成されます。 ConnectionEvent
オブジェクトには、次の2種類の情報が含まれます。
SQLException
source
コンストラクタ | 説明 |
---|---|
ConnectionEvent(PooledConnection con) |
指定された
PooledConnection オブジェクトで初期化されたConnectionEvent オブジェクトを構築します。 |
ConnectionEvent(PooledConnection con, SQLException ex) |
指定した
PooledConnection オブジェクトとSQLException オブジェクトによって初期化されたConnectionEvent オブジェクトを構築します。 |
修飾子と型 | メソッド | 説明 |
---|---|---|
SQLException |
getSQLException() |
この
ConnectionEvent オブジェクトのSQLException 値を取得します。 |
getSource, toString
public ConnectionEvent(PooledConnection con)
指定されたPooledConnection
オブジェクトで初期化されたConnectionEvent
オブジェクトを構築します。 SQLException
は、デフォルトでnull
です。
con
- イベントの生成元であるプールされた接続IllegalArgumentException
- con
がnullである場合。public ConnectionEvent(PooledConnection con, SQLException ex)
指定したPooledConnection
オブジェクトとSQLException
オブジェクトによって初期化されたConnectionEvent
オブジェクトを構築します。
con
- イベントの生成元であるプールされた接続ex
- アプリケーションにスローされるSQLExceptionオブジェクトIllegalArgumentException
- con
がnullである場合。public SQLException getSQLException()
このConnectionEvent
オブジェクトのSQLException
値を取得します。 null
も可。
null
バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。