Package oracle.jdbc.dcn

## Interface DatabaseChangeRegistration

All Superinterfaces:
  `NotificationRegistration`

    public interface DatabaseChangeRegistration
    extends NotificationRegistration

Since:
  11.1

### Nested Class Summary

### Nested classes/interfaces inherited from interface oracle.jdbc.NotificationRegistration

`NotificationRegistration.RegistrationState`

### Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods
`void` `addListener​(DatabaseChangeListener listener)` Register a listener with this registration.
`void` `addListener​(DatabaseChangeListener listener, java.util.concurrent.Executor e)` Register a listener with this registration.
`long` `getRegId()` Returns the registration id provided by the database.
`int` `getRegistrationId()` Deprecated. This method is deprecated in 11.2.
`java.lang.String[]` `getTables()` Returns the name of the tables associated with this registration.
`void` `removeListener​(DatabaseChangeListener listener)` Remove a listener from the list of registered listeners.

### Methods inherited from interface oracle.jdbc.NotificationRegistration

`getDatabaseName, getRegistrationException, getRegistrationOptions, getState, getUserName`

### Method Detail

#### getRegistrationId

    int getRegistrationId()

Deprecated.
This method is deprecated in 11.2. Use `getRegId()` instead.
Returns the registration id provided by the database. this is the value as the value contained in column 'regid' in table 'USER_CHANGE_NOTIFICATION_REGS'.

#### getRegId

    long getRegId()

Returns the registration id provided by the database. this is the value as the value contained in column 'regid' in table 'USER_CHANGE_NOTIFICATION_REGS'.

#### getTables

    java.lang.String[] getTables()

Returns the name of the tables associated with this registration.

#### addListener

    void addListener​(DatabaseChangeListener listener)
              throws java.sql.SQLException

Register a listener with this registration. The listener will be notified when an even occurs. You can register multiple listeners with this registration. The order in which they will be registered isn't guaranteed and may vary.

Note that the listener's code will be executed in the thread owned by the driver.

Throws:
  `java.sql.SQLException`

#### addListener

    void addListener​(DatabaseChangeListener listener,
                     java.util.concurrent.Executor e)
              throws java.sql.SQLException

Register a listener with this registration. The listener will be notified when an even occurs. You can register multiple listeners with this registration. The order in which they will be registered isn't guaranteed and may vary.

This method lets you control which thread will execute the listener's code when an event occurs by specifying an executor. You can provide your own executor which can for example use a pool of threads.

Throws:
  `java.sql.SQLException`

#### removeListener

    void removeListener​(DatabaseChangeListener listener)
                 throws java.sql.SQLException

Remove a listener from the list of registered listeners.

Throws:
  `java.sql.SQLException`