DB connection error when there is not db connection info on settings.php

Sometimes code exist but there is no db connection string on settings.php, so we can't connect to database. We need to consider this case and return environment default connection info.