ResultSet rs1 = null;
Vector v3 = new Vector();
String sqll = "select * from Lims_YPFX_ItemRecord";
rs1 = tongyu.executeQuery(sqll);//查询
 while(rs1.next())
{
CLOB lob_loc = ((OracleResultSet)rset).getCLOB (1);
int len =(int)lob_loc.length ();
itemconclu = lob_loc.getSubString(1,len);
 v3.addElement(itemconclu);
}
String[]  s3 = new String[v3.size()];
 v3.copyInto(s3);
你这样取clob,应该就没有问题了。

解决方案 »

  1.   

    我把你的代码是了一下,但出现了以下的错误提示:
    .jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    D:\tomcat\work\localhost_8080%2FLIMS\_0002fYPFX_0002ftongyu_0002fypfxrecord_0002ejspypfxrecord_jsp_23.java:125: Class YPFX.tongyu.OracleResultSet not found.
                      Clob  lob_loc = ((OracleResultSet)rset).getCLOB (1);
                                        ^
    D:\tomcat\work\localhost_8080%2FLIMS\_0002fYPFX_0002ftongyu_0002fypfxrecord_0002ejspypfxrecord_jsp_23.java:125: Undefined variable: rset
                      Clob  lob_loc = ((OracleResultSet)rset).getCLOB (1);
                                                        ^
    D:\tomcat\work\localhost_8080%2FLIMS\_0002fYPFX_0002ftongyu_0002fypfxrecord_0002ejspypfxrecord_jsp_23.java:127: Incompatible type for =. Can't convert java.lang.String to java.sql.Clob.
                     itemconclu = lob_loc.getSubString(1,len);
     我不是很明白,能再帮我一次吗?
    还有CLOB lob_loc = ((OracleResultSet)rset).getCLOB (1);
    为什么是 (1);呢?
      

  2.   

    你要导入这两个包
    import oracle.jdbc.driver.*;
    import oracle.sql.*;Clob  lob_loc = ((OracleResultSet)rs1).getCLOB ("ITEMCONCLU");
    int len =(int)lob_loc.length ();
    String itemconclu = lob_loc.getSubString(1,len);CLOB lob_loc = ((OracleResultSet)rset).getCLOB (1);
    因为select取的第一个字段是clob字段。
      

  3.   

    还是有点问题
    D:\tomcat\work\localhost_8080%2FLIMS\_0002fYPFX_0002ftongyu_0002fypfxrecord_0002ejspypfxrecord_jsp_23.java:135: Incompatible type for =. Can't convert java.lang.String to java.sql.Clob.
                     itemconclu = lob_loc.getSubString(1,len);
    我还应该做些什么呢?
      

  4.   

    有没有.toString();
    有的话就好了
      

  5.   

    itemconclu = lob_loc.getSubString(1,len);
    这里的itemconclu 是不是在前面定义成Clob了?
    如果是的话,换个名字
      

  6.   

    我都想要放弃了
    拿出最后一着:把它换成String型