wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes The question about CLOB serialize? Thank you !!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "The question about CLOB serialize? Thank you !!!" Watch "The question about CLOB serialize? Thank you !!!" New topic
Author

The question about CLOB serialize? Thank you !!!

Mo Jialin
Greenhorn

Joined: Apr 24, 2003
Posts: 1
parameter explain:
* Connection conn, : connection
* String atable : table name
* String alobcol : the CLOB name in table
* String acondition, : the condition that didn't include 'Where'
* String acontent : the content that I want to insert

the code I have writed as follow:
***************************************************
try {
//conn.setAutoCommit(false);
// at first ,set sql's value = 'null'
sql = "update " + atable + " set " + alobcol + " = empty_clob() where " +
acondition;
stmt = conn.createStatement();
stmt.executeQuery(sql);
stmt.close();
sql = "select " + alobcol + " from " + atable + " where " + acondition +
" for update";
stmt = conn.createStatement();
rset = stmt.executeQuery(sql);
if (rset.next()) {
oracle.sql.CLOB clob = (oracle.sql.CLOB)rset.getClob(1);
clob.putString(1, acontent);
psql = "update " + atable + " set " + alobcol + "=? where " +
acondition;
pstmt = conn.prepareStatement(psql);
pstmt.setClob(1, clob);
pstmt.executeUpdate();
}
conn.commit();
}
*****************************************************

My application server is weblogic. after I have run this program,some error information were displayed as follow
*****************************************************
:::java.sql.SQLException: cann't save big text field! weblogic.jdbc.rmi.SerialOracleClob
(declare:a empty clob has been inserted in the data table )
->big moose saloon
*****************************************************
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The question about CLOB serialize? Thank you !!!
 
Similar Threads
How to update clob field in oracle
an example to insert data into Oracle Clob
help: lock problem during Clob update
updating a CLOB field using oracle
BLOB