Android Question Connect to MS SQL SERVER with SSL, may be using mssql-jdbc-8.4.1.jre11. Posible?

netsistemas

Active Member
Licensed User
Longtime User
I need connect o SQL SERVER with SSL, and i think thak
JdbcSQL no support SSL conections in ANDROID.

how use the driver for B4J JdbcSQL in B4Androd? (are posible?)

In B4J (run exe under windows), there are not problem with ssl. (connect ok).



B4X:
    #if b4j
        #AdditionalJar: mssql-jdbc-8.4.1.jre11
        
    #else
        #AdditionalJar: jtds-1.3.1.jar
    #end if


That is:
i need conect to sql server with SSL, and a don't know how do this.
 

netsistemas

Active Member
Licensed User
Longtime User
Looking for all the sites, this is my conclusion for future consultations of other people:

- SSL does not work in jtds 1.3.1 driver FOR SQL SERVER
(You must find the library for b4j in this forum or init by this link:
https://www.b4x.com/android/forum/threads/how-to-connect-to-sql-server-using-jtds-1-3-1-jar.111446/


- The microsoft driver is not working for Android.

So, if you want to implement security to encrypt the sending of information, the only solution I have discovered is to use the HTTPS protocol like this

or create a webservice and use this webservice in your app.
 
Upvote 0

OliverA

Expert
Licensed User
SSL does not work in jtds 1.3.1 driver FOR SQL SERVER
There may be a workaround. Looks like there is an issue in the code of the official release. Someone in the jTDS forums produced a patch and another user posted the patched version of the driver on the forum. You would have to take the risk on using the patched version (since it was user supplied and is not from the official repository of jTDS).

Links:
Bug report: https://sourceforge.net/p/jtds/patches/129/
User supplied patched version: https://sourceforge.net/p/jtds/bugs/_discuss/thread/16113049/f77e/4151/f53d#f77e/4151/f53d
 
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
thank you very, very much, but i test this pach and no work :<
 
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
One more time.
someone know any thenic, proyect or metoth to connect to SQL SERVER with SSL.
i read something and doit testint with a patch in jdbc 1.3.1 but in Android not work.


I don't know if it really worked for someone on Android, or when they say it worked for them they meant JAVA. I have tried the latest drive from microsoft, but as expected, it still doesn't work. It doesn't even compile. I am surprised that at this technological stage, this option does not exist, but I think it will be what it is. The WEBService forces me to rethink my entire project, which will generate a lot of work for me, so I continue with this option. Ideas welcome
 
Upvote 0

OliverA

Expert
Licensed User
I have tried the latest drive from Microsoft, but as expected, it still doesn't work. It doesn't even compile
That's to be expected. Android's Java implementation is from the 1.7 era. All the newer JDBC drivers are based on 1.8 and above. Plus, they (the drivers) target desktops, not mobile devices. It just happens that for awhile, JDBC drivers were able to be used with Android. And you still can, as long as you stick with older JDBC drivers. Even MySQL's newest drivers do not work on Android. It is not the fault of the JDBC authors. It's not the fault of Java. It's not even the fault of Android, since Android is not a Desktop OS replacement.

Please note that in the B4i environment, there are zero direct database connection drivers available. So just for cross platform reasons, using JDBC drivers is not the best solution for accessing databases. On the other hand, if you can live with the limitations of using JDBC, it can be a solution for your problem (as it is for @MrKim)
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
I need connect o SQL SERVER with SSL, and i think thak
JdbcSQL no support SSL conections in ANDROID.

how use the driver for B4J JdbcSQL in B4Androd? (are posible?)

In B4J (run exe under windows), there are not problem with ssl. (connect ok).



B4X:
    #if b4j
        #AdditionalJar: mssql-jdbc-8.4.1.jre11
       
    #else
        #AdditionalJar: jtds-1.3.1.jar
    #end if


That is:
i need conect to sql server with SSL, and a don't know how do this.
Why not use ASP.NET pages that will connect to the SQL Server and return JSON back to you?
 
Upvote 0

Albert Kallal

Active Member
Licensed User
One more time.
someone know any project or method to connect to SQL SERVER with SSL.
i read something -- with a patch in jdbc 1.3.1 but in Android not work.

for a direct connection to sql server? Nope - no working solution I know of. Now to be fair, a direct connection to sql server is of limited value, and tends to not be such a good idea. So hitting a web service of course the most common approach and suggestion. And you can use a "bridge"

The only really nice advantage of the direct connection? Well, you don't need a web server or any server of any kind (so setup time - really nice!!!).

However, I will say that in one case, yes - I am hitting sql server direct. And I am using a VPN to do this. However the the encryption and network connection is already secured at the network level via the VPN - so I don't need nor care if I can't and am not using SSL to sql server, since the network connection is already secured.

But at this time? No, the Microsoft drivers don't work, and the jdbc one does not work with SSL .
R
Albert
 
Upvote 0
Top