Stay organized with collections
Save and categorize content based on your preferences.
ConnectionEvent
open class ConnectionEvent : EventObject
An Event
object that provides information about the source of a connection-related event. ConnectionEvent
objects are generated when an application closes a pooled connection and when an error occurs. The ConnectionEvent
object contains two kinds of information:
- The pooled connection closed by the application
- In the case of an error event, the
SQLException
about to be thrown to the application
Summary
Public constructors |
Constructs a ConnectionEvent object initialized with the given PooledConnection object.
|
Constructs a ConnectionEvent object initialized with the given PooledConnection object and SQLException object.
|
Public methods |
open SQLException! |
Retrieves the SQLException for this ConnectionEvent object.
|
Public constructors
ConnectionEvent
ConnectionEvent(con: PooledConnection!)
Constructs a ConnectionEvent
object initialized with the given PooledConnection
object. SQLException
defaults to null
.
Parameters |
con |
PooledConnection!: the pooled connection that is the source of the event |
Exceptions |
java.lang.IllegalArgumentException |
if con is null. |
ConnectionEvent
ConnectionEvent(
con: PooledConnection!,
ex: SQLException!)
Constructs a ConnectionEvent
object initialized with the given PooledConnection
object and SQLException
object.
Parameters |
con |
PooledConnection!: the pooled connection that is the source of the event |
ex |
SQLException!: the SQLException about to be thrown to the application |
Exceptions |
java.lang.IllegalArgumentException |
if con is null. |
Public methods
getSQLException
open fun getSQLException(): SQLException!
Retrieves the SQLException
for this ConnectionEvent
object. May be null
.
Return |
SQLException! |
the SQLException about to be thrown or null |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ConnectionEvent\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nConnectionEvent\n===============\n\n```\nopen class ConnectionEvent : EventObject\n```\n\n|---|---|--------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [java.util.EventObject](../../java/util/EventObject.html#) ||\n| | ↳ | [javax.sql.ConnectionEvent](#) |\n\nAn `Event` object that provides information about the source of a connection-related event. `ConnectionEvent` objects are generated when an application closes a pooled connection and when an error occurs. The `ConnectionEvent` object contains two kinds of information:\n\n- The pooled connection closed by the application\n- In the case of an error event, the `SQLException` about to be thrown to the application\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [ConnectionEvent](#ConnectionEvent(javax.sql.PooledConnection))`(`con:` `[PooledConnection](/reference/kotlin/javax/sql/PooledConnection)!`)` Constructs a `ConnectionEvent` object initialized with the given `PooledConnection` object. |\n| [ConnectionEvent](#ConnectionEvent(javax.sql.PooledConnection,%20java.sql.SQLException))`(`con:` `[PooledConnection](/reference/kotlin/javax/sql/PooledConnection)!`, `ex:` `[SQLException](../../java/sql/SQLException.html#)!`)` Constructs a `ConnectionEvent` object initialized with the given `PooledConnection` object and `SQLException` object. |\n\n| Public methods ||\n|---------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|\n| open [SQLException](../../java/sql/SQLException.html#)! | [getSQLException](#getSQLException())`()` Retrieves the `SQLException` for this `ConnectionEvent` object. |\n\n| Inherited functions ||\n|---|---|\n| From class [EventObject](../../java/util/EventObject.html#) |----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------| | [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | [getSource](../../java/util/EventObject.html#getSource())`()` The object on which the Event initially occurred. \u003cbr /\u003e | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](../../java/util/EventObject.html#toString())`()` Returns a String representation of this EventObject. \u003cbr /\u003e | ||\n\n| Inherited properties ||\n|---|---|\n| From class [EventObject](../../java/util/EventObject.html#) |-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------| | [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | [source](../../java/util/EventObject.html#source:kotlin.Any) The object on which the Event initially occurred. \u003cbr /\u003e | ||\n\nPublic constructors\n-------------------\n\n### ConnectionEvent\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nConnectionEvent(con: PooledConnection!)\n```\n\nConstructs a `ConnectionEvent` object initialized with the given `PooledConnection` object. `SQLException` defaults to `null`.\n\n| Parameters ||\n|-------|--------------------------------------------------------------------------------------------------------------------------|\n| `con` | [PooledConnection](/reference/kotlin/javax/sql/PooledConnection)!: the pooled connection that is the source of the event |\n\n| Exceptions ||\n|--------------------------------------|-------------------|\n| `java.lang.IllegalArgumentException` | if `con` is null. |\n\n### ConnectionEvent\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nConnectionEvent(\n con: PooledConnection!, \n ex: SQLException!)\n```\n\nConstructs a `ConnectionEvent` object initialized with the given `PooledConnection` object and `SQLException` object.\n\n| Parameters ||\n|-------|--------------------------------------------------------------------------------------------------------------------------|\n| `con` | [PooledConnection](/reference/kotlin/javax/sql/PooledConnection)!: the pooled connection that is the source of the event |\n| `ex` | [SQLException](../../java/sql/SQLException.html#)!: the SQLException about to be thrown to the application |\n\n| Exceptions ||\n|--------------------------------------|-------------------|\n| `java.lang.IllegalArgumentException` | if `con` is null. |\n\nPublic methods\n--------------\n\n### getSQLException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getSQLException(): SQLException!\n```\n\nRetrieves the `SQLException` for this `ConnectionEvent` object. May be `null`.\n\n| Return ||\n|----------------------------------------------------|-----------------------------------------------|\n| [SQLException](../../java/sql/SQLException.html#)! | the SQLException about to be thrown or `null` |"]]