Class Database
java.lang.Object
eds.database.Database
Database is the single entry point for database access.
- Holds the SQLite connection as a singleton
- Creates tables on first run if they do not exist
- Provides the connection to repositories (repo)
- Closes the connection on app shutdown
Usage:
- Call Database.getInstance().getConnection() from repositories
- Call Database.getInstance().close() in SimulatorGUI.stop()
-
Method Details
-
getInstance
-
getConnection
-
close
public void close()Closes the database connection. Should be called in SimulatorGUI.stop().
-