Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ bin/
out/
target/
build/

# === macOS ===
.DS_Store
7 changes: 0 additions & 7 deletions src/edu/ucalgary/oop/CLIHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 3 additions & 9 deletions src/edu/ucalgary/oop/DatabaseAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");
Expand All @@ -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());
Expand Down Expand Up @@ -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());
Expand Down