@Test
    public void testFoo() {
        ConnectionFactory cf = () -> DriverManager.getConnection(h2Extension.getUri());
        ConnectionFactory errorCf = new ErrorProducingConnectionFactory(cf, 99);
        Jdbi db = Jdbi.create(errorCf);

        db.useHandle(handle -> {
            handle.setStatementBuilder(new DefaultStatementBuilder());
            for (int idx = 0; idx < 100; idx++) {
                assertThat(handle.createQuery("SELECT " + idx).mapTo(int.class).first()).isEqualTo(idx);
            }
        });
    }
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