|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.engine.lobby.server.userDB.Database
public class Database
Utility to get connections to the database.
The database is embedded within the jvm.
Getting a connection will cause the database (and the neccessary tables) to be created if it does not already exist.
The database will be shutdown on System.exit through a shutdown hook.
Getting a connection will also schedule backups at regular intervals.
| Constructor Summary | |
|---|---|
Database()
|
|
| Method Summary | |
|---|---|
static void |
backup()
|
static java.io.File |
getBackupDir()
|
static java.sql.Connection |
getConnection()
|
static void |
main(java.lang.String[] args)
Restore the database. |
static void |
restoreFromBackup(java.io.File backupDir)
This must be the first db call made. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Database()
| Method Detail |
|---|
public static java.sql.Connection getConnection()
public static void restoreFromBackup(java.io.File backupDir)
throws java.sql.SQLException
backupDir -
java.sql.SQLExceptionpublic static void backup()
public static java.io.File getBackupDir()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||