I'm having a wee bit of trouble with Blackdown JDK for Linux
and exception handling inside code called from JNI.
It seems that try/catch blocks don't work if they are
contained in a method called directly or indirectly by JNI.

This is hitting me in the face because the jdbc driver I'm trying to use,
http://www.worldserver.com/~mmatthew/mysql/
while it does run better under Blackdown JDK than the last one I tried,
seems to rely on exception handling during normal operation
to detect the end of the query results:

      catch (ArrayIndexOutOfBoundsException E) {
        // Horrible hack
        if (Driver.debug) {
                System.out.println("* NULL Packet *");
        }
        return null;
      }

Since try/catch seems broken, the driver doesn't return null here,
and instead my top level code gets the exception:
java.lang.ArrayIndexOutOfBoundsException: 2
        at org.gjt.mm.mysql.Buffer.readLong(Buffer.java)
        at org.gjt.mm.mysql.Buffer.readLength(Buffer.java)
        at org.gjt.mm.mysql.MysqlIO.nextRow(MysqlIO.java)
        at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java)
        at org.gjt.mm.mysql.Connection.execSQL(Connection.java)
        at org.gjt.mm.mysql.Statement.executeQuery(Statement.java)
        at score_65.scoreReceived(score_65.java:52)
Exception in thread "main"

Has anyone else had trouble with exception handling in code
called from JNI?

- Dan

Reply via email to