Add database access

Open and close the database, creating the directory if necessary.

Signed-off-by: John Else <john.else@citrix.com>