user1127214
user1127214

Reputation: 3177

Loading data from XML file into table using java

I have data in a XML file. The format of the XML file is like this

Code:

<employees>
<employee>
<name>rgoti</name>
<empno>2</empno>
….
….
<employee>

<employee>
<name>sganee</name>
<empno>3</empno>
….
….
<employee>

….
….
</employees>

I want to load this data into the Oracle database using Java.How to design and create table and data types for saving this xml in table?.

Upvotes: 0

Views: 1300

Answers (1)

Luca
Luca

Reputation: 4273

Your question is too generic to gather a good answer. Common steps:

  • define your employee table with an unique primary key
  • define your employee class in java
  • convert your xml in your java model (for example using jaxb)
  • persist your model (with prepare statement or batch or persistence framework).

Upvotes: 2

Related Questions