Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String url = "jdbc:postgresql://localhost:5432/COUNTRY_DB";
- try {
- Class.forName("org.postgresql.Driver");
- } catch (java.lang.ClassNotFoundException e) {
- System.err.print("ClassNotFoundException: ");
- System.err.println(e.getMessage());
- }
- try {
- con = DriverManager.getConnection(url, "postgres", "0987654321");
- stmt = con.createStatement();
- } catch (SQLException ex) {
- System.err.println("SQLException: " + ex.getMessage());
- }
- return con;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement