Added function to initialize the database connection