Yes. The server side can do everything a normal B4J server can do. Best is to search the forum for MSSQL, as I kind of remember having to do something special if I wanted to use Windows Authentication.
First, find on the web and download the mssql jdbc driver (e.g mssql-jdbc-8.2.2.jre11.jar).
Put it in the B4J Additional Libraries folder.
In your program's main module, add:
#AdditionalJar:mssql-jdbc-8.2.2.jre11.jar
Then, you can initialize the connection to MSSQL by calling the Sub below (modify the IP, port and databaseName, per your setup):
B4X:
Sub InitializeSQLServer(login As String, password As String, poolSize As Int)
' Log("init SQL Server")
UsePool = True
Try
pool.Initialize("com.microsoft.sqlserver.jdbc.SQLServerDriver", "jdbc:sqlserver://xxx.xxx.xxx.xxx:1433;databaseName=xxxxxxx", login, password)
Catch
Log("Last Pool Init Except: "&LastException.Message)
End Try
' change pool size...
Dim jo As JavaObject = pool
jo.RunMethod("setMaxPoolSize", Array(poolSize))
End Sub
Hint: To work with your database, you can use AlwaysBusy's excellent DBM module from the ABMFeedback (included in the ABMaterial package). Just add the above Sub in the DBM module.
Sub InitializeMariaDB(jdbcUrl As String ,login As String, password As String, poolSize As Int) 'ignore
Log("init mariadb")
UsePool = True
Try
pool.Initialize("org.mariadb.jdbc.Driver", jdbcUrl, login, password)
Catch
Log("Last Pool Init Except: "&LastException.Message)
End Try
' change pool size...
Dim jo As JavaObject = pool
jo.RunMethod("setMaxPoolSize", Array(poolSize))
End Sub
But how to recompile DBM.bas? I can't override this static module: error ABM 2 times used in my own project. I am using it within a ABMaterial lite project.