public interface DatabaseEventListener
extends java.util.EventListener
Modifier and Type | Field and Description |
---|---|
static int |
STATE_BACKUP_FILE
This state is used during the BACKUP command.
|
static int |
STATE_CREATE_INDEX
This state is used when re-creating an index.
|
static int |
STATE_RECONNECTED
This state is used after re-connecting to a database (if auto-reconnect
is enabled).
|
static int |
STATE_RECOVER
This state is used when re-applying the transaction log or rolling back
uncommitted transactions.
|
static int |
STATE_SCAN_FILE
This state is used when scanning the database file.
|
static int |
STATE_STATEMENT_END
This state is used when a query ends.
|
static int |
STATE_STATEMENT_PROGRESS
This state is used for periodic notification during long-running queries.
|
static int |
STATE_STATEMENT_START
This state is used when a query starts.
|
Modifier and Type | Method and Description |
---|---|
default void |
closingDatabase()
This method is called before the database is closed normally.
|
default void |
exceptionThrown(java.sql.SQLException e,
java.lang.String sql)
This method is called if an exception occurred.
|
default void |
init(java.lang.String url)
This method is called just after creating the object.
|
default void |
opened()
This method is called after the database has been opened.
|
default void |
setProgress(int state,
java.lang.String name,
long x,
long max)
This method is called for long running events, such as recovering,
scanning a file or building an index.
|
static final int STATE_SCAN_FILE
static final int STATE_CREATE_INDEX
static final int STATE_RECOVER
static final int STATE_BACKUP_FILE
static final int STATE_RECONNECTED
static final int STATE_STATEMENT_START
static final int STATE_STATEMENT_END
static final int STATE_STATEMENT_PROGRESS
default void init(java.lang.String url)
url
- - the database URLdefault void opened()
default void exceptionThrown(java.sql.SQLException e, java.lang.String sql)
e
- the exceptionsql
- the SQL statementdefault void setProgress(int state, java.lang.String name, long x, long max)
More states might be added in future versions, therefore implementations should silently ignore states that they don't understand.
state
- the statename
- the object namex
- the current positionmax
- the highest possible value or 0 if unknowndefault void closingDatabase()