Here's a method I use to update Clob.
public void updateClob(
String updateString, int rowID, Connection con)
{
Statement stmt = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
Clob clob = null;
try
{
stmt = con.createStatement();
rs = stmt.executeQuery("SELECT CLOB FROM YOUR_TABLE WHERE ID =" + rowID + " FOR UPDATE OF CLOB");
if(rs.next())
{
clob = rs.getClob("CLOB");
}
OutputStream os = ((oracle.sql.CLOB) clob).getAsciiOutputStream();
byte[] b = updateString.getBytes("ASCII");
os.write(b);
os.flush();
os.close();
pstmt = con.prepareStatement("UPDATE YOUR_TABLE SET CLOB = ? WHERE ID = " + rowID);
pstmt.setClob(1, clob);
pstmt.executeUpdate();
}
catch(Exception e)
{
//log error
}
finally
{
try
{
pstmt.close();
rs.close();
stmt.close();
}
catch(Exception e)
{
//log error
}
}
}
[ September 16, 2002: Message edited by: Patrick McDowell ]