Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML data to Oracle database

 
Vibha Verma
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am working on the problem which involves using DOM to parse XML file and then using JDBC store the relevant data in the Oracle database. First part of the problem is done - parsing the file. For the second part I am very confused as to how to go about it as XML is a hierarchical data and Oracle is a relational data. How can I do this mapping.

For example, my XML file looks like this
<my_info>
<name>
<first_name>...</first_name>
<last_name>...</last_name>
</name>
<age>... </age>
<address>...</address>
</my_info>

What I want to do is to create a table with the name - my_info and then create columns like first_name, last_name, age, address. But how do I handle the issue that the column name should be first_name and last_name and not name. In some other case I might need to have the column name to be name and not first_name and last_name. Is there somegeneral way to work on such type of problems.

Please help.
Thanks
Vibha.
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will this tutorials from IBM Using JDBC to insert data from XML into a database, Using JDBC to extract data into XML help you?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic