Subject | InputStream closes when prepared statement is closed. |
---|---|
Author | rajsubramani <rajsubramani@yahoo.co.uk> |
Post date | 2003-01-29T09:36:04Z |
I had posted this to the Firebird group but was asked to cross post
here as this is where the "Java Guru's" hang out. So Guruji's please help:
-----original post------
Hi,
I am using the JDBC driver (interclient.jar for jdk1.3) for Firebird
and noticed that when I extract a blob to an Inputstream, the stream
is closed when I close the PreparedStatement. For instance,
ptmnt = con.prepareStatement("Select foo from bar");
rs = pstmnt.executeQuery();
InputStream is = rs.getBinaryStream("foo");
rs.close();
pstmnt.close(); <---- At this point the InputStream "is" is also closed.
This does not happen with Oracle or IBM, so I have had to adjust the
server facade for Firebird so that the Object is deserialised before
the statement is closed.
I would rather hold on to the stream and deserialise when required.
Is there any particular trick in the book that I am missing (eg: wrong
driver?).
Much obliged.
Cheers
-raj
here as this is where the "Java Guru's" hang out. So Guruji's please help:
-----original post------
Hi,
I am using the JDBC driver (interclient.jar for jdk1.3) for Firebird
and noticed that when I extract a blob to an Inputstream, the stream
is closed when I close the PreparedStatement. For instance,
ptmnt = con.prepareStatement("Select foo from bar");
rs = pstmnt.executeQuery();
InputStream is = rs.getBinaryStream("foo");
rs.close();
pstmnt.close(); <---- At this point the InputStream "is" is also closed.
This does not happen with Oracle or IBM, so I have had to adjust the
server facade for Firebird so that the Object is deserialised before
the statement is closed.
I would rather hold on to the stream and deserialise when required.
Is there any particular trick in the book that I am missing (eg: wrong
driver?).
Much obliged.
Cheers
-raj