Jump to content
Android Forum - A Community For Android Users and Enthusiasts

Android unable to connect sql server in mobile


ckjason
 Share

Recommended Posts

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");

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...