导出csv的jar包,common-csv-1.4
1.后台查询出数据集合List<Student>listdata
OutputStream os=new FileOutputStream("c://csv");
OutputStreamWriter ow=new OutputStreamWriter(os,"UTF-8");
CSVFormat format=CSVFormat.DEFAULT.withHader("列头1","列头2","列头3",......)
CSVPrinter p=new CSVPrinter(ow,format);
for(Student s listdata){
p.printRecord(
"\t"+"p.getAge()"+
p.getName(),
)
}