Advertisement
Guest User

Untitled

a guest
May 27th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  2.  
  3. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
  4.  
  5. package mftis;
  6.  
  7. import java.sql.*;
  8.  
  9. public class DBconnect {
  10. private Connection con;
  11. private Statement st;
  12. private ResultSet rs;
  13.  
  14. public DBconnect(){
  15. try{
  16. Class.forName("com.mysql.jdbc.Driver");
  17. System.out.println("Success in using the Driver");
  18.  
  19. con = DriverManager.getConnection("jdbc:mysql://mysql.hostinger.ph/u366906409_mftis","u366906409_mftis","mftis2016");
  20. st = con.createStatement();
  21.  
  22. }catch(Exception e){
  23. System.out.println(e);
  24. }
  25. }
  26.  
  27. }
  28.  
  29. private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) {
  30. DBconnect connect = new DBconnect();
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement