I'm currently testing the latest Microsoft JDBC driver and noticed that it works well on with B4J but NOT on B4A.
Please see code below
When same code is being executed on B4A (i.e Android), the system crashes and throws the following error:
I've been searching around several blogs without any resolution.
Anyone kindly advised how to resolve same.
Note that JTDS driver from sourceforge works on both platforms, but it seems they are no longer updating the driver since 2013.
Please see code below
query:
#AdditionalJar: mssql-jdbc-12.6.1.jre11
Private Sub RunQuery
Dim zJDBC As JdbcSQL
Dim myCNS As String ="jdbc:sqlserver://YOURSRRVER:PORT;databaseName=TESTDB;encrypt=true;trustServerCertificate=true"
zJDBC.Initialize2("com.microsoft.sqlserver.jdbc.SQLServerDriver",myCNS,userid,pwd)
Dim R As JdbcResultSet = zJDBC.ExecQuery("SELECT * FROM Table1")
Do While r.NextRow
Log ( r.GetString("data1") )
Loop
R.Close
End Sub
When same code is being executed on B4A (i.e Android), the system crashes and throws the following error:
err:
com.microsoft.sqlserver.jdbc.SQLServerException: "encrypt" property is set to "true" and "trustServerCertificate" property is set to "true" but the driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption: Error: Socket is closed. ClientConnectionId:ee69fa1f-a59f-47f4-857f-3e4647e2b558
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:4266)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1965)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3792)
I've been searching around several blogs without any resolution.
Anyone kindly advised how to resolve same.
Note that JTDS driver from sourceforge works on both platforms, but it seems they are no longer updating the driver since 2013.