Reputation: 10586
Does anyone know good XML library for Java which I can use to write data extracted from database into XML format?
Upvotes: 1
Views: 446
Reputation: 1108537
Usually, those tools are already provided by the database itself. Check the "Export" section somewhere in their documentation. A more detailed answer can't be given since the DB vendor is unmentioned.
Regardless, if you insist in using Java for this (which may however be performance/memory hogging with large data), then you may find a Javabean-to-XML serializer useful, for example JAXB, XStream or XMLBeans.
Upvotes: 3
Reputation: 29381
Do you need to use a middle layer? "Most" DBMS have some XML functionality out of the box, like MySQL.
mysql -uroot --xml -e 'SELECT * FROM db.table ORDER BY field'
Upvotes: 1