Hello,
Is there a way to know if the connection pool is connected? SQL has a "_Ready (Success As Boolean)" event when SQL is connected, but it seems that ConnectionPool doesn't have one.
How can I know if I'm connected? Do I need to request a connection right after Initialize?
Thank you for your help.
Is there a way to know if the connection pool is connected? SQL has a "_Ready (Success As Boolean)" event when SQL is connected, but it seems that ConnectionPool doesn't have one.
B4X:
Sub Connect
Pool.Initialize("com.mysql.jdbc.Driver", _
$"jdbc:mysql://${MySQLHost}:${MySQLPort}/${MySQLDB}?characterEncoding=utf8"$, MySQLUSR, MySQLPW)
End Sub
How can I know if I'm connected? Do I need to request a connection right after Initialize?
B4X:
Sub Connect
Pool.Initialize("com.mysql.jdbc.Driver", _
$"jdbc:mysql://${MySQLHost}:${MySQLPort}/${MySQLDB}?characterEncoding=utf8"$, MySQLUSR, MySQLPW)
Pool.GetConnectionAsync("IsConnected")
End Sub
Private Sub IsConnected_ConnectionReady (Success As Boolean, SQL As SQL)
If Success Then
log("Connected")
Else
Log("Not Connected")
End If
SQL.Close
End Sub
Thank you for your help.