'*******************************************
'*******************************************
' REQMANAGER JOBDONE - CENTRAL ROUTINE
'*******************************************
'here we return after reqManager has done
'its job
'*******************************************
Sub JobDone(Job As HttpJob)
If Job.Success = False Then
Log("Error: " & Job.ErrorMessage)
Else
Log("exporting/importing.....")
If Job.JobName = "DBRequest" Then
If Job.Tag = PerTag Then
Dim table As DBResult = reqManager.HandleJob(Job)
Dim LOM As List
Dim temp As Double
LOM.Initialize
For Each row() As Object In table.Rows
Dim m As Map
Dim i As Int
m.Initialize
i=0
For Each record As Object In row
m.Put(table.Columns.GetKeyAt(i),record)
i=i+1
Next
LOM.Add(m)
Next
Logd("got LOM permessi")
Log("Job Tag: " & Job.Tag)
TabUtils.EmptyPerdataloc 'now we can safely delete data from table
DBUtils.InsertMaps(SQL,"perdataloc",LOM) 'and put in new data
Log("finish local perdataloc")
End If
End If
Job.Release
End If
......
Sub Import 'this is where I make the call from timer (or from buttonclick, same result)
import_permessi("%")
End Sub
Sub import_permessi(Name As String)
CmdImp.Initialize
CmdImp.Name="select_permessi"
CmdImp.Parameters=Array As Object(Name)
Connect
reqManager.ExecuteQuery(CmdImp,0,PerTag)
End Sub
Sub EmptyPerdataloc
Dim query As String
query = "DELETE from perdataloc"
SQLX.ExecNonQuery(query)
End Sub
'this is the line in config of java server
sql.select_permessi=SELECT * FROM permessi
'the table has 70 fields of mixed varchar and integers