[ https://issues.apache.org/jira/browse/CSV-313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17888055#comment-17888055 ]
Gary D. Gregory commented on CSV-313: ------------------------------------- [~unitedmarsupials] Thank you for your suggestion. The patch breaks the build; you can see by running "mvn" from the command line. You cannot change the return value of this public method as it would break binary compatibility. Using a GitHub PR is the best way to propose code changes as running a PR build runs all of our checks. Run "mvn" on the command line before you push to check your work locally. You'll also want to provide unit tests to prove a patch does what it thinks it does. > 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. > Priority: Minor > Labels: easyfix > Attachments: printRecords.patch.txt > > > 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)