I am trying to mssql database with JSQL but JSQL ready function connot firing. Thanks
B4X:
'In Main page
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#AdditionalJar: jtds-1.3.1.jar
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
'#BridgeLogger: True
Sub Process_Globals
'Public ActionBarHomeClicked As Boolean
End Sub
Sub Globals
Private Button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("test2")
End Sub
Private Sub Button1_Click
ConnectSQL.Connect
End Sub
B4X:
'In Code Page
Sub Process_Globals
Dim SQL1 As SQL
#Region Database Location
Dim DBLocation As String = "192.168.1.21:1433"
Dim DBUsername As String = "UserName"
Dim DBPassword As String = "Password"
#End Region
End Sub
Public Sub Connect
SQL1.InitializeAsync("MSSQL","net.sourceforge.jtds.jdbc.Driver", $"jdbc:jtds:sqlserver://${DBLocation}/DemirHaber"$, DBUsername, DBPassword)
End Sub
Sub sql1_Ready (Success As Boolean) 'Here not firing
Log(Success)
If Success = False Then
Log(LastException)
Return
End If
Dim rs As ResultSet = SQL1.ExecQuery("SELECT table_name FROM information_schema.tables")
Do While rs.NextRow
Log(rs.GetString2(0))
Loop
rs.Close
End Sub