Here is an example with the four variables set:
https://www.b4x.com/android/forum/threads/mssql-jdbc-minimalistic-example.90548/#post-573074.
Please note that the poster still had issues and this was my reply:
https://www.b4x.com/android/forum/threads/mssql-jdbc-minimalistic-example.90548/#post-573443
The usage of the other driver was confirmed in the same thread:
https://www.b4x.com/android/forum/threads/mssql-jdbc-minimalistic-example.90548/#post-591195
Since this has been awhile ago (5 months), the MS driver may work with newer version of Android. But that is for you to test since 1) you would like to connect to MS SQL directly and 2) you seem to have the means to test it since you seem to have an MS SQL server up and running.
Thank you so much OliverA!!! I have downloaded the example and tested. It returns a success in connecting to the server but an error of ExecQueryAsync (invalid object name) T^T
Log:
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Class anywheresoftware.b4a.B4AThreadPool failed lock verification and will run slower.
** Activity (main) Resume **
Class net.sourceforge.jtds.jdbc.JtdsConnection failed lock verification and will run slower.
Class net.sourceforge.jtds.jdbc.Semaphore failed lock verification and will run slower.
Class net.sourceforge.jtds.jdbc.SharedSocket failed lock verification and will run slower.
Class net.sourceforge.jtds.util.TimerThread failed lock verification and will run slower.
Class net.sourceforge.jtds.jdbc.TdsCore failed lock verification and will run slower.
Class net.sourceforge.jtds.jdbc.JtdsStatement failed lock verification and will run slower.
Class net.sourceforge.jtds.jdbc.JtdsResultSet failed lock verification and will run slower.
Connect Success
ThreadedRenderer.create() translucent=true
Input channel constructed: fd=79
setView = DecorView@3ae93f1[main] touchMode=true
dispatchAttachedToWindow
Class net.sourceforge.jtds.jdbc.JtdsPreparedStatement failed lock verification and will run slower.
Relayout returned: oldFrame=[0,0][0,0] newFrame=[28,839][1052,1143] result=0x27 surface={isValid=true 548136594944} surfaceGenerationChanged=true
mHardwareRenderer.initialize() mSurface={isValid=true 548136594944} hwInitialized=true
MSG_WINDOW_FOCUS_CHANGED 1
mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true 548136594944}
MSG_RESIZED_REPORT: frame=Rect(28, 839 - 1052, 1143) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
MSG_WINDOW_FOCUS_CHANGED 0
java.sql.SQLException: Invalid object name 'Switches'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1029)
at anywheresoftware.b4j.objects.SQL.ExecQuery2(SQL.java:343)
at anywheresoftware.b4j.objects.SQL$3.run(SQL.java:297)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:762)
mHardwareRenderer.destroy()#4
dispatchDetachedFromWindow
Input channel destroyed: fd=79
ThreadedRenderer.create() translucent=true
Input channel constructed: fd=79
setView = DecorView@1e8bd36[main] touchMode=true
dispatchAttachedToWindow
Relayout returned: oldFrame=[0,0][0,0] newFrame=[28,704][1052,1279] result=0x27 surface={isValid=true 548136594944} surfaceGenerationChanged=true
mHardwareRenderer.initialize() mSurface={isValid=true 548136594944} hwInitialized=true
onsize change changed
onsize change changed
MSG_WINDOW_FOCUS_CHANGED 1
mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true 548136591360}
sendUserActionEvent() returned.
MSG_WINDOW_FOCUS_CHANGED 1
mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true 548136594944}
MSG_RESIZED_REPORT: frame=Rect(28, 704 - 1052, 1279) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
MSG_WINDOW_FOCUS_CHANGED 0
mHardwareRenderer.destroy()#4
dispatchDetachedFromWindow
System.exit called, status: 0
VM exiting with result code 0, cleanup skipped.
SS_ART_lib
: permission is absent: /data/app/b4a.example-1/base.apk
SS_ART_lib : access to SS denied
SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=b4a.example
Class anywheresoftware.b4a.BA failed lock verification and will run slower.
Common causes for lock verification issues are non-optimized dex code
and incorrect proguard optimizations.
Starting remote logger. Port: 35352
init sf_choreo_doframe debug_Level : 0x4f4cdebug_game_running : false
ThreadedRenderer.create() translucent=false
Input channel constructed: fd=59
setView = DecorView@2ea57a8[main] touchMode=true
dispatchAttachedToWindow
Relayout returned: oldFrame=[0,0][0,0] newFrame=[0,0][1080,1920] result=0x27 surface={isValid=true 548136628224} surfaceGenerationChanged=true
mHardwareRenderer.initialize() mSurface={isValid=true 548136628224} hwInitialized=true
QUALCOMM build : cce9f40, Ifcb662fdfd
Build Date : 07/11/17
OpenGL ES Shader Compiler Version: XE031.09.00.04
Local Branch :
Remote Branch :
Remote Branch :
Reconstruct Branch :
*** Debugger waiting for connection (0) ***
Initialized EGL, version 1.4
Swap behavior 1
MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 63 - 0, 0) vi=Rect(0, 63 - 0, 0) or=1
MSG_WINDOW_FOCUS_CHANGED 1
mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true 548136628224}
Starting input: tba=android.view.inputmethod.EditorInfo@d0b9fd nm : b4a.example ic=null