JDBC ArrayIndexOutOfBoundsException


I believe I’ve found a bug in the JDBC connector.

I’ve been able to create this useless example which causes an error while using JDBC, but works perfectly fine in the console.

            j> 0),
        i, j
        k > 2),
    i, k)

Changing the second filter to k > 1 makes things work cause it returns a value, but if the cross_join returns nothing then I get the index out of bounds error.


Just as an addendum, I’ve also found that the typical way of walking through a ResultSet does not work with the jdbc connector.

The typical way I’d write code to do so is as follows:

ResultSet rs = ...
while (rs.next()) {

When I do this, I actually find that the result set starts off on the first record, and calling next moves to the second record. As well, rs.next() doesn’t return false after the final record has been reached, so I get an exception after the last record + 1is accessed. This breaks the contract for ResultSet.next() and it looks to me like there’s a fencepost bug here that could very well be related to the index out of bounds error?


Hi, thank you for pointing these out. It looks like in this case the JDBC driver receives a chunk which has no values (because none of the values satisfy the filter) - and it doesn’t know how to handle it gracefully. Will file a bug on this.


Hi cregnier,

I got the same error with you when I using SciDB JDBC. I am wondering if you solved the ArrayIndexOutOfBoundsException?
I tried a lot of ways to solve this error but I failed.