• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

XML data to Oracle database

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic