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