I am developing a messaging application in xml is extensively used to transfer data between database, middle tier and client tier.
From client side I get xml string without any table names (its like xml document). I have to extract values w.r.t column names as tags from xml string and insert into Oracle database. Can anyone send a snippet of code or links to achieve this functionality, its bit urgent.
Do you plan to parse the XML document ? If its just a string then is it something that has delimiters ? (Comma seperated string, tab delimited string?)
If its XML, do you use Java parsers, C++ parsers ? If you could provide a bit more info, maybe someone can suggest a workable solution....from the way you posted, its a very open ended question and the possibilities are unlimited.
If you could provide some additional info.... Thanks.
I am developing a application. The architecture is as follows Client(Front End) : C# .NET Middle Tier : J2EE Backend : Oracle 9i
From client side I will get string which contains data in standard XML format. The String contains contains tablenames,column names and their corresponding values. I need to parse the XML String and extract the contents(columnn names and their values) and insert the values into the corresponding tables in the Oracle database.
Yes I have planned to parse the xml String using java parser.
NO,It's not a normal string,It's a normalised XML document in the form of a string.
Please send me how to go about it and if possible pls send the code snippet. It will be very helpful for me. It's bit Urgent.
I have the solution for you. The solution is you need to use Castor, Xerces jars. What actually needs to be done is that, you need to create an object map for the xml String. We can also say that, you need to create Castor Objects for the XML. Then you need to unmarshal the xml. When you unmarshal an xml, you will get the require data from it in the form of an attribute's value of a bean. So, you will be having table name, column name and also data to insert from the XML in your hands from these attributes' values. So, only insertion of data into database remains.
You please visit Exolab.org's Castor Home Page. There you will find the code for unmarshalling and marshalling, creation of Castor objects and lot more.
Anyway, I am here to help you in this regard.
Cheers,<br />Hemanth...<br />(When opportunity doesn't knock, build a door.)