Skip to main content
. 2016 Dec 23;17(1):8. doi: 10.3390/s17010008
Algorithm 6 Database Access, Query and Writing Algorithm.
    1:  procedure WaitForRequest(DBReq)
    2:  if DBReq = Write then
    3:     WriteDB(DB);
    4:  else if DBReq = Query then
    5:     Query(DB,Cond);
    6:  else
    7:     TriggerException;
    8:  end if
    9:  end procedure
  10:  procedure WriteDB(DB,WindVector)
  11:  Con→ CreateDriver(); ▹ Create Database Driver
  12:  Con→GetDriverInstance(); ▹ Used to get the Driver Instance and Load the DB.
  13:  Con→setSchema(DB) ▹ Set the DB to write to
  14:  Stmt→WindVector
  15:  end procedure
  16:  procedure QueryDB(DB,Cond) State Con→ CreateDriver();
  17:  Con→GetDriverInstance();
  18:  Con→setSchema(DB);
  19:  execute;
  20:  stmt→executeQuery(Condition); ▹ See note below.
  21:  end procedure