那个源文件可以直接使用,只要去Oracle网站http://www.oracle.com下载一个Oracle9i的class12.zip的驱动文件就可以了。

解决方案 »

  1.   

    你理解错我的意思了,我现在有Oracle的驱动,只是我不会将Oracle中blob类型的数据显示到浏览器中
      

  2.   

    你那blob是存放的什么类型文件?
      

  3.   

    BLOB blob = null;
      String strLength="";
                while (rset.next()) {
                    blob = ((OracleResultSet) rset).getBLOB(1);
                    strLength=blob.length());
                }
    再弄个file文件存放它,这个就需要知道你的是什么类型的了,最后再显示文件。File binaryFile = new File("c:\\xxxxx.xxx");
    FileInputStream instream = new FileInputStream(binaryFile);
                OutputStream outstream = blob.getBinaryOutputStream();
                int chunk = blob.getChunkSize();
                byte[] buffer = new byte[chunk];
                int length = -1;
                while ((length = instream.read(buffer)) != -1)
                    outstream.write(buffer, 0, length);
                instream.close();
                outstream.close();
      

  4.   

    打开数据库,使用
    if (rs.next())
    {
    in = rs.getBinaryStream("logo");
            response.setContentType("这里写类型,如image/jpeg");
            sop = response.getOutputStream();
    int len;
    byte[] buf = new byte[1024];
    while ((len = in.read(buf, 0, 1024)) != -1)
    {
    sop.write(buf, 0, len);
    }
    }