Class DBManager

java.lang.Object
my.edu.tarc.dco.bookrentalpos.DBManager

public class DBManager
extends Object
Class used to execute queries for database
Version:
1.0
Author:
Looz
  • Constructor Details

    • DBManager

      public DBManager()
      Only call once throughout the project and pass the reference around thanks
  • Method Details

    • disconnectDB

      public void disconnectDB()
      Used to disconnect current database connection
    • updateQuery

      public int updateQuery​(String q)
      Execute update Query
      Parameters:
      q - SQLITE query
      Returns:
      rows are affected, return -1 if SQLException thrown
    • execQuery

      public boolean execQuery​(String q)
      Execute query
      Parameters:
      q - SQLITE Query
      Returns:
      true if the query returned a ResultSet
    • resultQuery

      public ResultSet resultQuery​(String q)
      Execute query that returns rows of data
      Parameters:
      q - SQLITE query
      Returns:
      ResultSet of the query, will return null if SQLException thrown
    • getLastErrorMsg

      public String getLastErrorMsg()
      Returns:
      Last error message that is logged when using this class