Subject | RE: [Firebird-Java] Jaybird RC3 BLOB problems |
---|---|
Author | Ryan Baldwin |
Post date | 2003-04-25T11:00:17Z |
Hi,
There was a serious bug in RC3 that caused a few different types of
symptoms. This might be another manifestation of that bug(s?). Its
possible(quite likley) that using the latest version from CVS will solve
this for you.
Thanks
Ryan
-----Original Message-----
From: Andrew Guts [mailto:andr@...]
Sent: 25 April 2003 08:17
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] Jaybird RC3 BLOB problems
Hello
Help me please.
The code below works perfect with RC2, but fails with JBird driver RC3.
What is wrong with it?
private InputStream getImg(int id, boolean thumb, Connection conn)
throws SQLException, IOException, BusinessException
{
String sql = "select Picture from pJpegs where WareID = ?";
if (thumb)
sql = "select Thumb from pJpegs where WareID = ? and thumb_width
= "+Integer.toString(width);
PreparedStatement st = conn.prepareStatement(sql);
try {
st.setInt(1, id);
ResultSet rs = st.executeQuery();
if ((rs == null) || !rs.next()) {
log("pJpegs: empty resultset"); // I can see this message in
log file with RC3 driver, not RC2
if (thumb) return null;
else throw new BusinessException("No picture avaliable for
#"+Integer.toString(id));
}
Blob j = rs.getBlob(1);
if (j == null) { log("null blob"); return null; }
return j.getBinaryStream();
}
finally { st.close(); }
}
Thanks
Andrew
To unsubscribe from this group, send an email to:
Firebird-Java-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
There was a serious bug in RC3 that caused a few different types of
symptoms. This might be another manifestation of that bug(s?). Its
possible(quite likley) that using the latest version from CVS will solve
this for you.
Thanks
Ryan
-----Original Message-----
From: Andrew Guts [mailto:andr@...]
Sent: 25 April 2003 08:17
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] Jaybird RC3 BLOB problems
Hello
Help me please.
The code below works perfect with RC2, but fails with JBird driver RC3.
What is wrong with it?
private InputStream getImg(int id, boolean thumb, Connection conn)
throws SQLException, IOException, BusinessException
{
String sql = "select Picture from pJpegs where WareID = ?";
if (thumb)
sql = "select Thumb from pJpegs where WareID = ? and thumb_width
= "+Integer.toString(width);
PreparedStatement st = conn.prepareStatement(sql);
try {
st.setInt(1, id);
ResultSet rs = st.executeQuery();
if ((rs == null) || !rs.next()) {
log("pJpegs: empty resultset"); // I can see this message in
log file with RC3 driver, not RC2
if (thumb) return null;
else throw new BusinessException("No picture avaliable for
#"+Integer.toString(id));
}
Blob j = rs.getBlob(1);
if (j == null) { log("null blob"); return null; }
return j.getBinaryStream();
}
finally { st.close(); }
}
Thanks
Andrew
To unsubscribe from this group, send an email to:
Firebird-Java-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/