📅  最后修改于: 2022-03-11 15:05:33.745000             🧑  作者: Mango
public Connection connect() {
Connection conn = null;
try {
conn = DriverManager.getConnection(url, user, password);
System.out.println("Connected to the PostgreSQL server successfully.");
} catch (SQLException e) {
System.out.println(e.getMessage());
}
return conn;
}
Code language: Java (java)