commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Stewart (JIRA)" <>
Subject [jira] [Created] (CSV-138) CSVPrinter.printRecords(ResultSet) skips first row with SQLServer
Date Tue, 28 Oct 2014 02:16:33 GMT
Alan Stewart created CSV-138:

             Summary: CSVPrinter.printRecords(ResultSet) skips first row with SQLServer
                 Key: CSV-138
             Project: Commons CSV
          Issue Type: Bug
          Components: Printer
    Affects Versions: 1.0
            Reporter: Alan Stewart

WIth SQLServer's 2012 jdbc driver 4.0, when I call CSVPrinter#printRecords with a java.sql.ResultSet,
the first row is not printed. It appears that the line
final int columnCount = resultSet.getMetaData().getColumnCount();
positions the cursor on the first row and then when
 while ( { ...
is called, the 2nd row onwards is what is getting outputted.

As a workaround, I used :
                   do {
                        final int columnCount = rs.getMetaData().getColumnCount();
                        for (int i = 1; i <= columnCount; i++) {
                    } while (;

This message was sent by Atlassian JIRA

View raw message