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 Reverse engineers database into xml 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 "Reverse engineers database into xml" Watch "Reverse engineers database into xml" New topic

Reverse engineers database into xml

Vishwanath GNV

Joined: Sep 05, 2006
Posts: 6
Hi All,

I need to generate xml file from oracle database. I am looking for open source tool or something like code. So, that I would get some idea, based on them...

Please tell me, how handle this...ASAP
Vishal Matere
Ranch Hand

Joined: Jan 22, 2008
Posts: 81
XML file generation
Does this Help?

SCJP <br />SCWCD <br />SCBCD <br />SCEA-1
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704

It's a non-trivial topic, meaning you have to write a parser yourself. You can get tools that will try to auto-generate a database out of XML, but often the logical structure is lost. For example, you might use database normalization for efficient storage of column data, but in the XML you want these tables denormalized so that a record contains all of its information.

In short, there's no magic solution since database don't necessarily have relationships easily discovered by a general purpose parser. Besides, writing a program that reads a database and outputs XML is good practice and this way you'll have 100% control over how the data is structured in the XML for easy customization.
[ April 22, 2008: Message edited by: Scott Selikoff ]

My Blog: Down Home Country Coding with Scott Selikoff
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

One easy way is to use DBUnit through an ANT script. I'm not recommending it, just saying it is possible ( since DB Unit stores its info as XML)
It is sorta covered in the JavaRanch Style Guide.
subject: Reverse engineers database into xml