#Lines starting with '#' are comments.
#Backslash character at the end of line means that the command continues in the next line.
#MySQL Server
DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mysql://localhost/harris?characterEncoding=utf8
#JdbcUrl=jdbc:mysql://localhost/home/harris/b4a-rdc/jdbc_driver?characterEncoding=utf8
#SQL Server
#DriverClass=net.sourceforge.jtds.jdbc.Driver
#JdbcUrl=jdbc:jtds:sqlserver://<database server ip>/<database>
# MySQL DB username and password
User=harris
Password=xyZ1234
# the port used
ServerPort=17178
#If Debug is true then this file will be reloaded on every query.
#This is useful if you need to modify the queries.
Debug=true
#commands
# these ones inserts a record. You need to specify which fields receive the param values in the correct order.
sql.load_mast=INSERT INTO loadmast (mastid,loadtype,acttype,recdate,drvid,trkid,trl1id,trl2id,trl3id,load_dur,wait_dur,rectype,lat,lon,place,compid,sent,odom,fuel,sourceid,swver,comment) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
sql.load_det=INSERT INTO loaddet (mastid,ival1,ival2,ival3,sval1,sval2,sval3,dval1,dval2,compid) VALUES (?,?,?,?,?,?,?,?,?,?)
sql.event_mast=INSERT INTO eventmast (mastpk,sdate,edate,evtviol,evtzone,evttype,drvid,trknum,sodo,eodo,ival1,ival2,sval1,sval2,dval1,dval2,compid,sent,lat,lon,location,spare,sourceid,swver,comment) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# this one gets a count of records to determine if anything has been updated since last check.
sql.get_zone_upd=SELECT COUNT(*) AS num FROM zonemast where UNIX_TIMESTAMP(updated) > ? and comp_id = ?
# if the above count was > 0, then let us update the device with new configuration data...
# since these tables are small (100 records or so), I empty the table on the device and get everything from the server.
# I find this much easier than trying to determine what was edited, what is new and what was deleted.
# also, all configuration stuff should be handled on the server and distributed to devices. Devices collect data based on configs and pass it back to server.
sql.get_zonemast=SELECT pk, mastpk, name, speed, stype,s1,s2,s3,s4,s5,s6,d1,d2,t1,t2,comment,active FROM zonemast where comp_id = ?
sql.get_zonedet=SELECT pk, mastpk, lat, lon FROM zonedet where comp_id = ?