tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vikram Reddy" <vikramreddy1...@gmail.com>
Subject Re: Read image from database
Date Wed, 11 Apr 2007 18:06:55 GMT
I think this should work :


            InputStream input = null;
           BufferedInputStream stream = null;
              BLOB blob = null;
              PrintWriter output = response.getWriter();

            if (res.next()) {
                              blob = ( (OracleResultSet)
rs).getBLOB("COLUMN_NAME");
                                input = blob.getBinaryStream();

                               stream = new BufferedInputStream(input);
                               int length = -1;
                               while ((length = stream.read()) != -1) {
                               output.write(length);
                               }
    }
     /* flush the contents to the output */
      output.flush();



On 4/11/07, Zilberstein Yuval <YUVALZI@pelephone.co.il> wrote:
>
> Hello,
> Can anyone tell me how do I read an image from a Blob field in the
> database?
>
> TX
> YuvalZ
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message