diff --git a/.gitignore b/.gitignore index 17379e9..c929573 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,6 @@ bin/ out/ target/ build/ + +# === macOS === +.DS_Store diff --git a/src/edu/ucalgary/oop/CLIHandler.java b/src/edu/ucalgary/oop/CLIHandler.java index 673d80e..7e9ade3 100644 --- a/src/edu/ucalgary/oop/CLIHandler.java +++ b/src/edu/ucalgary/oop/CLIHandler.java @@ -57,13 +57,6 @@ private void displayMainMenu() { String locations = LanguageLoader.getTranslation("menu.locations"); String exit = LanguageLoader.getTranslation("menu.exit"); - System.out.println("\nDEBUG - Menu items:"); - System.out.println("Title: '" + title + "'"); - System.out.println("Victims: '" + victims + "'"); - System.out.println("Supplies: '" + supplies + "'"); - System.out.println("Inquiries: '" + inquiries + "'"); - System.out.println("Locations: '" + locations + "'"); - System.out.println("Exit: '" + exit + "'"); System.out.println("\n" + title); System.out.println("1. " + victims); diff --git a/src/edu/ucalgary/oop/DatabaseAdapter.java b/src/edu/ucalgary/oop/DatabaseAdapter.java index ae0e6ab..5a01ce8 100644 --- a/src/edu/ucalgary/oop/DatabaseAdapter.java +++ b/src/edu/ucalgary/oop/DatabaseAdapter.java @@ -32,9 +32,9 @@ public class DatabaseAdapter implements AutoCloseable { private static DatabaseAdapter instance; private Connection connection; - private static final String DB_URL = "jdbc:postgresql://localhost:5432/ensf380project"; - private static final String USER = "oop"; - private static final String PASS = "ucalgary"; + private static final String DB_URL = System.getenv().getOrDefault("DB_URL", "jdbc:postgresql://localhost:5432/ensf380project"); + private static final String USER = System.getenv().getOrDefault("DB_USER", "oop"); + private static final String PASS = System.getenv().getOrDefault("DB_PASSWORD", ""); private boolean isTestMode = false; // Test mode data @@ -58,9 +58,6 @@ private void initializeConnection() throws SQLException { } try { - System.out.println("Attempting to connect to database..."); - System.out.println("URL: " + getDbUrl()); - System.out.println("User: " + USER); // Load the PostgreSQL JDBC driver Class.forName("org.postgresql.Driver"); @@ -79,7 +76,6 @@ private void initializeConnection() throws SQLException { throw new SQLException("Failed to establish database connection"); } - System.out.println("Successfully connected to database"); } catch (ClassNotFoundException e) { System.err.println("PostgreSQL JDBC Driver not found: " + e.getMessage()); throw new SQLException("PostgreSQL JDBC Driver not found: " + e.getMessage()); @@ -715,9 +711,7 @@ public void cleanupDuplicateVictims() { stmt.executeUpdate(); } } - System.out.println("Cleaned up " + idsToDelete.size() + " duplicate victim(s)"); } else { - System.out.println("No duplicate victims found"); } } catch (SQLException e) { System.err.println("Error cleaning up duplicate victims: " + e.getMessage());