Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
  2.  
  3. public static Connection getConnection() throws Exception {
  4. try {
  5. Class.forName("com.mysql.jdbc.Driver");
  6. Connection conn = DriverManager.getConnection("jdbc:mysql://sql9.freemysqlhosting.net:3306/sql9183415",
  7. "user", "pass");
  8. System.out.println("Connected");
  9. return conn;
  10. } catch (Exception e) {
  11. System.out.println(e);
  12. }
  13. return null;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement