Skip to content
Advertisement

Tag: jdbi

NoSuchMethodException in JDBI while using it with Lombok

I has immutable class like: JDBI Developer Guide states that it should work with @Value annotations. At least with bindBean() or @BindBean. But when I use org.jdbi.v3.core.result.ResultBearing#mapToBean method with MyEntry.class it throws java.lang.NoSuchMethodException: no such constructor: my.company.MyEntry.<init>()void/newInvokeSpecial. Looks like it trying create object with empty constructor and set fields after it. But I want to let my class be immutable.

Are all exceptions throw from Jdbi of type JdbiException?

It states here: https://jdbi.org/apidocs/org/jdbi/v3/core/JdbiException.html that JdbiException is the Base unchecked exception for exceptions thrown from jdbi. However, if I’m calling the withHandle method with various different callbacks: the docs state that it throws X extends Exception (rather than throwing JdbiExecption as I would have expected) and describes it as @param <X> exception type thrown by the callback, if any.: I

Use BeanMapper from within a RowMapper?

I’m using JDBI’s SQL Objects declarative API to map an object containing a one-to-many relationship: class Foo { private String id; private String name; private Set bars = new …

A way to bind Java Map to sql varchar in JDBI INSERT statement

Is there a way to bind a java Map<String, Object> to a varchar in the the JDBI @BindBean annotation. So for example I have a class Something.class and I create a @SqlBatch(“INSERT INTO Something (name, payload) VALUES(:name, :payload)”). Now in my java class the name is of type String and payload is of type Map<String, Object> and I want in

What is the difference between JDBC and JDBI?

I want to know about the differences between JDBC and JDBI in java. In particular, which one is generally better and why? Answer (I am the primary author of jDBI) jDBI is a convenience library built on top of JDBC. JDBC works very well but generally seems to optimize for the database vendors (driver writers) over the users. jDBI attempts

Advertisement