|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.samples.ShowProgress
public class 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.
| Field Summary |
|---|
| Fields inherited from interface org.h2.api.DatabaseEventListener |
|---|
STATE_BACKUP_FILE, STATE_CREATE_INDEX, STATE_RECONNECTED, STATE_RECOVER, STATE_SCAN_FILE |
| Constructor Summary | |
|---|---|
ShowProgress()
Create a new instance of this class, and start the timer. |
|
| Method Summary | |
|---|---|
void |
closingDatabase()
This method is called when the database is closed. |
void |
exceptionThrown(java.sql.SQLException e,
java.lang.String sql)
This method is called if an exception occurs in the database. |
void |
init(java.lang.String url)
This method is called just after creating the instance. |
static void |
main(java.lang.String... args)
This method is called when executing this sample application from the command line. |
void |
opened()
This method is called when the database is open. |
void |
setProgress(int state,
java.lang.String name,
int current,
int max)
This method is called when opening the database to notify about the progress. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ShowProgress()
| Method Detail |
|---|
public static void main(java.lang.String... args)
throws java.lang.Exception
args - the command line parameters
java.lang.Exception
public void exceptionThrown(java.sql.SQLException e,
java.lang.String sql)
exceptionThrown in interface DatabaseEventListenere - the exceptionsql - the SQL statement
public void setProgress(int state,
java.lang.String name,
int current,
int max)
setProgress in interface DatabaseEventListenerstate - the current statename - the object name (depends on the state)current - the current progressmax - the 100% markpublic void closingDatabase()
closingDatabase in interface DatabaseEventListenerpublic void init(java.lang.String url)
init in interface DatabaseEventListenerurl - the database URLpublic void opened()
opened in interface DatabaseEventListener
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||