Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> JDBC-Bug (Stream.available)

JDBC-Bug (Stream.available)

From: Michael Skusa (work) <2skusa_at_informatik.uni-hamburg.de>
Date: Thu, 22 Oct 1998 12:03:44 +0200
Message-ID: <362F0300.433C@informatik.uni-hamburg.nospam.de>


Hi !

I am using Oracle's thin JDBC driver to access Oracle databases. My application includes the reading of BLOBs, so I have to retrieve them using the getBinaryStream() method of ResultSet. To detect the end of the stream I tried to use the available() method of the stream which should return the number of bytes which can be read without blocking. So when this method returns 0, my application stops reading from the stream.

Unfortunately the available() method returns NOT the number of bytes available. Some numbers are returned, but the first appearance of 0 does not necessarily indicate the end of the stream. So my application stops reading too soon.

Has anybody else had this problem as well ? Will Oracle fix this error in future versions of its thin JDBC driver (or is it already fixed) ?

My current workaround is that I do not use the JDBC functions that expect a number of bytes to read, but those that read as many bytes as possible into a fixed size buffer and which return the number of bytes successfully read afterwards.

But for future applications I'd like to determine the number of bytes available in advance.

Greetings,

Michael Skusa

mailto:2skusa_at_informatik.uni-hamburg.nospam.de

(* remove .nospam from mailaddress for replies via mail *) Received on Thu Oct 22 1998 - 05:03:44 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US