是不是因为你的content字段里有空行,br.readLine()== null,循环退出了?

解决方案 »

  1.   

    if (rs.next()) {
                    oracle.sql.CLOB myClob = (oracle.sql.CLOB) rs.getClob(clobColName);
                    content = myClob.getSubString((long)1,(int)myClob.length());
                }
      

  2.   

    String sql = "select content from table  where  id ='1'";
    rs = stmt.executeQuery(sql);
    if(rs.next()){ String ss="clob_message";
       
        CLOB clob = ((OracleResultSet)rs).getCLOB(1);
        clob.putString(1,ss);
        sql="update table set content=? where id='1' ";
        pstmt=con.prepareStatement(sql);
        pstmt.setClob(1,clob);
        pstmt.executeUpdate();
      
       con.commit();
       }