File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes XML String to CLOB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "XML String to CLOB" Watch "XML String to CLOB" New topic
Author

XML String to CLOB

Ram Krish
Greenhorn

Joined: Nov 30, 2004
Posts: 23
Hi,

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

thanks
ram


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

Joined: May 26, 2003
Posts: 30116
    
150

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


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, 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 )

J.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
http://forum.java.sun.com/thread.jspa?threadID=349880&start=15
http://forum.java.sun.com/thread.jspa?threadID=521792&tstart=105
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML String to CLOB
 
Similar Threads
conversion between CLOB/BLOB and String
Uploading xml to database
Type conflict while saving XML
string to clob without database connection
Callable statement return xml result