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 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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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 !!!