Search in sources :

Example 1 with DefaultStatementBuilder

use of org.jdbi.v3.core.statement.DefaultStatementBuilder in project jdbi by jdbi.

the class TestTooManyCursors method testFoo.

@Test
public void testFoo() throws Exception {
    ConnectionFactory cf = dbRule.getConnectionFactory();
    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++) {
            handle.createQuery("SELECT " + idx + " FROM something").mapTo(int.class).findFirst();
        }
    });
}
Also used : DefaultStatementBuilder(org.jdbi.v3.core.statement.DefaultStatementBuilder) Test(org.junit.Test)

Aggregations

DefaultStatementBuilder (org.jdbi.v3.core.statement.DefaultStatementBuilder)1 Test (org.junit.Test)1