0

Is there a way or a function in java where java can create several xml documents for each customer that i am queering from a sql db?

PreparedStatement statement = connection.prepareStatement("SELECT (sqlstuff), (sqlstuff) , (sqlstuff) , (sqlstuff) , (sqlstuff) ,(sqlstuff) , (sqlstuff) , " + "(sqlstuff) , (sqlstuff) , (sqlstuff) , (sqlstuff) , (sqlstuff) , (sqlstuff) , (sqlstuff) , (sqlstuff#), (sqlstuff#) OST00008 FROM filetype");

  ResultSet resultSet = statement.executeQuery();

2 Answers 2

2

I suggest you this clean way:

  • Define your Customer class in java
  • Create a list of Customer from database rows
  • Convert your list of Customer in xml (using Jaxb for example)
Sign up to request clarification or add additional context in comments.

Comments

0

The easiest thing I've found was to use an ORM tool like Hibernate to map the objects into a database for me, and then use JAXB as well. I'd put the Hibernate annotations on the object's fields, and the XML annotations on the object's property getters, and I had to write almost no serialization code for either, only what was required to integrate with the two frameworks.

Comments

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.