database interface class