Guest User

Untitled

a guest
Jul 10th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. try {
  2. Class.forName("com.mysql.jdbc.Driver");
  3. java.sql.Connection con = DriverManager.getConnection("jdbc:mysql://11.222.33.444:3306/mybase?user=user&password=pass");
  4. } catch (ClassNotFoundException e) {
  5. e.printStackTrace();
  6. return;
  7. } catch (SQLException e) {
  8. e.printStackTrace();
  9. return;
  10. }
  11.  
  12. com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
  13.  
  14. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
  15. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:172)
  16. at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)
Add Comment
Please, Sign In to add comment