2

I need to read every row of a particular table stored in a mysql DB, then i have to write an xml file extracted from each row. Which is the best practice for obtaining this target? I should use some java libraries, but i don't know how to choose the exact ones.

0

1 Answer 1

1

look at this:

http://examples.javacodegeeks.com/core-java/xml/bind/jaxb-marshal-example/

From the DB if you use an ORM like hibernate or other you will get your rows as objects and then you can transforme them using JAXB.

Sign up to request clarification or add additional context in comments.

3 Comments

you have many possibilities, either create a JPA entities that describe your DB or use a hibernate ResultTransformer look at this issue stackoverflow.com/questions/3266492/…
Thank you jMounir, so now i install hibernate and with ResultTransformer I turn my row in objects, and then i have to marshall this objects in xml file. Is it right?
Yes, that's right. if you mean by "install hibernate" that you're going to configurate it (add depndency and create persistence.xml file)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.