Jenny Jenny - 3 months ago 10
MySQL Question

MySQL Query to XML output

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

Answer

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