I have this code below to write an information in the csv file, but every time I record something, what I have already written is lost. How do I add a line with the new information while retaining what I already have?
String fName = "cadastros.csv";
FileOutputStream fos = new FileOutputStream(fName);
PrintWriter pw = new PrintWriter(fos);
pw.println(request.getParameter("nome") + ";" + request.getParameter("email"));
pw.close();
fos.close();