Subject | Extracting blobs (via JDBC) |
---|---|
Author | rajsubramani <rajsubramani@yahoo.co.uk> |
Post date | 2003-01-28T08:53:12Z |
Hi,
I am using the JDBC driver 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.
Much obliged.
Cheers
-raj
I am using the JDBC driver 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.
Much obliged.
Cheers
-raj