Connect to the database