SriKanth
SriKanth

Reputation: 1

Java object to delimited file conversion

Anyone, kindly tell how to convert a java object or an array of objects to delimiter, fixedlength & unedifact file formats. the object may contain childs also.

Upvotes: -1

Views: 1010

Answers (1)

Dennux
Dennux

Reputation: 240

OpenCsv (http://opencsv.sourceforge.net/) is very good to write POJOs to csv Files (Csv means comma separated values, but you can set almost any delimiter you want). OpenCsv even has Samples how to write a jdbc ResultSet into a csv file.

Maybe if you need the db data as Java-Objects, too, you might want to use JPA to load the entities and use OpenCsv to write it as a csv (it works well with annotations).

Upvotes: 0

Related Questions