Android database conectivity problem
<p>i am trying to make android (2.3) connection with mysql the code is given below:</p>

<pre><code>public class ConnectionClass {


static String user = "root";


public static void main() {
    String url = "jdbc:mysql://127.0.0.1:3306/mydatabase";
//  String url = "jdbc:mysql://10.2.5.69:3306/test";
    try {
        Class.forName("com.mysql.jdbc.Driver");

        ***Connection con = DriverManager.getConnection(url, user, "mypassword");***
        con.isReadOnly();
        System.out.println("success");
        Statement st = con.createStatement();
        ResultSet rs = st.executeQuery("select * from user");
        while (rs.next()) {
            System.out.println("id" + rs.getInt(1));
            System.out.println("data" + rs.getString(2));
        }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
</code></pre>

<p>}</p>

<p>but at the line "Connection con = DriverManager.getConnection(url, user, "mypassword")" i got com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure" exception. </p>
