Is there a framework current out there that allows you to take MYSQL query output and convert it all into XML?
3 Answers
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.
Comments
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