Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes use of CLOB,help me. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "use of CLOB,help me." Watch "use of CLOB,help me." New topic
Author

use of CLOB,help me.

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I have a web based application that allows people to enter biographical info. The users should also be able to access their bio information and make changes. In order to present the data it must be a String.
I am using a database table that defines a bio field as a CLOB data type (Oracle 8i release 8.1.7). I retrieve the value from the database using the ResultSet method getClob storing it a Clob object.
I then convert it to a String object using the Clob method getSubString(). No problem! The problem comes when people try to create new records (INSERT) into the CLOB column and the length > 4000 characters.
I am currently just trying to insert the String value into the CLOB column. This works fine if the length < 4000, but if it is longer then an SQL exception is generated and the insert fails.
How can I convert the String object into a Clob object that can be written to the database?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: use of CLOB,help me.