• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic