B4J Question B4J non-UI app - Official connection methods documentation

Mark Stuart

Active Member
Licensed User
Longtime User
Hi to all and Erel,

Where can I find the B4X official documentation that shows the different connection methods to an MS SQL Server database, from B4J?
I've searched the forum and all I'm finding is posts from ppl that are not official methods and they are all different.

I need to know what the connection string is for: Windows Authentication and SQL Server Authentication, and any other connection information that makes it successful.
And what all .jar files are valid. I've learnt that using Windows Authentication requires this DLL: mssql-jdbc_auth-13.2.1.x64.dll file to be copied into the folder where javaw.exe is.
But that is not B4X official information.

Help needed.

Regards,
Mark Stuart
 

Swissmade

Well-Known Member
Licensed User
Longtime User
This dll can go to the Dirapp where your jar is.


sqljdbc_auth.dll:
        If File.Exists(DirApp, "sqljdbc_auth.dll") = True Then
            MSSQLDomeinLoginStr = ";integratedSecurity=true" This to add to your loginstring
        End If

The rest I can not remember is a long time ago.
Maybe this give you a idea.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Whether it is UI or Non-UI, using Windows Authentication or SQL Server Authentication, you just need the jdbc driver with jar extension. No need to use DLL.
Either use jtds or download from microsoft website.
 
Upvote 0

Chris2

Active Member
Licensed User
Longtime User
The official B4X documentation is here: https://www.b4x.com/android/documentation.html
And the tutorial videos: https://www.b4x.com/etp.html - check the SQL and jRDC2 tutorials.

You have a choice of additional jars, but if you're using the latest Microsoft JDBC Driver for SQL Server then you'll need to add something like the following to your Main module:
B4X:
#AdditionalJar: mssql-jdbc-13.2.1.jre11

But the SQL Server connection strings are not defined by B4X, it's the jdbc driver that determines them:
 
Upvote 0
Top