database class