@Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            try {
                if ("createStatement".equals(method.getName())
                    || "prepareCall".equals(method.getName())
                    || "prepareStatement".equals(method.getName())) {
                    if (++numStatements > numSuccessfulStatements) {
                        throw new SQLException("Fake 'maximum open cursors exceeded' error");
                    }
                    return StatementInvocationHandler.newInstance((Statement) method.invoke(connection, args), this);
                } else {
                    return method.invoke(connection, args);
                }
            } catch (InvocationTargetException ex) {
                throw ex.getTargetException();
            }
        }
Oracle was getting angry about too many open cursors because of the large number of prepared statements being created and cached indefinitely.
core/src/test/java/org/jdbi/v3/core/TestTooManyCursors.java