Browse Source

fixing the DB connection string

exception_work
Nicholas Caughey 3 years ago
parent
commit
2b413d5538
  1. 6
      src/main/java/constants/PSGQL.java
  2. 15
      src/main/java/dto/ConnectDB.java

6
src/main/java/constants/PSGQL.java

@ -1,7 +1,7 @@
package constants; package constants;
public class PSGQL { public class PSGQL {
public final String url = "jdbc:postgresql://localhost:5432/ScanDB"; public static final String url = "jdbc:postgresql://localhost:5432/ScanDB";
public final String user = "ncaughey"; public static final String user = "ncaughey";
public final String password = ""; public static final String password = "";
} }

15
src/main/java/dto/ConnectDB.java

@ -1,19 +1,20 @@
package dto; package dto;
// import constants.PSGQL; import constants.PSGQL;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.SQLException; import java.sql.SQLException;
public class ConnectDB{ import static constants.PSGQL.user;
import static constants.PSGQL.password;
import static constants.PSGQL.url;
// private final String url = "jdbc:postgresql://localhost/dvdrental"; public class ConnectDB{
// private final String url = "jdbc:postgresql://localhost:5432/scandb";
// private final String user = "postgres"; // private final String user = "postgres";
// private final String password = "<add your password>"; // private final String password = "password";
private final String url = "jdbc:postgresql://localhost:5432/scandb";
private final String user = "postgres";
private final String password = "password";
/** /**
* Connect to the PostgreSQL database * Connect to the PostgreSQL database

Loading…
Cancel
Save