Skip to content
Advertisement

Write ResultList from DB into a CSV file in Java

I need to write my query.getResultList() into a .CSV file.

I call the query over this:

JavaScript

and the Namequery just do SELECT * FROM TABLE, the result of query.getResultList() looks like this:

JavaScript

I can’t use OpenCSV.

The CSV file needs to have headers.

Advertisement

Answer

You can use something like

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement