@Override
    public void postHook(BeeLine beeLine) {
      String dbName = "";
      try {
        dbName = beeLine.getDatabaseConnection().getConnection().getSchema();
      } catch (SQLException e) {
        // unable to get the database, set the dbName empty
      }
      beeLine.setCurrentDatabase(dbName);
    }
We need to update some client side information after executing some Hive Commands
beeline/src/java/org/apache/hive/beeline/ClientCommandHookFactory.java