private String getUrlToUse(String urlParam) {
    boolean useIndirectUrl = false;
    // If the url passed to us is a valid url with a protocol, we use it as-is
    // Otherwise, we assume it is a name of parameter that we have to get the url from
    try {
      URI tryParse = new URI(urlParam);
      if (tryParse.getScheme() == null){
        // param had no scheme, so not a URL
        useIndirectUrl = true;
      }
    } catch (URISyntaxException e){
      // param did not parse as a URL, so not a URL
      useIndirectUrl = true;
    }
    if (useIndirectUrl){
      // Use url param indirectly - as the name of an env var that contains the url
      // If the urlParam is "default", we would look for a BEELINE_URL_DEFAULT url
      String envUrl = beeLine.getOpts().getEnv().get(
          BeeLineOpts.URL_ENV_PREFIX + urlParam.toUpperCase());
      if (envUrl != null){
        return envUrl;
      }
    }
    return urlParam; // default return the urlParam passed in as-is.
  }
Connect to the database defined in the specified properties file.
beeline/src/java/org/apache/hive/beeline/Commands.java