aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
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: 8919

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


Groovy
 
jQuery in Action, 2nd edition
 
subject: How do I write a String to a java.sql.Clob