F
Fahd Shariff
Hello,
I have a reasonably large xml file which i need to parse and store into
an oracle database.
I am currently toying with 2 ideas:
1. Parse XML using a SAX parser. Map xml tags to database column names
and generate a prepared statement. Execute each one the normal JDBC
way.
2. Create an XSLT which converts the XML to a SQL script containing
lots of insert statements. Use Runtime.exec to run the script on oracle
using sqlplus.
The more I think about it, the more I prefer the second option. Would
it be faster? I guess the major overhead would be the Runtime.exec
call? The first option seems a bit messy...
Which would you use and why?
I have a reasonably large xml file which i need to parse and store into
an oracle database.
I am currently toying with 2 ideas:
1. Parse XML using a SAX parser. Map xml tags to database column names
and generate a prepared statement. Execute each one the normal JDBC
way.
2. Create an XSLT which converts the XML to a SQL script containing
lots of insert statements. Use Runtime.exec to run the script on oracle
using sqlplus.
The more I think about it, the more I prefer the second option. Would
it be faster? I guess the major overhead would be the Runtime.exec
call? The first option seems a bit messy...
Which would you use and why?