How to serialize object to CSV file?

前端 未结 8 1283
执念已碎
执念已碎 2020-11-27 17:14

I want to write a Object into CSV file. For XML we have XStream like this
So if i want to convert object to CSV do we have any such library ?

EDIT: I w

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 17:53

    For easy CSV access, there is a library called OpenCSV. It really ease access to CSV file content.

    EDIT

    According to your update, I consider all previous replies as incorrect (due to their low-levelness). You can then go a completely diffferent way, the hibernate way, in fact !

    By using the CsvJdbc driver, you can load your CSV files as JDBC data source, and then directly map your beans to this datasource.

    I would have talked to you about CSVObjects, but as the site seems broken, I fear the lib is unavailable nowadays.

提交回复
热议问题