added the database connection and error handle
created a view and database testing for entry and retrieval