import oracle.sql.CLOB;
import oracle.jdbc.OracleResultSet;      CLOB clob=((OracleResultSet)rs).getCLOB("xml");
      long length = clob.length ();
      char ac[] = new char[200];
      int i=0;
      StringBuffer strPp_content =new StringBuffer();
      if (length>0){
        Reader char_stream = clob.getCharacterStream();
        while((i = char_stream.read(ac, 0, 200)) != -1) {
          strPp_content.append(ac, 0, i);
        }
      }

解决方案 »

  1.   

    谢谢楼上的兄弟,但是那样还是不可以,我发现这样就可以了
    while (rs.next())
                   {
                        String str_reportno = "E"+rs.getString("reportno");
                        String str_xml = "";
                        String str_xslt = "";
                        oracle.sql.CLOB clob_xml = (oracle.sql.CLOB)rs.getClob("xml");
                        //====get xml
                        //modify by barry xue 20030521
                        if (clob_xml != null)
                        {
                              int length_xml = (int)clob_xml.length();
                              long pos = 1;
                              while ( pos< length_xml)
                              {
                                    int len = (pos +1024 >length_xml ? length_xml-(int)pos+1 : 1024);
                                    str_xml += clob_xml.getSubString(pos,len);
                                    pos += 1024;
                              }
                        }