Hi while saving object by using openCsv the data getting stored in a single line and if i try to add more than one object the data getting deleted of the previous object. please if anyone knows the solution answer it here.
public final Logger log=Logger.getLogger("Error");
public void beanToCsvExport(final T object, final String filePath) {
if(object == null) {
log.warning("Initialization of object failed");
}else {
try {
Writer writer = new FileWriter(filePath);
StatefulBeanToCsv beanToCsv = new StatefulBeanToCsvBuilder(writer).build();
beanToCsv.write(object);
writer.close();
} catch (IOException e) {
System.out.println(e.getMessage());
} catch (CsvDataTypeMismatchException e) {
System.out.println(e.getMessage());
} catch (CsvRequiredFieldEmptyException e) {
System.out.println(e.getMessage());
}
}
}