Check whether the db exist before connecting to it