Blob my_blob = rs.getBlob("picture");试试

解决方案 »

  1.   

    if(rs.next()){
                  ServletOutputStream OP = response.getOutputStream();    
                  //输出二进制流
                  java.io.InputStream in=rs.getBinaryStream("PHOTO");
                  byte b[]=new byte[1000];
                  while(true){
                      int readLength=in.read(b);
                      if(readLength==-1)
                           break;
                      OP.write(b,0,b.length);
                  }
      

  2.   

    Compilation of 'C:\bea\wlserver6.1\config\mydomain\applications\hbsy\WEB-INF\_tmp_war_myserver_myserver_hbsy\jsp_servlet\_homepage\__showimage.java' failed:
    --------------------------------------------------------------------------------
     C:\bea\wlserver6.1\config\mydomain\applications\hbsy\WEB-INF\_tmp_war_myserver_myserver_hbsy\jsp_servlet\_homepage\__showimage.java:127: 'catch' without 'try'
    (No more information available, probably caused by another error)C:\bea\wlserver6.1\config\mydomain\applications\hbsy\WEB-INF\_tmp_war_myserver_myserver_hbsy\jsp_servlet\_homepage\__showimage.java:88: 'try' without 'catch' or 'finally'
    (No more information available, probably caused by another error)C:\bea\wlserver6.1\config\mydomain\applications\hbsy\WEB-INF\_tmp_war_myserver_myserver_hbsy\jsp_servlet\_homepage\__showimage.java:137: '}' expected
    (No more information available, probably caused by another error)
    --------------------------------------------------------------------------------
    Full compiler error(s):
    C:\bea\wlserver6.1\config\mydomain\applications\hbsy\WEB-INF\_tmp_war_myserver_myserver_hbsy\jsp_servlet\_homepage\__showimage.java:127: 'catch' without 'try'
                } catch (Exception __ee) {
                  ^
    C:\bea\wlserver6.1\config\mydomain\applications\hbsy\WEB-INF\_tmp_war_myserver_myserver_hbsy\jsp_servlet\_homepage\__showimage.java:88: 'try' without 'catch' or 'finally'
            try { // error page try block
            ^
    C:\bea\wlserver6.1\config\mydomain\applications\hbsy\WEB-INF\_tmp_war_myserver_myserver_hbsy\jsp_servlet\_homepage\__showimage.java:137: '}' expected
        }
         ^
    3 errors
    报错啦,我是新手,不知道怎么解决呀to  zzh9527(非凡) 
      你的名字zzh好像是我的一个朋友的,而你的9527又和我的95927有几分相像呀 hehe^^
      

  3.   

    <%
        int pictureId=param.getIntParameter(request,"picture_id",0);
        JdbcConnect myQuery=new JdbcConnect();
        ResultSet rs = myQuery.executeQuery("SELECT * FROM picture where picture_id="+pictureId);
           int length = 0;
    if(rs.next()){
                  ServletOutputStream OP = response.getOutputStream();    
                  //输出二进制流
                  java.io.InputStream in=rs.getBinaryStream("Picture");
                  byte b[]=new byte[1000];
                  while(true){
                      int readLength=in.read(b);
                      if(readLength==-1)
                           break;
                      OP.write(b,0,b.length);
                  }
       rs.close();
       myQuery.closeStmt();
       myQuery.closeConn();
      %>
      

  4.   

    以前写的那段代码在Tomcat+Oracle环境下运行良好可为什么在WebLogic+Oracle环境下就不行了呢????
      

  5.   

    Blob blob = rs.getBlob("content");
                    byte[] ab = blob.getBytes(1, (int)blob.length());
                    response.setContentType("image/jpeg");
                    ServletOutputStream op = response.getOutputStream();
                    op.write(ab);
                    op.flush();
                    op.close();
      

  6.   

    显示的问题解决了,谢谢大家的参于,但我正确的答案,你们说的都不大对哦 hehe^^我以前的程序在Tomcat下也是可以显示的,只是到WebLogic下才不行的,后来我在另一个论坛中有个“高”人告诉我在ServletOutputStream op = response.getOutputStream();之前加一句response.reset();就显示出来了 hehe^^ 真是就差这一点就要了我的命呀不过显示是没有问题,但,不能图片文字一起显示了!! 真#$%@#%&#*#&(@!!!ft~~~~
      

  7.   

    ok 终于解决 hehe^^
    哇哈哈哈,response.reset();关键的一句呀!!!!希望进入精华区!!对提供帮助的热心朋友们给热心分 hehe^^