Added exit out of script if connection can't be established
Sometimes the connector does not connect to the DB on its first attempt.  Added retry handling.