0

Is there a framework current out there that allows you to take MYSQL query output and convert it all into XML?

3 Answers 3

1

Two completely separate problems: querying a database and serializing to XML. Treat them separately and you'll have better luck.

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

Comments

1

If you are dealing with plain Java objects, you could use XStream. So you would need to get the JDBC result set into some plain java object and then serialize it to XML using this.

http://x-stream.github.io/

Comments

0

Do you mean something like this:

 echo 'SELECT * FROM INFORMATION_SCHEMA.TABLES' | mysql --xml

yields:

 <resultset statement="SELECT ....">
   <row>
     <field name="TABLE_NAME">CHARACTER_SETS</field>
     ...
   </row>
 </resultset>

If you want to do it with Java, you could try javax.sql.rowset.WebRowSet.writeXml(ResultSet, Writer). Unfortunately, i don't know of any other implementations than Sun-specific com.sun.rowset.WebRowSetImpl

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.