forked from AdvancedProgramming1404/WS-10-Database
30 lines
626 B
Java
30 lines
626 B
Java
package dev.database;
|
|
|
|
import java.sql.Connection;
|
|
import java.sql.DriverManager;
|
|
import java.sql.SQLException;
|
|
|
|
public class DatabaseConnection {
|
|
private static final String URL = "jdbc:postgresql://localhost:5432/restaurant_db";
|
|
|
|
private static final String USER = "avasanatkar";
|
|
|
|
private static final String PASSWORD = "";
|
|
|
|
|
|
private DatabaseConnection() {
|
|
|
|
}
|
|
|
|
public static Connection getConnection()
|
|
throws SQLException {
|
|
|
|
// TODO:
|
|
// Return a valid PostgreSQL connection
|
|
|
|
// return null;
|
|
return DriverManager.getConnection(URL, USER, PASSWORD);
|
|
|
|
}
|
|
|
|
} |