java.lang.Object
ai.tutor.cab302exceptionalhandlers.model.SQLiteConnection

public class SQLiteConnection extends Object
Defines a connection to the SQLite database.

By default, it connects to a database named "tutor.db". However, you can specify a different database name or use an in-memory database.

Usage:

 * SQLiteConnection connection = new SQLiteConnection();
 * // or with a specific database name
 * SQLiteConnection connection = new SQLiteConnection("myDatabase");
 * // or for an in-memory database
 * SQLiteConnection connection = new SQLiteConnection(true);
 * * Connection conn = connection.getInstance();
 * 
Author:
Joshua M.
  • Constructor Details

    • SQLiteConnection

      public SQLiteConnection() throws SQLException
      Creates a connection to the default SQLite database "tutor.db".
      Throws:
      SQLException - if a database connection error occurs
    • SQLiteConnection

      public SQLiteConnection(String databaseName) throws SQLException
      Creates a connection to a specified SQLite database.
      Parameters:
      databaseName - the name of the database to connect to
      Throws:
      SQLException - if a database connection error occurs
    • SQLiteConnection

      public SQLiteConnection(boolean inMemory) throws SQLException
      Creates a connection to an in-memory SQLite database or the default "tutor.db".
      Parameters:
      inMemory - if true, connects to an in-memory database; otherwise, connects to "tutor.db"
      Throws:
      SQLException - if a database connection error occurs
  • Method Details