implementing db class