Enforce check on database connection before doing anything.

On databases behind a firewall or too far from geoNetwork, sometimes this is needed.