Using the database in the application