Appending to a File

Hi,

I am writing to a file using the following:

try

{

outputFile = new File("C:\\ValidationReport.txt");

out = new FileWriter(outputFile);

}

catch(IOException ioe)

{

System.out.println("IOException reading request, ignored" +ioe.getMessage());

}

and also:

try {

out.write("\n" + "Date: " + sdf.format(cal.getTime())+ "\n" + "\t" + "UPDATE SUCCESSFUL"+"\n");

out.flush();

}

catch(IOException ioe)

{

System.out.println("IOException reading request, ignored" +ioe.getMessage());

}

It works but I need to append somewhere in the code instead of overwriting each time. Can someone tell me how to do this please - Thank you.

[761 byte] By [Nnm] at [2007-9-26 2:28:01]
# 1
create the filewriter with this constructor, with the 2nd parameter as true.FileWriter(String fileName, boolean append)
parthasarkar at 2007-6-29 9:43:06 > top of Java-index,Archived Forums,Java Programming...
# 2
Thanx
Nnm at 2007-6-29 9:43:06 > top of Java-index,Archived Forums,Java Programming...