NotificationRegistration
public interface DatabaseChangeRegistration extends NotificationRegistration
NotificationRegistration.RegistrationState
Modifier and Type | Method | Description |
---|---|---|
void |
addListener(DatabaseChangeListener listener) |
Register a listener with this registration.
|
void |
addListener(DatabaseChangeListener listener, 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.
|
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.
|
getDatabaseName, getRegistrationException, getRegistrationOptions, getState, getUserName
int getRegistrationId()
getRegId()
instead.long getRegId()
String[] getTables()
void addListener(DatabaseChangeListener listener) throws SQLException
Note that the listener's code will be executed in the thread owned by the driver.
SQLException
void addListener(DatabaseChangeListener listener, Executor e) throws SQLException
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.
SQLException
void removeListener(DatabaseChangeListener listener) throws SQLException
SQLException