Heavily refactored DatabaseManager.java and SimpleDatabaseManager.java. Fully refactored DatabaseGoodCasesTest.java and DatabaseBadCasesTest.java.

This commit is contained in:
Riley Schneider
2025-12-08 17:50:21 +01:00
parent 292d6c74c3
commit e9b2ad0a57
5 changed files with 254 additions and 225 deletions

View File

@@ -4,8 +4,26 @@ import java.io.IOException;
import java.nio.file.Path;
import java.sql.SQLException;
/**
* A database interface with basic database connectivity
* @author Riley Schneider
*/
public interface Database {
public void connect() throws SQLException;
public void close() throws SQLException;
public void clearDatabase() throws SQLException;
/**
* Creates a connection to the database
* @throws SQLException Thrown if database error occurs
*/
void connect() throws SQLException;
/**
* Closes a connection to the database
* @throws SQLException Thrown if database error occurs
*/
void close() throws SQLException;
/**
* Clears the entire tables in the database and reset primary key counter to each table
* @throws SQLException Thrown if database error occurs
*/
void clearDatabase() throws SQLException;
}