0

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?.

2
  • 1
    Are you closing the <employee> tag somewhere? Commented Apr 2, 2012 at 18:27
  • 4
    Do you want to store the entire XML document in a single column? If so, just use an XMLType column. Or do you want to parse the XML document and store the data in a relational table? If you want to store the data in a relational table, does the table already exist? Commented Apr 2, 2012 at 18:29

1 Answer 1

2

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).
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.