Mikhail T. created CSV-313:
------------------------------

             Summary: No way to obtain the number of rows written by 
CSVPrinter's printRecords()
                 Key: CSV-313
                 URL: https://issues.apache.org/jira/browse/CSV-313
             Project: Commons CSV
          Issue Type: Improvement
          Components: Printer
            Reporter: Mikhail T.


The {{printRecords(ResultSet)}} variant is very convenient for outputting _all_ 
of a query's results in a single line of code.

Unfortunately, this provides no way to obtain the number of records printed. 
See [this StackOverflow 
question|https://stackoverflow.com/questions/79071049/], for example.

A forward-only result-set is "done" after the method returns...

The simplest way to address this shortcoming would be for the 
{{printRecords()}} to start returning a {{long}} (for lack of {{{}size_t{}}}) 
instead of {{{}void{}}}, indicating the number of records printed.

This seems like an easy fix, for certainly the number of output rows is _known_ 
inside the method...



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to