1

I'm writing an app, which connects to the database, and sends a basic query. Till now I did all my tests on Android Studio Emulator and it worked fine, until I tried it on my phone, which can't connect to the database.

try{
            String myUrl = "jdbc:mysql://192.168.0.12/mydb";
            miastoItemList =new ArrayList<>();
            Connection c = DriverManager.getConnection(myUrl, "root", 
"test");
            Statement statement = c.createStatement();
            String s = "SELECT * FROM city";
            ResultSet rs = statement.executeQuery(s);
}
S.I.
  • 3,250
  • 12
  • 48
  • 77

0 Answers0