codahale/dropwizard — pull request #25 by ptgoetz (2012-02-02 22:31:46+00:00)
Title: (dropwizard-db) Database Health Checks Use Hardcoded SQL

This is a small fix to make db health checks configurable.

Currently db health checks use the Database.ping() method which uses hard-coded sql to perform the check:

"SELECT 1"

Which won't work on all dbs, such as Oracle.

With this patch, a db health check will be added if the connection config has a "validationQuery" param, and use that sql for the health check.

I didn't muck with the Database.ping() method, but IMO it should be removed or refactored... The above approach seemed easiest since "ping()" sql was tied up in an annotation.

-Taylor