Advertisement
Guest User

Untitled

a guest
Dec 1st, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3.  
  4. public class Driver {
  5.  
  6. public static void main(String[] args) {
  7. Connection c = null;
  8. try {
  9. Class.forName("org.postgresql.Driver");
  10. c = DriverManager.getConnection("jdbc:postgresql://localhost:5432/Movie",
  11. "postgres", "taabish1");
  12.  
  13.  
  14. } catch (Exception e){
  15. e.printStackTrace();
  16. System.err.println(e.getClass().getName()+": "+e.getMessage());
  17. System.exit(0);
  18. }
  19. System.out.println("Opened Database Successfully");
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement