Hi all, I have an XML file and want to insert the data of the XML file in the MS SQL database.Now can I do that using parsers if yes then which parser? Please give me the links where I can get code for this or help. Thanks in advance Siri
I too have the same question, what is the best way to push data in to a database from an xml file.
until now I have been using dom parser to parse the xml document and then I put the data in a two dimensional array as name value pairs ,and then create SQL insert into queries from that two dimensional array.
As my XML files have started to become huge, this method is no longer viable as it is taking for ever to load the data in to the two dimensional array.
I am looking out for new and efficient methods of doing this.
One possible solution would be to use XSLTs to generate the SQL insert into queries directly. or May be break up the xml files in to smaller pieces and then follow my old procedure...
does any body know of a better way.. please advice..
Thanks in advance
Greg Schultz
Greenhorn
Joined: Oct 08, 2003
Posts: 16
posted
0
I am currently trying to use Mapforce from www.altova.com. It bascially loads an XML file into java classes that it generates based on a Mapping file that you create by tying XSD elements to Database Columns.
Thus far it is working great, but it is commercial.
Greg
Alexandru Popescu
Ranch Hand
Joined: Jul 12, 2004
Posts: 995
posted
0
Originally posted by sateesh arumbaka:
As my XML files have started to become huge, this method is no longer viable as it is taking for ever to load the data in to the two dimensional array.
Why do you need this intermediary step? Create a transaction, a preparedstatement and start inserting while parsing. If the parser craches you can rollback the transaction and everything is still oke.