Now my appli goes directly to the next step without the database connection, not good.
How to wait until the connection is timeout or success using the ProgressIndicator?
Sub AppStart (Args() As String)
sql1.InitializeAsync("sql1", "com.mysql.jdbc.Driver", _
"jdbc:mysql://localhost/example?characterEncoding=utf8", "user", "password")
StartMessageLoop 'only required in a console app
End Sub
Sub sql1_Ready (Success As Boolean)
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
As written in the comment you only need to call StartMessageLoop in a console app. You need to handle the Ready event. It will be raised when the connection is ready.