• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

inserting xml string into oracle database

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

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.

Praveen kumar
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Urgency huh! Great.

So what's your design philosophy ?

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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI madhav,

Hi all

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.

Hoping for a faster response

Thanking u in advance

Regards
Praveen Kumar.A

pra_master@yahoo.co.in
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Praveen,

I am wokring on similar problem as yours.
However we do not have Java environment. I am using plsql procedure and use DBMS_XMLSAVE procedure as we have Oracle 9.2

Let me know if it something you are intrested in or are you looking for Java solutions only.

Thanks!
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Praveen,

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic