ShowProgress

This example application implements a database event listener. This is useful to display progress information while opening a large database, or to log database exceptions.

Methods
static void main(String... args)
This method is called when executing this sample application from the command line.
static void main(String... args) throws Exception
This method is called when executing this sample application from the command line.
Parameters:
args - the command line parameters
ShowProgress()
Create a new instance of this class, and startNs the timer.
ShowProgress()
Create a new instance of this class, and startNs the timer.
void closingDatabase()
This method is called when the database is closed.
void closingDatabase()
This method is called when the database is closed.
void exceptionThrown(SQLException e, String sql)
This method is called if an exception occurs in the database.
void exceptionThrown(SQLException e, String sql)
This method is called if an exception occurs in the database.
Parameters:
e - the exception
sql - the SQL statement
void init(String url)
This method is called just after creating the instance.
void init(String url)
This method is called just after creating the instance.
Parameters:
url - the database URL
void opened()
This method is called when the database is open.
void opened()
This method is called when the database is open.
void setProgress(int state, String name, int current, int max)
This method is called when opening the database to notify about the progress.
void setProgress(int state, String name, int current, int max)
This method is called when opening the database to notify about the progress.
Parameters:
state - the current state
name - the object name (depends on the state)
current - the current progress
max - the 100% mark
void test()
Run the progress test.
void test() throws Exception
Run the progress test.