please use rs.getBlob(1) instead of rs.getBytes(1)

解决方案 »

  1.   

    对啊,使用rs.getBytes(1)没错
    但是可不可以使用下面的办法呢?
    Blob blob = rs.getBlob( 1 );
    byte[] b = blob.getBytes( 1, (int)blob.length() );
      

  2.   

    E:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\Help\jdbcsupp11.html 你看看这个文件,因为sql server2000的MS的JDBC驱动不支持,getBlob()方法。
    Blob getBlob (int)  2.0 Core  No  Throws "unsupported method" exception.  
    Blob getBlob (String)  2.0 Core  No  Throws "unsupported method" exception. 
      

  3.   

    我用同样的代码是没有问题的,我用的是MySQL,不是SQL Server,可能是你的数据库驱动有问题。