I\'m using opencsv and want to write to a .csv file through multiple sessions.
However every time I start a new CSVWriter the old file gets erased.
Can I change
This is possible with OpenCSV, please have a look at the below example to append resultset to the existing csv file.
CSVWriter writer = new CSVWriter(new FileWriter(fileName.concat(".csv"), true), ',');
writer.writeAll(resultSet, true);
The second parameter to the FileWriter constructor is bool to open a file in append mode.
FileWriter(String fileName, boolean append)