Implements all methods to access to database