我在将 java servlet 与 postgresql 连接时遇到了一些问题。如果可以的话,请帮助我
String dbName = "jdbc:postgresql://localhost/schedule_of_holidays";
String dbDriver = "org.postgresql.Driver";
Class.forName(dbDriver);
Connection con = DriverManager.getConnection(dbName, userName,
password);
System.out.println("Got Connection");
Statement statement = con.createStatement();
String sql = "select id from registration";
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
System.out.println(rs.getInt("id"));
}