Skip to content

Commit

Permalink
Fix: Database Connection works and is connected
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianBalunan committed Mar 12, 2026
1 parent 2fc2a70 commit 9a760f7
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public class DatabaseConnection {
*/

// Values stored in system environment variables for security (using ntnu's phpmyadmin for this project)
public DatabaseConnection() {
this.databaseURL = System.getenv("HMH_DB_URL");
this.username = System.getenv("HMH_DB_USERNAME");
this.password = System.getenv("HMH_DB_PASSWORD");
public DatabaseConnection(){
this.databaseURL = "jdbc:mysql://namox.idi.ntnu.no:3306/apbaluna?useSSL=false&serverTimezone=UTC";
this.username = "apbaluna";
this.password = "GYntUFPG";

if (this.databaseURL == null || this.databaseURL.isBlank()) {
throw new IllegalStateException("Database environment variable URL has not been set");
Expand Down Expand Up @@ -88,9 +88,4 @@ public DatabaseConnection(String databaseURL, String username, String password)
public Connection getMySqlConnection() throws SQLException {
return DriverManager.getConnection(databaseURL, username, password);
}

/**
*
*/

}

0 comments on commit 9a760f7

Please sign in to comment.