com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
I Surrender I already tried the best that I can Please help me I just need to make a connection to my database
I am using hostinger.ph as the hosting site of my database
DBconnect.java
package mftis;
import java.sql.*;
public class DBconnect {
private Connection con;
private Statement st;
private ResultSet rs;
public DBconnect(){
try{
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Success in using the Driver");
con = DriverManager.getConnection("jdbc:mysql://mysql.hostinger.ph/u366906409_mftis","u366906409_mftis","mftis2016");
st = con.createStatement();
}catch(Exception e){
System.out.println(e);
}
}
}
login_window
private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) {
DBconnect connect = new DBconnect();
}
Please I will really appreciate the help anyway my Database is over the internet all the tutorials i can found is using localhost