#62 CSVWriter.writeAll()

closed-works-for-me
None
5
2011-06-06
2011-02-22
Anonymous
No

Hello.

Inside class CSVWriter, the method writeAll() is incorrect.

The while() cycle will not write the first line in a recordset.

Instead of:

while (rs.next())
{
writeNext( resultService.getColumnValues( rs ) );
}

It should be:

do
{
writeNext( resultService.getColumnValues( rs ) );
}
while( rs.next() )

Best regards,

@757, Nbk

Discussion

  • Scott Conway

    Scott Conway - 2011-04-07

    I created two unit test to check out multi line result sets with and without headers and the unit test pass. Make sure you are passing the correct boolean into the writeAll. if you call writeAll(resultSet, false) the first line is ignored and not printed (you are skipping the header line).

     
  • Scott Conway

    Scott Conway - 2011-04-07
    • assigned_to: nobody --> sconway
    • status: open --> open-works-for-me
     
  • Scott Conway

    Scott Conway - 2011-06-06
    • status: open-works-for-me --> closed-works-for-me
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks