With use of openCSV API, you can export your data in csv file.
CSVWriter writer = new CSVWriter(new FileWriter("yourfile.csv"), '');
Boolean includeHeaders = true;
java.sql.ResultSet myResultSet = .... //your resultset logic here
writer.writeAll(myResultSet, includeHeaders);
writer.close();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…