public boolean getShowDbInPrompt() {
    if (beeLine.isBeeLine()) {
      return showDbInPrompt;
    } else {
      HiveConf conf = beeLine.getCommands().getHiveConf(true);
      return HiveConf.getBoolVar(conf, HiveConf.ConfVars.CLI_PRINT_CURRENT_DB);
    }
  }
In beeline mode returns the beeline option provided by command line argument or config file
In compatibility mode returns the value of the hive.cli.print.current.db config variable
@return Should the current db displayed in the prompt
beeline/src/java/org/apache/hive/beeline/BeeLineOpts.java