Added database connection validation.