Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to insert CLOB using PreparedStatement

73520Dec 23 2001
I am workding on a project using Oracle 8 database.
We need to store large amount of characters and we are palnning
to use CLOB to accomplish this.

If 'bio' is a CLOB field, how to I insert it?


String inssql =
"insert into emp (empid, name, dept, bio) "+
" values (?, ?, ?, ?)";
PreparedStatement pstmt = conn.prepareStatement(inssql);

pstmt.setInt(1, 123456);
pstmt.setString(2, "Bougnon Kipre");
pstmt.setString(3, "Rare Species Depatement" );
pstmt.setCLOB(4, XXXXX) ????? how do I do this?


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 31 2002
Added on Dec 23 2001
5 comments
1,121 views