Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Generating flat file from Database  RSS feed

 
J Dan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok... I'm trying to pull information from a database, concatenate (sp?) it and throw it into a flat (text) file as one line per record. Currently, to check my program I use a system.out.println() to make sure I'm pulling and putting together the proper stuff. Yep, that works, goes through the entire database table and it's fine. However, whenever I go to check my text file I created, it only has 1 record, the last one. I'm just about going to lose it... I've tried printwriters, bufferedwriters, and about 5 other things. It just keeps overwriting (I suppose) the previous line with each new line (yep, used line seperators and newline both to no avail) instead of placing a carriage return or other seperation device. Any help would be appreciated.
 
Colin Humber
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know if you've already tried this, it may help.
FileWriter(String fileName, boolean append)
Constructs a FileWriter object given a file name with a boolean indicating whether or not to append the data written.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!