Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Type DBResult (Tag As Object, Columns As Map, Rows As List)
Type DBCommand (Name As String, Parameters() As Object)
Public const rdcLink As String = "http://localhost:17178/rdc"
End Sub
Sub GetChkOutId
Dim req As DBRequestManager = CreateRequest
Dim cmd As DBCommand = CreateCommand("sel_chk_id", Array(gtrndate, groute))
Wait For (req.ExecuteQuery(cmd, 0, Null)) JobDone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j, "req")
Wait For (req) req_Result(res As DBResult)
ckid = 1
'work with result
req.PrintTable(res)
Else
Log("ERROR: " & j.ErrorMessage)
End If
j.Release
End Sub
CONFIG:
#Lines starting with '#' are comments.
#Backslash character at the end of line means that the command continues in the next line.
#DATABASE CONFIGURATION
DriverClass=net.sourceforge.jtds.jdbc.Driver
JdbcUrl=jdbc:jtds:sqlserver://192.168.1.200/pan
User=sa
Password=Pupi911!
SERVERNAME=WIN2012-PAN\SQLEXPRESS ' not used?
PORTNUMBER=1433 ' not used?
DATABASENAME=pan ' not used?
SERVERTYPE=1 ' not used?
XAEMULATION=true
#Java server port
ServerPort=17178
#example of MS SQL Server configuration:
#DriverClass=net.sourceforge.jtds.jdbc.Driver
#JdbcUrl=jdbc:jtds:sqlserver://<server address>/<database>
#example of MYSQL Server configuration:
#DriverClass=com.mysql.jdbc.Driver
#JdbcUrl=jdbc:mysql://localhost/test?characterEncoding=utf8
#example of postegres configuration:
#JdbcUrl=jdbc:postgresql://localhost/test
#DriverClass=org.postgresql.Driver
#SQL COMMANDS
#sql.create_table=CREATE TABLE IF NOT EXISTS animals (\
# id INTEGER PRIMARY KEY AUTO_INCREMENT,\
# name CHAR(30) NOT NULL,\
# image BLOB)
#sql.insert_animal=INSERT INTO animals VALUES (null, ?,?)
#sql.select_animal=SELECT name, image, id FROM animals
sql.sel_chk_id=SELECT CheckOutDate, CheckOutId, Route \
FROM CheckOut WHERE CheckOutDate = ? AND Route = ?
sql.sel_chk_max= SELECT MAX(CheckOutId) AS CheckOutId \
FROM CheckOut WHERE CheckOutDate = ?
sql.ins_chk_id=INSERT INTO CheckOut (CheckOutDate, \
CheckOutId, Route, DriverId, UserId) VALUES (?, ?, ?, ?, ?)
sql.sel_chkdet=SELECT * FROM CheckOutDetail WHERE \
CheckOutDate = (?) AND CheckOutId = (?) AND ProductId = (?)
sql.upd_chkdet_sobra=UPDATE CheckOutDetail SET DriverID = (?), \
Sobra = (?) WHERE CheckOutDate = (?) AND CheckOutId = (?) \
AND ProductId = (?)
sql.upd_chkdet_stale=UPDATE CheckOutDetail SET DriverID = (?), \
Stale = (?) WHERE CheckOutDate = (?) AND CheckOutId = (?) \
AND ProductId = (?)
sql.ins_chkdet_sobra=INSERT INTO CheckOutDetail (CheckOutDate, \
CheckOutId, ProductId, DriverId, Sobra, Stale) VALUES (?, ?, ?, ?, ?, ?)
sql.ins_chkdet_stale=INSERT INTO CheckOutDetail (CheckOutDate, \
CheckOutId, ProductId, DriverId, Sobra, Stale) VALUES (?, ?, ?, ?, ?, ?)