Package my.edu.tarc.dco.bookrentalpos
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 Summary
Constructors Constructor Description DBManager()Only call once throughout the project and pass the reference around thanks -
Method Summary
Modifier and Type Method Description voiddisconnectDB()Used to disconnect current database connectionbooleanexecQuery(String q)Execute queryStringgetLastErrorMsg()ResultSetresultQuery(String q)Execute query that returns rows of dataintupdateQuery(String q)Execute update Query
-
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
Execute update Query- Parameters:
q- SQLITE query- Returns:
- rows are affected, return -1 if SQLException thrown
-
execQuery
Execute query- Parameters:
q- SQLITE Query- Returns:
- true if the query returned a ResultSet
-
resultQuery
Execute query that returns rows of data- Parameters:
q- SQLITE query- Returns:
- ResultSet of the query, will return null if SQLException thrown
-
getLastErrorMsg
- Returns:
- Last error message that is logged when using this class
-