ckjason Posted June 22, 2015 Share Posted June 22, 2015 I'm able to connect to local SQL server database by using Genymotion emulator. But when generate to APK and run on mobile, it doesn't connect to database. I notice the logcat shows "Connect failed: No route to host". I have turn on my wifi and the signal is very strong. Below are methods that I have tried but still cannot solve it. 1) Turn ON/OFF wifi when run the app. 2) Set allow remote connection in SQL server. 3) Same network (Local IP= 192.168.0.110 Mobile IP: 192.168.0.114) 4) Using different port (80/1443) My code: con = DriverManager.getConnection("jdbc:jtds:sqlserver://192.168.0.110/app", "test", "1234"); or con = DriverManager.getConnection("jdbc:jtds:sqlserver://192.168.0.110:1443/app", "test", "1234"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.