Advertisement
Guest User

Untitled

a guest
Sep 20th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. public static void main(String[] args) {
  2.         Connection cn = null;
  3.         try {
  4.             Class.forName("com.mysql.jdbc.Driver");
  5.             cn = DriverManager.getConnection(
  6.                     "jdbc:mysql://localhost:3306/northwind?useSSL=false"
  7.                     , "root", "c0nygre");
  8.             System.out.println("Connection OK :)");
  9.         }
  10.         catch(SQLException | ClassNotFoundException e) {
  11.             System.out.println("OOPS :(" + e.getMessage());
  12.         }
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement