Hi,
try casting ReslutSet to OracleResultSet, it gives you getBLOB()
method,
i always used it and always worked.:
BLOB blob = ((OracleResultSet) rset).getBLOB (1);
byte[] bytes = blob.getBytes (<begin index>, <length>);
Look at some examples here:
http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/htdocs/template
s.htm#LOBS
At the end, try adding Content-Length into response header.
Stefano
On 11 Giu, 11:31, "palak1...@gmail.com" <palak1...@gmail.com> wrote:
> Hi,
>
[quoted text clipped - 36 lines]
> Thanks,
> Palak
Lew - 11 Jun 2007 16:01 GMT
> Hi,
> try casting ReslutSet to OracleResultSet, it gives you getBLOB()
> method,
Please do not top post.
Is there a problem with using
<http://java.sun.com/javase/6/docs/api/java/sql/ResultSet.html#getBlob(java.lang.
String)>
?
> i always used it and always worked.:
>
> BLOB blob = ((OracleResultSet) rset).getBLOB (1);
Where should the OP find the BLOB type?
I would be astounded to find that there is such a type, or to discover that
there is a method OracleResultSet.getBLOB().
> byte[] bytes = blob.getBytes (<begin index>, <length>);
The OP might prefer
InputStream image = rset.getBlob(1).getBinaryStream();
which uses interfaces, so does not tie them down to just the Oracle
implementation, and avoids knowing /a priori/ the size of the image to
retrieve, and is somewhat more flexible than using getBytes() (the Blob
method, not the BLOB method).

Signature
Lew