Sub Class_Globals
Public pool As ConnectionPool, mysql As SQL
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
Try
pool.Initialize("com.mysql.cj.jdbc.Driver", "jdbc:mysql://localhost/test?characterEncoding=utf8", _
"xxxx", "yyyy")
Log("MySQL pool started")
pool.GetConnection.Close
Catch
Log("MySQL pool error")
ExitApplication
End Try
End Sub
Sub read(query As String) As ResultSet
mysql = pool.GetConnection
Dim RS As ResultSet
Try
RS = mysql.ExecQuery(query)
Catch
Log(LastException)
End Try
mysql.close
Return RS
End Sub