class JooqHealthCheck extends HealthCheck {

  @Override
  protected Result check() throws Exception {
    try {
      databaseAgnostic(dataSource).selectOne().execute();
    } catch (DataAccessException | SQLException e) {
      switch (onFailure) {
        case LOG_ONLY:
          logger.warn("Unhealthy connection to database.");
          break;
        case RETURN_UNHEALTHY:
          return Result.unhealthy("Unhealthy connection to database.");
      }
    }
    return Result.healthy();
  }

  public  JooqHealthCheck(ManagedDataSource dataSource, OnFailure onFailure);

}