private Properties parseURLforPropertyInfo(String url, Properties defaults) throws SQLException {
    Properties urlProps = (defaults != null) ? new Properties(defaults)
        : new Properties();

    if (url == null || !url.startsWith(Utils.URL_PREFIX)) {
      throw new SQLException("Invalid connection url: " + url);
    }

    JdbcConnectionParams params = null;
    try {
      params = Utils.parseURL(url, defaults);
    } catch (ZooKeeperHiveClientException e) {
      throw new SQLException(e);
    }
    String host = params.getHost();
    if (host == null){
      host = "";
    }
    String port = Integer.toString(params.getPort());
    if(host.equals("")){
      port = "";
    }
    else if(port.equals("0") || port.equals("-1")){
      port = Utils.DEFAULT_PORT;
    }
    String db = params.getDbName();
    urlProps.put(HOST_PROPERTY_KEY, host);
    urlProps.put(PORT_PROPERTY_KEY, port);
    urlProps.put(DBNAME_PROPERTY_KEY, db);

    return urlProps;
  }
Takes a url in the form of jdbc:hive://[hostname]:[port]/[db_name] and
parses it. Everything after jdbc:hive// is optional.

The output from Utils.parseUrl() is massaged for the needs of getPropertyInfo
@param url
@param defaults
@return
@throws java.sql.SQLException
jdbc/src/java/org/apache/hive/jdbc/HiveDriver.java