class for database