Class Database

java.lang.Object
eds.database.Database

public class Database extends Object
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

      public static Database getInstance()
    • getConnection

      public Connection getConnection()
    • close

      public void close()
      Closes the database connection. Should be called in SimulatorGUI.stop().