Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. try {
  2. String url = "jdbc:mysql://localhost:3306/dbname";
  3. Connection con = DriverManager.getConnection(url, "test", "test");
  4.  
  5.  
  6. } catch (SQLException ex) {
  7. System.out.println("SQLException: " + ex.getMessage());
  8. System.out.println("SQLState: " + ex.getSQLState());
  9. System.out.println("VendorError: " + ex.getErrorCode());
  10. }
  11.  
  12. Class.forName("com.mysql.jdbc.Driver");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement