DropWizard 0.8.0-rc1 中的健康检查

HealthChecks in DropWizard 0.8.0-rc1

我正在按照文档为我的 dropwizard 应用程序创建数据库连接健康检查。我想知道 healthScript 如何获得数据库 class?我需要导入什么才能使用文档中提到的数据库 class?

http://dropwizard.io/0.8.0-rc1/docs/manual/core.html#health-checks

这只是一个示例,提供了健康检查可以完成什么的一般概念。没有可以导入的具体 Database class。实际的健康检查将取决于您选择的数据库连接:JDBI or Hibernate. Dropwizard also easily allows you to define your own DAO for whatever vendor / protocol you need. And if you read through that documentation you'll see that those database objects are configured just like everything else - 使用 YAML。

请注意,您可以升级到 0.8.0 release 而不是候选版本。