This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 3753

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 ]

[OCA 8 Book] [Blog]
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)
I agree. Here's the link:
subject: Reverse engineers database into xml
It's not a secret anymore!