private static String getFormattedDb(HiveConf conf, CliSessionState ss) {
    if (!HiveConf.getBoolVar(conf, HiveConf.ConfVars.CLI_PRINT_CURRENT_DB)) {
      return "";
    }
    //BUG: This will not work in remote mode - HIVE-5153
    String currDb = SessionState.get().getCurrentDatabase();

    if (currDb == null) {
      return "";
    }

    return " (" + currDb + ")";
  }
Retrieve the current database name string to display, based on the
configuration value.
@param conf storing whether or not to show current db
@param ss CliSessionState to query for db name
@return String to show user for current db value
cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java