Re: Read image from database
"Vikram Reddy" <[email protected]>
| Newsgroups | gmane.comp.jakarta.taglibs.user |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> 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: [email protected]
> For additional commands, e-mail: [email protected]
>
>