I have a huge xml file. I need to convert the xml into java objects and persist the data in Database. It will be around 200k records. Planning to use jibx. Is it a right approach? If so can someone provide the steps to convert xml file to java objects and persist in database
Asked
Active
Viewed 425 times
1 Answers
0
I just finish a project to convert a huge Xml file. I use trang ( http://www.thaiopensource.com/download/ ) to generate an XSD file from the XML File. Then i use xjc on the xsd file to generate POJO objects then I use JAXB to load the xml file into memory then Hibernate to create the database and store the POJOs.

Pierre Jean
- 366
- 2
- 9
-
Which one of it should i download in the link provided above? – RK3 Jul 21 '15 at 05:32
-
Also i needed to know if you have loaded entire xml file into memory at one go or part by part. In my case i would have around 200,000 thousand entry – RK3 Jul 21 '15 at 07:21
-
I use the software include into trang-20030619.zip file. – Pierre Jean Jul 21 '15 at 09:15
-
I load the entire Xml file into memory. A Xml file is around 200Kb with 4000 tags loaded into 180 classes in 10 seconds. I decide to load everything because I have complex manipulation on data and I need the keep the structure of the Xml part. May be in your case, it will be to heavy for the memory. – Pierre Jean Jul 21 '15 at 09:23
-
To download trang just click on trang-20030619.zip file – Pierre Jean Jul 13 '16 at 14:00