This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes magic mySQL to XML piece??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "magic mySQL to XML piece???" Watch "magic mySQL to XML piece???" New topic
Author

magic mySQL to XML piece???

Chris Snapp
Greenhorn

Joined: Nov 14, 2003
Posts: 16
I'm about as green as you can get so I'm sorry if this is a well known issue (searching the web and forums hasn't gotten me anywhere).
My goal is to retrieve data from a mySQL database in XML format and allow this XML to be stored in a bean or sent back to the browser either raw or through a stylesheet transformation.
I figured the DB to XML jive was a pretty common issue, but I haven't been able to find any half-way straightforward explanation that I could get to work.
I had stumbled across "DB2XML" but for the life of me I couldn't figure out how to work the durn thing. (like I said....I'm still a newbie to JAVA)
Any help would be greatly appreciated.
-Thanks
Chris
cyril vidal
Ranch Hand

Joined: Jul 02, 2003
Posts: 247
Hi,
you may use mysqldump utilitary to do it automatically. by example:
C :\%mysqldump% -X test transactions > c :\resu.xml
will extract into resu.xml the table transactions from database test.
or you may find this tutorial interesting too:
using JDBC to extract data into XML
And because this forum deals with Servlet, and if you read french , you may want to have look to this article, that extracts data from a database with a servlet and outputs it in XML, HTML and finally SVG.
.Servlets, base de donn´┐Żes et SVG

Regards,
Cyril
[ November 16, 2003: Message edited by: cyril vidal ]

SCJP 1.4, SCWCD, SCBCD, IBM XML, IBM Websphere 285, IBM Websphere 287
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Moving from Servlets to... um... JDBC.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: magic mySQL to XML piece???