blog.relativt.net

Eirik's public note to self

11 August 2015

How to use java.util.Optional with Dropwizard and JDBI

by Eirik Tenold

In order to use Java 8’s java.util.Optional together with Dropwizard and JDBI, first include the Java 8 build of JDBI module:

In pom.xml (use version corresponding with Dropwizard):

io.dropwizard.modules dropwizard-java8-jdbi 0.7.1-1

In the main application, make sure that you import the correct DBIFactory from the module:

import io.dropwizard.java8.jdbi.DBIFactory;

tags: Dropwizard - JDBI - Java 8