It's not a secret anymore!
The moose likes JDBC and Relational Databases 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 and Relational Databases
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: 8927

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


Groovy
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: How do I write a String to a java.sql.Clob
 
It's not a secret anymore!