I am finishing developing a SQL-Java application in NetBeans and the queries to the database that is in CPanel work very well when I use the same internet network from which I develop the application, but when I try to make the same queries but using another network, Internet does not allow me to make inquiries and it returns this error. I must clarify that it works on different computers as long as they are connected to the network that I mentioned
com.mysql.cj.jdbc.exceptions.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.
This is the connection code:
package users;
import java.sql.*;
import javax.sql.DataSource;
import org.apache.commons.dbcp2.BasicDataSource;
public class Conexion {
    private static final String JDBC_URL = "jdbc:mysql://67.222.16.112/users?zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&useTimezone=true&serverTimezone=UTC";
    private static final String JDBC_USER = "root";
    private static final String JDBC_PASS = "pass";
    
    public static Connection getConnection() throws SQLException //Agregamos este ultimo ya que puede generar una excepción el getConnection
    {
        return DriverManager.getConnection(JDBC_URL, JDBC_USER, JDBC_PASS);
    }
    
    public static void close(ResultSet rs)
    {
        try {
            rs.close();
        } catch (SQLException ex) {
            ex.printStackTrace(System.out);
        }
    }
    
    public static void close(PreparedStatement stmt)
    {
        try {
            stmt.close();
        } catch (SQLException ex) {
            ex.printStackTrace(System.out);
        }
    }
    
    public static void close(Connection conn)
    {
        try {
            conn.close();
        } catch (SQLException ex) {
            ex.printStackTrace(System.out);
        }
    }
}
In the command prompt I wrote ping ip_of_my_server and I get a stable value in all the internet networks that I try, so I don't think that is it.
 
    