My code results into this error, who can help me?
My program is in Android.
ERROR
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.
FUNCTION:
public Connection getConexato() throws ClassNotFoundException, SQLException, java.sql.SQLException, InstantiationException, IllegalAccessException {
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = (Connection) DriverManager.getConnection("jdbc:mysql://179.219.251.158:3306/partcatalog","root","teste123");
return conn;
}
Ping to machine server:
C:\Users\psysvica>ping 179.219.251.158
Disparando 179.219.251.158 com 32 bytes de dados:
Resposta de 179.219.251.158: bytes=32 tempo=53ms TTL=56
Resposta de 179.219.251.158: bytes=32 tempo=39ms TTL=56
Resposta de 179.219.251.158: bytes=32 tempo=82ms TTL=56
Resposta de 179.219.251.158: bytes=32 tempo=43ms TTL=56