File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes XML String to CLOB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "XML String to CLOB" Watch "XML String to CLOB" New topic

XML String to CLOB

Ram Krish

Joined: Nov 30, 2004
Posts: 23

Can somebody tell me how to go about converting a xml string to clob ? I need to save the same in oracle db.


Thanks,<br />Ram<br />SCEA-1,SCBCD,SCJP 1.4
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33132

You can write the String to a CharacterStream and use that setter method on the Statement.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeffrey Spaulding
Ranch Hand

Joined: Jan 15, 2004
Posts: 149
If i remember right you can use it as simple String assignmenzt, as long as its not larger than 32,768 Chars.

From then on you have to use the stream methods.

...but i may be wrong ( as so often, sigh )

Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
I agree. Here's the link:
subject: XML String to CLOB
It's not a secret anymore!