generic class for a database connection