I have a program at the moment that links multiple SQL statements together in the form of a mapping. I then write this data to a file using FileWriter.
I was wondering if it is better to store the information from my SQL statements in a string buffer and then write directly to file, or, would it be best to write to a file line by line when necessary ?
I actually already write to the file using one string buffer but encountered a problem, the program would crash once the string buffer collected a value exceeding around 125000 characters.