Connecting to and disconnecting form the database.