how to insert data from text files into database using xml?
1 posts in topic
Flat View  Flat View

Posted By:   Yogesh_Beri
Posted On:   Wednesday, April 25, 2001 02:20 AM

I get data in the form of text files in different formats. the data in these text files have to be inserted in the database.
the formats keep on changing. I want to design some application by the way of which i should write the new format in the xml file and the application should pick up the necessary data from the text files and insert the data into the database. how can i do this? or is there any other way?

Re: how to insert data from text files into database using xml?

Posted By:   Leonardo_Battagli  
Posted On:   Monday, April 30, 2001 02:25 AM

Lets' suppose your text files has this format





You need two files, the first is an XSL one that is used to go trough your data and add to it some information about your database name and table names.

the second is used to build a 'Map' object, you can see this is the file
that provides you a way to define a matching between the TAG in your DATA file and the COLUMN names in your DATABASE

Executing the libraries with this data files makes you insert 2 records in your database.

It's a good solution in our experience, being used both from servlets and applications

libraries source code: