首先insert一个empty_clob() if ((m_CSWJZW!=null)&&(m_CSWJZW.length()!=0)){
StringBuffer sql = new StringBuffer("select CSWJZW from JWCSWJ where CSWJBH='"+m_CSWJBH+"' for update");
Statement stmt1 = conn.createStatement();
ResultSet rs = stmt1.executeQuery(sql.toString());
if (rs.next()) {
oracle.sql.CLOB clob = (oracle.sql.CLOB)rs.getClob(1);
clob.putString(1, m_CSWJZW);
PreparedStatement pstmt = conn.prepareStatement("update JWCSWJ set CSWJZW=? where CSWJBH='"+m_CSWJBH+"'");
pstmt.setClob(1, clob);
pstmt.executeUpdate();
}
stmt1.close();
conn.commit();
}
StringBuffer sql = new StringBuffer("select CSWJZW from JWCSWJ where CSWJBH='"+m_CSWJBH+"' for update");
Statement stmt1 = conn.createStatement();
ResultSet rs = stmt1.executeQuery(sql.toString());
if (rs.next()) {
oracle.sql.CLOB clob = (oracle.sql.CLOB)rs.getClob(1);
clob.putString(1, m_CSWJZW);
PreparedStatement pstmt = conn.prepareStatement("update JWCSWJ set CSWJZW=? where CSWJBH='"+m_CSWJBH+"'");
pstmt.setClob(1, clob);
pstmt.executeUpdate();
}
stmt1.close();
conn.commit();
}
解决方案 »
- 怎么学JAVA
- 使用二级缓存MemCached的时候就会出现could not initialize proxy - no Session错误
- spring配置事务管理问题。。
- 用过 hibernate 一定要进
- [求助]从文件中提取字符串并进行统计
- 在ACTION中返回NULL,是否还需要ACTIONFORM?
- applet 嵌在jsp网页中,如何在applet中获得该网页地址,如http://202.121.88.121/cw.jsp
- 求助:java一个小程序?
- 高分求! IIS的FTP服务器,如果付权限可写,则匿名用户也可写;如果不可写,则操作员(Administrator)也不可写! 如何实现匿名用户只读
- jsp服务器classes访问错误问题
- session bean 中的 ejbRemove()方法
- 请问,要有哪些java基础才能开始学习EJB???谢谢!!!(急!!!)
对应类型不要用java.sql.Blob
用byte[] 类型,代替就没问题了public abstract byte[] getBlobValue();
public abstract void setBlobValue(byte[] blobValue);相关贴子
http://expert.csdn.net/Expert/topic/1235/1235304.xml?temp=.751034