Subject | Strange Exception |
---|---|
Author | William L. Thomson Jr. |
Post date | 2002-09-12T17:03:07Z |
I am getting a exception that I have not seen before and do not know how
to go about preventing it.
java.sql.SQLException: fetch problem: org.firebirdsql.gds.GDSException:
SQLDA missing or incorrect version, or incorrect number/type of
variables
I get this while trying to get the data out of a blob column after
executing the query and getting the data in a ResultSet object.
I have had a problem in the past with blobs where I had to remove a few
lines of code to get around a particular exception.
I have discovered while creating a test to replicate the problem, that
the problem was more in the database blobs than the driver. Basically
some blobs in the DB are not exactly empty or null, but they do not have
much if any data in them. Which without the following lines removed
causes an uncatchable exception to be thrown while trying to extract
those blobs. The driver would throw the "You can't read a new blob"
since the data was closer to being a new blob than null. But when using
InterClient, I did not have problems. With InterClient, or a modified
JayBird driver testing the resultSet.getBytes() for null works fine even
on the new blobs.
Here is the code I changed
Before
private FBBlobInputStream() throws SQLException {
if (blob_id == 0) {
throw new SQLException("You can't read a new blob");
}
try {
blob = c.openBlobHandle(blob_id);
}
catch (GDSException ge) {
throw new SQLException("couldn't open blob: " + blob_id + "
exception: " + ge.toString());
}
}
After
private FBBlobInputStream() throws SQLException {
try {
blob = c.openBlobHandle(blob_id);
}
catch (GDSException ge) {
throw new SQLException("couldn't open blob: " + blob_id + "
exception: " + ge.toString());
}
}
Now could that change be what is causing the exception this post is
about? Or would it be something else?
--
Sincerely,
William L. Thomson Jr.
Support Group
Obsidian-Studios Inc.
439 Amber Way
Petaluma, Ca. 94952
Phone 707.766.9509
Fax 707.766.8989
http://www.obsidian-studios.com
to go about preventing it.
java.sql.SQLException: fetch problem: org.firebirdsql.gds.GDSException:
SQLDA missing or incorrect version, or incorrect number/type of
variables
I get this while trying to get the data out of a blob column after
executing the query and getting the data in a ResultSet object.
I have had a problem in the past with blobs where I had to remove a few
lines of code to get around a particular exception.
I have discovered while creating a test to replicate the problem, that
the problem was more in the database blobs than the driver. Basically
some blobs in the DB are not exactly empty or null, but they do not have
much if any data in them. Which without the following lines removed
causes an uncatchable exception to be thrown while trying to extract
those blobs. The driver would throw the "You can't read a new blob"
since the data was closer to being a new blob than null. But when using
InterClient, I did not have problems. With InterClient, or a modified
JayBird driver testing the resultSet.getBytes() for null works fine even
on the new blobs.
Here is the code I changed
Before
private FBBlobInputStream() throws SQLException {
if (blob_id == 0) {
throw new SQLException("You can't read a new blob");
}
try {
blob = c.openBlobHandle(blob_id);
}
catch (GDSException ge) {
throw new SQLException("couldn't open blob: " + blob_id + "
exception: " + ge.toString());
}
}
After
private FBBlobInputStream() throws SQLException {
try {
blob = c.openBlobHandle(blob_id);
}
catch (GDSException ge) {
throw new SQLException("couldn't open blob: " + blob_id + "
exception: " + ge.toString());
}
}
Now could that change be what is causing the exception this post is
about? Or would it be something else?
--
Sincerely,
William L. Thomson Jr.
Support Group
Obsidian-Studios Inc.
439 Amber Way
Petaluma, Ca. 94952
Phone 707.766.9509
Fax 707.766.8989
http://www.obsidian-studios.com