This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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
 
Don't get me started about those stupid light bulbs.
 
subject: How do I write a String to a java.sql.Clob