Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3.  
  4. public class Connect {
  5. public static void main(String[] args) {
  6. try {
  7. Class.forName("org.postgresql.Driver");
  8. System.out.println("Driver O.K.");
  9.  
  10. String url = "jdbc:postgresql://localhost:5432/Login-Dashboard";
  11. String user = "postgres";
  12. String passwd = "899122ekaq";
  13.  
  14. Connection conn = DriverManager.getConnection(url, user, passwd);
  15. System.out.println("Connexion effective !");
  16.  
  17. } catch (Exception e) {
  18. e.printStackTrace();
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement