0

I developed an Android application using JDBC library that uses mysql.

Here is my full question: Android app show "java.lang.UnsupportedOperationExeption" while using JDBC to Connect mysql in localhost

when I'm using Eclipse to connect the data base it works properly, but when I'm wanna connect to data base using an Android application this error occurs:

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

this is a part of my code that try to connect to mysql:

Connection con = DriverManager.getConnection("jdbc:mysql://192.168.1.106:3306/test","root","12345678");

192.168.1.106 is my pc's private ip that running mysql

I tried :

1.changed bind-address in my.ini to 0.0.0.0

2.deactivate firewall

3.I granted all the permissions and flushed privileges to '%' user

4.opened port 3306 on firewall

I tried all solution of other questions like this but error still there...

Lino
  • 5,084
  • 3
  • 21
  • 39
  • Please [reconsider your use of JDBC on Android](https://stackoverflow.com/questions/15853367/jdbc-vs-web-service-for-android?r=Saves_AllUserSaves). – CommonsWare Jul 15 '23 at 21:39

0 Answers0