Subject ArrayIndexOutOfBoundsException trying to read blob
Author phil_hhn
Hi, we've been getting the odd ArrayIndexOutOfBoundsException when
trying to read blobs. Not all the time... This is happening in a web
app which uses a jsp/java/jdbc backend.

Our JDBC Driver: Jaybird JCA/JDBC driver, Version 2.1
Database: Firebird 1.5.4.4910

When we call the following:
byte[] imageBytes = rs.getBytes(16);

We get the error:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at
org.firebirdsql.jdbc.field.FBBlobField.getBytesInternal(FBBlobField.java:153)
at org.firebirdsql.jdbc.field.FBBlobField.getBytes(FBBlobField.java:113)
at org.firebirdsql.jdbc.FBResultSet.getBytes(FBResultSet.java:431)


Can anyone (with access to the source I assume) tell me what is
happening at this point in the stack trace?

Immediately afterwards our code called statement.executeQuery and this
happened:
java.lang.NegativeArraySizeException
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.parseTruncSqlInfo(AbstractJavaGDSImpl.java:2349)
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.parseSqlInfo(AbstractJavaGDSImpl.java:2305)
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscDsqlPrepare(AbstractJavaGDSImpl.java:1499)
at
org.firebirdsql.gds.impl.GDSHelper.prepareStatement(GDSHelper.java:196)
at
org.firebirdsql.jdbc.AbstractStatement.prepareFixedStatement(AbstractStatement.java:1129)
at
org.firebirdsql.jdbc.AbstractStatement.internalExecute(AbstractStatement.java:1108)
at
org.firebirdsql.jdbc.AbstractStatement.executeQuery(AbstractStatement.java:219)

I don't know if the second error is related, but it is logged at
exactly the same second. Did the first error destabilise the JDBC driver?

Thanks in advance,
Phil