implement DatabaseConnection class
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package dev.database;
|
package dev.database;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
|
import java.sql.DriverManager;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
public class DatabaseConnection {
|
public class DatabaseConnection {
|
||||||
@@ -9,7 +10,7 @@ public class DatabaseConnection {
|
|||||||
|
|
||||||
private static final String USER = "postgres"; // Your Username
|
private static final String USER = "postgres"; // Your Username
|
||||||
|
|
||||||
private static final String PASSWORD = "password"; // Your Password
|
private static final String PASSWORD = "FinalProjectDev"; // Your Password
|
||||||
|
|
||||||
private DatabaseConnection() {
|
private DatabaseConnection() {
|
||||||
|
|
||||||
@@ -17,11 +18,7 @@ public class DatabaseConnection {
|
|||||||
|
|
||||||
public static Connection getConnection()
|
public static Connection getConnection()
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
|
return DriverManager.getConnection(URL,USER,PASSWORD);
|
||||||
// TODO:
|
|
||||||
// Return a valid PostgreSQL connection
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user