Sub Process_Globals
Dim MySQL As SQL
End Sub
#AdditionalJar: mysql-connector-java-5.1.27-bin.jar
Sub AppStart (Args() As String)
MySQL.Initialize2("com.mysql.jdbc.Driver","jdbc:mysql://localhost/database?characterEncoding=utf8","usenrame","password")
StartMessageLoop
End Sub
Sub RunMe
Dim SenderFilter As Object = sql.ExecNonQueryBatch("SQL")
Wait For (SenderFilter) SQL_NonQueryComplete (Success As Boolean)
Log("NonQuery: " & Success)
End Sub
Sub AddEvent(table As String, event As String, eventid As String)
MySQL.AddNonQueryToBatch("INSERT INTO `" & table & "_events` (time,event,eventid) select ?, ?, ? WHERE Not EXISTS(SELECT 1 FROM `" & table & "_events` WHERE event = ?)", Array(DateTime.now, event.Trim, eventid.trim, event.Trim))
End Sub