0

I want to store data from a xml file to mysql.

My xml file is as follows:

<?xml version='1.0' encoding='ISO-8859-1' ?><data>
<ApplicantName>Test</ApplicantName>
<ExamName>Exam</ExamName>
<ContactNoPresent>9999999999</ContactNoPresent>
<Language>English</Language>
</data>

I tried the following:

load XML local infile 'D:\\a.xml' into table asdb.abc rows identified by '<ApplicantName>';

It works and inserts the Applicant name to the table. But I am not able to find how to store all the values from the xml to mysql table. Any help is highly appreciated.

Thanks.

1
  • I don't know dirty hacks to do it, however a cleaner approach would be to use JAX-RS to parse xml requests and persist it into an Object oriented database like hibernate comes for free. Commented Sep 6, 2013 at 11:24

1 Answer 1

1

It looks like your rows (in fact, the one an only row I can see in your XML stream) are actually identified by the <data> tag.

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.