26 lines
582 B
Java
26 lines
582 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"; // DB Server
|
|
|
|
private static final String USER = "matin"; // Your Username
|
|
|
|
private static final String PASSWORD = "0000"; // Your Password
|
|
|
|
private DatabaseConnection() {
|
|
|
|
}
|
|
|
|
public static Connection getConnection()
|
|
throws SQLException {
|
|
|
|
return DriverManager.getConnection(URL, USER, PASSWORD);
|
|
|
|
}
|
|
|
|
} |