Added method to initialize the database connection.