定义的 clob 字段类型的数据,在编辑的时候只能增加文字,但不能删除原先内容中的部分文字,为什么?

解决方案 »

  1.   

    代码如下:jsp页面
    conn.setAutoCommit(false);
    Statement stmt = conn.createStatement();
    String strUpdate = "update news set news_title ='" + strTitle + "', " +
       "news_from = '" + strFrom + "', " +
       "pic_path = '"  + strPath + "' where news_id=" + intNewsId;
    stmt.executeUpdate(strUpdate);


    String strSelect2 = "select news_id,news_content from news where news_id =" + intNewsId;
    ResultSet rs = stmt.executeQuery(strSelect2);
    if(rs.next())
    {
      oracle.sql.CLOB clobtt = (oracle.sql.CLOB)rs.getClob("news_content");
      Writer wr = clobtt.getCharacterOutputStream(); 
      wr.write(strContent); 
          wr.flush(); 
          wr.close();
     // clob.putString(1, strContent);
    }
    conn.commit();
      

  2.   

    你去看看Writer这个类怎么用啊