wood burning stoves 2.0*
The moose likes JDBC and the fly likes How do I write a String to a java.sql.Clob Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How do I write a String to a java.sql.Clob" Watch "How do I write a String to a java.sql.Clob" New topic
Author

How do I write a String to a java.sql.Clob

Joseph Urbanek
Greenhorn

Joined: Sep 17, 2003
Posts: 3
How do I write a String to a java.sql.Clob, without using oracle.sql.CLOB and using java version 1.3.1
Tim Morrow
Greenhorn

Joined: Sep 17, 2003
Posts: 11
As I recall, Java 1.3.1 supports only JDBC 2.0 which doesn't provide a mechanism for creating a clob, only reading them.
Unfortunately you will have to use oracle.sql.CLOB.getCharacterOutputStream() to get a writer that will allow you to write to your clob.
Java 1.4 includes JDBC 3.0 which does provide Clob.setCharacterStream().
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/Readme.html


Groovy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I write a String to a java.sql.Clob
 
Similar Threads
Converting Java String to Oracle Clob.
How to convert "java.sql.Blob" object to "java.sql.Clob" object?
Java program to Convert java.lang.String to java.sql.CLOB Object
How to insert CLOB object into DB?
CLOB ClassCastException