OracleResultSet转换异常
java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingResultSet cannot be cast to oracle.jdbc.driver.OracleResultSet
本来是CLOB 与Clob的问题 ,也是不能转换,后来用了
if (rs.next()) {
// CLOB clob = rs.getClob(1);
CLOB clob = ((OracleResultSet)rs).getCLOB(1);
// clob.putString(1, StringUtils.htmlToText(Content));
clob.setString(1, StringUtils.htmlToText(Content));
String s3 = "update articles set content2=? where id=?";
pstmt2 = conn.prepareStatement(s3);
pstmt2.setClob(1, clob);
pstmt2.setInt(2, id);
pstmt2.executeUpdate();
conn.commit();
}
就有了上面的异常