JDBI, Oracle and Null

JDBI is a pretty neat framework for a light-touch integration with JDBC in your application. t’s SQL Object API lets you annotate an interface with straight SQL queries like so:

interface FooDao {
   @SqlInsert( "insert into bar values (:foo)" )
   public void insert( @Bind("foo") String foo );

then get dbi to create you an instance of this dao which will magically prepare and execute the statements you’ve bound to the methods in the interface.

But try supplying null as a parameter to your dao, and you’ll get a nasty surprise:

Read on →

Database Schema Migrations and Dropwizard

One of the problems with writing applications backed by a datastore is that the metadata describing the datastore (DDL in the SQL world) needs to be applied to the datastore in step with the code which accesses that store. Previous versions of the application code may work well with a more advanced version of the schema, but a newer version of your code almost certainly won’t work well with an old version of your database.

Read on →