I\'m using the following coding to connect locally on my SQL database
String driver = \"net.sourceforge.jtds.jdbc.Driver\";
Class.forName(driver).ne
If you are referring to a localhost from your device than use the http://10.0.2.2:8080/ instead of the http://127.0.0.1/ or http://localhost/.
Because your Android emulator is running on a Virtual Machine(QEMU) and you can not connect to a server directly running on your PC.
And If you running your app from Physical android device then please use your network ip from your PC.
for example http://198.10.12.21:80/....
Also make sure that your device and PC(from where you call localhost) within same Network
I fix this error. I was working on jtds driver v1.3.1. When I'm using the older version it works. I'm using now v1.2.5