code: int print(ResultSet rs, DispatchCallback callback) throws SQLException {
      String format = getOpts().getOutputFormat();
      OutputFormat f = getOutputFormats().get(format);
      if ("csv".equals(format)) {
        final SeparatedValuesOutputFormat csvOutput =
            (SeparatedValuesOutputFormat) f;
        if ((csvOutput.separator == null && getOpts().getCsvDelimiter() != null)
            || (csvOutput.separator != null
                && !csvOutput.separator.equals(getOpts().getCsvDelimiter())
                || csvOutput.quoteCharacter
                    != getOpts().getCsvQuoteCharacter())) {
          f = new SeparatedValuesOutputFormat(this,
              getOpts().getCsvDelimiter(), getOpts().getCsvQuoteCharacter());
          Map<String, OutputFormat> updFormats =
              new HashMap<>(getOutputFormats());
          updFormats.put("csv", f);
          updateOutputFormats(updFormats);
        }
      }
  
      Rows rows;
      if (getOpts().getIncremental()) {
        rows = new IncrementalRows(this, rs, callback);
      } else {
        rows = new BufferedRows(this, rs);
      }
  
      return f.print(rows);
    }
docs: /////////////////////////////////////