0

I am working on an android app which is associated with azure database however when i test the app on my home netowrk , the application runs without any errors when i go out or connect to another wifi network this error occur

W/System.err: java.sql.SQLException: Network error IOException: failed to connect to devserverall.database.windows.net/xx.xxx.xxx.xx (port 1433) from /yyy.yyy.y.yyy (port 48262) after 30000ms: isConnected failed: EHOSTUNREACH (No route to host)
        at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:436)
W/System.err:     at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
        at java.sql.DriverManager.getConnection(DriverManager.java:580)
        at java.sql.DriverManager.getConnection(DriverManager.java:236)
        at com.example.helpy.BackgroundTask2.connection(BackgroundTask2.java:32)
        at com.example.helpy.BackgroundTask2.executelist(BackgroundTask2.java:47)
        at com.example.helpy.BackgroundTask2.doInBackground(BackgroundTask2.java:113)
        at com.example.helpy.BackgroundTask2.doInBackground(BackgroundTask2.java:16)
        at android.os.AsyncTask$3.call(AsyncTask.java:378)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)

i use jtds module to connect to azure with this connection string

jdbc:jtds:sqlserver://devserverall.database.windows.net:1433;DatabaseName=xxx;user=xxxx@devserverall;password=xxxxx;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;
Ahmed
  • 45
  • 1
  • 9

1 Answers1

0

Probably, it looks like a network connectivity problem, you could verify if:

  • The application has a successful connection to the Internet from the wifi network. Make sure that the WiFi or cell is turned on and operational.
  • The application outgoing public IP address has changed from your wifi network, you could add the new client IP to your Azure SQL server firewall, refer to this.
  • The port 1433 is blocked in your wifi network.

For more details, refer to this answer.

Nancy
  • 26,865
  • 3
  • 18
  • 34