Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class Driver {
- public static void main(String[] args) {
- Connection c = null;
- try {
- Class.forName("org.postgresql.Driver");
- c = DriverManager.getConnection("jdbc:postgresql://localhost:5432/Movie",
- "postgres", "taabish1");
- } catch (Exception e){
- e.printStackTrace();
- System.err.println(e.getClass().getName()+": "+e.getMessage());
- System.exit(0);
- }
- System.out.println("Opened Database Successfully");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement