If a core Java exceptions, such as NullPointerException, ClassCastException, or ArrayIndexOufOfBoundsException, is thrown from within a JRuby internal code, the exception cannot be caught by any Ruby handler. This includes both exception coming from JRuby interpreter and any other JRuby-optimized Java code (such as AR-JDBC's own Internal adapter).
This is a bug and not merely a feature request, because the inability to catch such core Java exception makes it impossible to guard the thread against any unexpected exception, and directly kills the thread.
I don't have a test case, because I don't know how to intentionally trigger an exception inside JRuby (any such exception will presumably be a bug).
To fix this bug, these core exception should be rescue-able by Ruby code and also have Ruby stack traces available.