SHARE
TWEET

Untitled

a guest Oct 4th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. String url = "jdbc:mysql://localhost:3306/mysql";
  2. String user = "root";
  3. String pass = "root1";
  4.  
  5. try {
  6.     Class.forName("com.mysql.jdbc.Driver");
  7.     Connection connection = DriverManager.getConnection(url, user, pass);
  8.     System.out.println("Connected to database");
  9. } catch (Exception e) {        
  10.     System.out.println(e);
  11.     System.out.println("Could not connect to database");
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top