I'll be assuming the following:
- CSVWriter means au.com.bytecode.opencsv.CSVWriter, as part of opencsv
- WriteAll should be writeAll
What happens if you call csvWriter.flush() and, more importantly, csvWriter.close()? Since you should always close all your streams when you're done with them.
@Rob sorry it was my bad !
In my code it is writeAll . Still the records are not written on the file.
Is the syntax is wrong ? or whats the problem i did not getting.
why I am not able to flust the CSVWriter object ?
whereas Writer is getting flushed.
Can not get flush method for CSVWriter object.
Is there any specific reason for that?
Then there would have been an error message that tells you what went wrong; tell us what that was. Also tell us what command you used to compile the code. (If you're still using an IDE, make sure you understand where that IDE would put compiled class files, and check whether that's where they are.)
And just to make sure: You have checked that the class file didn't end up in a different subdirectory than you expected, right? Packages are involved, after all.
I just tried, and found that the following code compiles fine. It's the same you're using, minus any stuff that deals with classes that are not present; maybe you can work your way from there towards your code, and that way find out where the problem originates.