Jump to content

- - - - -

Android unable to connect sql server in mobile


  • Please log in to reply
No replies to this topic

#1 ckjason



  • Members
  • Pip
  • 1 posts

Posted 21 June 2015 - 05:51 PM

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=   Mobile IP:

4) Using different port (80/1443)


My code:

con = DriverManager.getConnection("jdbc:jtds:sqlserver://", "test", "1234");




con = DriverManager.getConnection("jdbc:jtds:sqlserver://", "test", "1234");