Subject | Re: InputStream closes when prepared statement is closed. |
---|---|
Author | rajsubramani <rajsubramani@yahoo.co.uk> |
Post date | 2003-01-29T13:32:54Z |
--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy
<rrokytskyy@y...>" <rrokytskyy@y...> wrote:
Jaybird succeeds where Interclient fails.
In light of the above, posting will Jaybird continue to operate like
this (i.e keep the stream open) or will it be "fixed" to mimic
Interclient (i.e close the stream)?
Cheers
-raj
-------------------------Test Harness-------------------------
Case I:
-------
PreparedStatement pstmnt = con.prepareStatement("select image from Foo
where image_id = 1");
InputStream is = null;
ResultSet rs = pstmnt.executeQuery();
while (rs.next())
{
is = rs.getBinaryStream("image");
}
rs.close();
pstmnt.close();
//code to extract image object
Case II:
--------
PreparedStatement pstmnt = con.prepareStatement("select image from Foo
where image_id = 1");
InputStream is = null;
ResultSet rs = pstmnt.executeQuery();
while (rs.next())
{
is = rs.getBinaryStream("image");
}
//code to extract image object
rs.close();
pstmnt.close();
-------------------------Results-------------------------
Interclient (for jdk1.3)
------------------------
/**
* db.driver=interbase.interclient.Driver
* db.url=jdbc:interbase://<ip address>//<db url>
* db.user=SYSDBA
* db.password=masterkey
*/
CaseI:
------
interbase.interclient.BlobIOException: JDBC IOException: Invalid
operation to read on closed blob stream.
See API reference for exception interbase.interclient.BlobIOException
...
...
Case II:
--------
Success.
FirebirdSQL-1.0.0RC2
--------------------
/**
* db.driver=org.firebirdsql.jdbc.FBDriver
* db.url=jdbc:firebirdsql://<ip address>//<db url>
* db.user=SYSDBA
* db.password=masterkey
*/
CaseI:
------
Success.
Case II:
--------
Success.
<rrokytskyy@y...>" <rrokytskyy@y...> wrote:
> > Your mention of interclient is was the missing piece of info fromHere are the results of the test harness.
> > your first pots. Interclient has been superceed by the type4
> > Jaybird driver, so if you problem does turn out to be an issue with
> > Interclient, it is unlikly to be fixed.
> >
> > Have you tried you code with the Jaybird driver?
>
> JayBird should work the same in this case. If it does not, it will be
> fixed soon :)
>
> Best regards,
> Roman Rokytskyy
Jaybird succeeds where Interclient fails.
In light of the above, posting will Jaybird continue to operate like
this (i.e keep the stream open) or will it be "fixed" to mimic
Interclient (i.e close the stream)?
Cheers
-raj
-------------------------Test Harness-------------------------
Case I:
-------
PreparedStatement pstmnt = con.prepareStatement("select image from Foo
where image_id = 1");
InputStream is = null;
ResultSet rs = pstmnt.executeQuery();
while (rs.next())
{
is = rs.getBinaryStream("image");
}
rs.close();
pstmnt.close();
//code to extract image object
Case II:
--------
PreparedStatement pstmnt = con.prepareStatement("select image from Foo
where image_id = 1");
InputStream is = null;
ResultSet rs = pstmnt.executeQuery();
while (rs.next())
{
is = rs.getBinaryStream("image");
}
//code to extract image object
rs.close();
pstmnt.close();
-------------------------Results-------------------------
Interclient (for jdk1.3)
------------------------
/**
* db.driver=interbase.interclient.Driver
* db.url=jdbc:interbase://<ip address>//<db url>
* db.user=SYSDBA
* db.password=masterkey
*/
CaseI:
------
interbase.interclient.BlobIOException: JDBC IOException: Invalid
operation to read on closed blob stream.
See API reference for exception interbase.interclient.BlobIOException
...
...
Case II:
--------
Success.
FirebirdSQL-1.0.0RC2
--------------------
/**
* db.driver=org.firebirdsql.jdbc.FBDriver
* db.url=jdbc:firebirdsql://<ip address>//<db url>
* db.user=SYSDBA
* db.password=masterkey
*/
CaseI:
------
Success.
Case II:
--------
Success.