没有人啊自己先顶一下!
我用的配置是win2000+Tomcat4.0+jsp+sql2000
UP!!!~~~~~~~~~

解决方案 »

  1.   

    如果你要读入aaa.gif图象,步骤如下:
    首先要知道图象文件所在的文件夹如:c:\images\aaa.gif,
    将文件名(aaa)保存到数据库里面(字段为images),
    Select出来......,
    调用:<img src="c:\images"+<%= rs.getString("images")%>+"gif">
      

  2.   

    这个吗我想要用到数据流了,IO(JAVA)
      

  3.   

    /**读取sqlserver数据库中的image字段的方法。
       *
       * @param f1
       */
      public void ReadImages()
      {
       ResultSet rs=null;
    //..........................    byte[] aa;
        try {
          aa = rs.getBytes("content");
          File file = new File("d://aa.jpg");
          FileOutputStream fout = null;
          fout = new FileOutputStream(file);
          fout.write(aa);
          fout.close();
        }
        catch (IOException ex) {
          ex.printStackTrace();
        }
        catch (SQLException ex) {
          ex.printStackTrace();
        }
      }  /**
       * 向sql server数据库中的image字段中插入一副图片。
       */
      public void insertImage()
      {
        long maxid=111;
        java.sql.PreparedStatement ps=null;
        //////////////
        String s = "bbbbbbbbbbbbbb";
        java.io.File file = new java.io.File("c://aa.jpg");      try {
            FileInputStream fin = new FileInputStream(file);        StringBufferInputStream in = new StringBufferInputStream(s);
            //InputString in=java.sql.Blob.getBinaryStream();
            String sql = "insert  into forum(id,title,content,authorid,upid,datetime) values(?,?,?,?,?,?)";
            // ps = con.prepareStatement(sql);
            ps.setLong(1, maxid);
            ps.setString(2, "标题是什么");
            ps.setBinaryStream(3, fin, (int) file.length());
            //....................
            ps.executeUpdate();
          }
          catch (SQLException ex) {
            ex.printStackTrace();
          }
          catch (FileNotFoundException ex) {
            ex.printStackTrace();
          }
        /////////////
      }
      

  4.   

    去下载一个文件上传,下载的程序www.jspsmart.com有什么问题可以email to me :[email protected]
      

  5.   

    <img width="200" height="200" src="../servlet/cn.com.xxcw.gncl.basicinfo.ShowImage?zbId=<%= zbId %>">
    其中ShowImage为一个servlet,它从数据库读出图像并形成OutputStream传给客户端