Now i user mysql-connector-java-5.1.21-bin.jar library
And try next code:

private static final String CONNECTION = "jdbc:mysql://x.x.x.x:3306/db";
    
private void getMySQLConnection() {
        Connection con = null;
        String str_res = "";

        try{
            Class.forName("com.mysql.jdbc.Driver").newInstance();
                
                // Properties for user and password.
                Properties p = new Properties();
                p.put("user","***");
                p.put("password","***");
                
                // Now try to connect
                Connection c = DriverManager.getConnection(CONNECTION, p);
    } catch (Exception e) {}

Exception code:
com.mysql.jdbc.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.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to