This post illustrate one of the problem which I faced while developing application for Android. The issue was very weird while I first got, since the same code works fine with normal Java applications.
I got the same issue with my Android test project too. This issue you will get if you use sqljdbc-1.2.0 is this
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: Socket closed.
I tried googling for the issue and came to know with a bug with Microsoft sqljdbc-1.2.0.jar
You can find more information from here
Well, the solution is, use jtds-1.2.7
which you can download from here
Don’t use the latest version of JTDS (jtds-1.3.1), since that too has bug with Android and this will again give you a ClassNotfoundException
I know this sounds a simple post, but it took 5 hours
of my time to sort out both the above issue I faced.
I hope you find this solution useful.