Tuesday, January 17, 2012

How can I Write data that comes from database in to different multiple csv files in java ?

Create an int counter that you increment in your rs.next() while loop. Whenever it gets to 100 flush your file stream, and create a new one, then reset the counter to 0. Or, you could just leave the counter alone and do a counter/100 to know what file number you're on.

0 comments:

Post a Comment