Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Inherited Fields](https://developer.android.com/reference/javax/sql/StatementEvent#inhfields) \| [Ctors](https://developer.android.com/reference/javax/sql/StatementEvent#pubctors) \| [Methods](https://developer.android.com/reference/javax/sql/StatementEvent#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/javax/sql/StatementEvent#inhmethods)

# StatementEvent

` public class StatementEvent `   
` ` ` extends https://developer.android.com/reference/java/util/EventObject ` ` `

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [java.util.EventObject](https://developer.android.com/reference/java/util/EventObject) ||
|   | ↳ | javax.sql.StatementEvent |

<br />

*** ** * ** ***

A `StatementEvent` is sent to all `StatementEventListener`s which were registered with a `PooledConnection`. This occurs when the driver determines that a `PreparedStatement` that is associated with the `PooledConnection` has been closed or the driver determines is invalid.

<br />

## Summary

### Inherited fields

From class `https://developer.android.com/reference/java/util/EventObject` ` protected https://developer.android.com/reference/java/lang/Object` `https://developer.android.com/reference/java/util/EventObject#source`

The object on which the Event initially occurred.

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/javax/sql/StatementEvent#StatementEvent(javax.sql.PooledConnection,%20java.sql.PreparedStatement)(https://developer.android.com/reference/javax/sql/PooledConnection con, https://developer.android.com/reference/java/sql/PreparedStatement statement) ` Constructs a `StatementEvent` with the specified `PooledConnection` and `PreparedStatement`. |
| ` https://developer.android.com/reference/javax/sql/StatementEvent#StatementEvent(javax.sql.PooledConnection,%20java.sql.PreparedStatement,%20java.sql.SQLException)(https://developer.android.com/reference/javax/sql/PooledConnection con, https://developer.android.com/reference/java/sql/PreparedStatement statement, https://developer.android.com/reference/java/sql/SQLException exception) ` Constructs a `StatementEvent` with the specified `PooledConnection`, `PreparedStatement` and `SQLException` <br /> |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/sql/SQLException` | ` https://developer.android.com/reference/javax/sql/StatementEvent#getSQLException()() ` Returns the `SQLException` the driver is about to throw <br /> |
| ` https://developer.android.com/reference/java/sql/PreparedStatement` | ` https://developer.android.com/reference/javax/sql/StatementEvent#getStatement()() ` Returns the `PreparedStatement` that is being closed or is invalid <br /> |

### Inherited methods

From class ` https://developer.android.com/reference/java/util/EventObject ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/util/EventObject#getSource()() `

The object on which the Event initially occurred.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/util/EventObject#toString()() `

Returns a String representation of this EventObject.
From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### StatementEvent

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public StatementEvent (PooledConnection con, 
                PreparedStatement statement)
```

Constructs a `StatementEvent` with the specified `PooledConnection` and `PreparedStatement`. The `SQLException` contained in the event defaults to null.

<br />

<br />

| Parameters ||
|---|---|
| `con` | `PooledConnection`: The `PooledConnection` that the closed or invalid `PreparedStatement`is associated with. <br /> |
| `statement` | `PreparedStatement`: The `PreparedStatement` that is bieng closed or is invalid <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `con` is null. |

### StatementEvent

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Constructs a `StatementEvent` with the specified `PooledConnection`, `PreparedStatement` and `SQLException`

<br />

<br />

| Parameters ||
|---|---|
| `con` | `PooledConnection`: The `PooledConnection` that the closed or invalid `PreparedStatement` is associated with. <br /> |
| `statement` | `PreparedStatement`: The `PreparedStatement` that is being closed or is invalid <br /> |
| `exception` | `SQLException`: The `SQLException `the driver is about to throw to the application <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `con` is null. <br /> |

## Public methods

### getSQLException

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SQLException getSQLException ()
```

Returns the `SQLException` the driver is about to throw

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/sql/SQLException` | The `SQLException` the driver is about to throw <br /> |

### getStatement

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PreparedStatement getStatement ()
```

Returns the `PreparedStatement` that is being closed or is invalid

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/sql/PreparedStatement` | The `PreparedStatement` that is being closed or is invalid <br /> |