I've tried the following with a simple DB which has only windows authentication for experimental purposes :
And I get the message "Failed to connect". What could be the problem?
#AdditionalJar : mssql-jdbc-10.2.0.jre17.jar #AdditionalJar : JDBCSQL.jar ''#AdditionalRes : sqljdbc_xa.dll #AdditionalJar :jtds-1.3.1.jar:
#AdditionalJar : mssql-jdbc-10.2.0.jre17.jar
#AdditionalJar : JDBCSQL.jar
''#AdditionalRes : sqljdbc_xa.dll
#AdditionalJar :jtds-1.3.1.jar
Public Sub KPI_Ready(Success As Boolean)
If Success = False Then
Log ("Failed to connect")
Else if Success=True Then
Log ("Succesful Connection")
End If
End Sub
Private Sub ButtonAdd_Click
''Private connectionString As String="jdbc:sqlserver://localhost;Port=80;databaseName=KPI"
'' Private connectionString As String="jdbc:sqlserver://{SERVER}/{INSTANCE};Port={PORT};databaseName={DATABASE}"
Private connectionStringTrusted As String="jdbc:jtds:SQLServer://Localhost:17178;databaseName='KPI';integratedSecurity=false;"
AnySQL.InitializeAsync("KPI","net.sourceforge.jtds.jdbc.driver",connectionStringTrusted,"","")
''AnySQL.InitializeAsync("KPI","com.microsoft.sqlserver.jdbc.SQLServerDriver" , connectionStringTrusted,"","")
If AnySQL.IsInitialized Then
AnyResultSet= AnySQL.ExecQuery("Select * from Department")
Log(AnyResultSet.GetString("Department_Name"))
End If
B4XPages.ShowPageAndRemovePreviousPages("Item")
End Sub
And I get the message "Failed to connect". What could be the problem?