How to work with CLOB?
1 posts in topic
Flat View  Flat View

Posted By:   anu_pama
Posted On:   Wednesday, December 5, 2001 05:24 AM

I am getting error when i am trying to put XML document using CLOB type which is created in oracle from java.
Could you give some examples to store and also to retrieve the XML documents using CLOB type.

Advanced Thanks


Re: How to work with CLOB?

Posted By:   Bernie_Acs  
Posted On:   Wednesday, December 5, 2001 08:21 AM

If you are a registered user of Oracle Tech Net you can reference the documentation at Oracle8i Application Developer's Guide - Large Objects (LOBs)
Release 2 (8.1.6)
. If not you must first register at OTN Home Page before prceeding to the the docs. You will find in the Oracle documentation examples of both writting and reading CLOBs to and from the DB where the general mechanics will be create a row in your table using the PL/SQL function empty_clob() ro empty_blob() to populate the row with a valid LOB locator then to SELECT .. FOR UPDATE the locator form that row for modification.

In the recent question Labled blob you will find an example class source that demostrates the uploading of a file to a blob column in a fairly generic fashion, you could use the same basic maechanics by modifing the blob refs to clob, changing the setBinaryStream to setAsciiStream, of course modifing the connect mechanics to line up with your Oracle DB.


  • java.sql.Connection.setAutoCommit(false)

  • Handle abstract ResultSet elements involving piece-wise trasactions before other elements, if you do not the IO streams will be implictly closed

  • LOBs require special handling.

  • If you require a more specific assistance with your particular circumstances, show an example of the code producing the error and the error text generated and would be happy to try to help.
    About | Sitemap | Contact