mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Fix compile problem
Something slipped the recent merge
This commit is contained in:
parent
b6f3866969
commit
14899ba3b2
@ -35,8 +35,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Dave Syer
|
||||
* @author Christian Dupuis
|
||||
*/
|
||||
public class SimpleDataSourceHealthIndicator implements
|
||||
HealthIndicator<Map<String, Object>> {
|
||||
public class SimpleDataSourceHealthIndicator implements HealthIndicator {
|
||||
|
||||
private DataSource dataSource;
|
||||
|
||||
@ -64,6 +63,7 @@ public class SimpleDataSourceHealthIndicator implements
|
||||
/**
|
||||
* Create a new {@link SimpleDataSourceHealthIndicator} using the specified
|
||||
* datasource.
|
||||
*
|
||||
* @param dataSource the data source
|
||||
*/
|
||||
public SimpleDataSourceHealthIndicator(DataSource dataSource) {
|
||||
@ -80,6 +80,7 @@ public class SimpleDataSourceHealthIndicator implements
|
||||
if (this.dataSource != null) {
|
||||
try {
|
||||
product = this.jdbcTemplate.execute(new ConnectionCallback<String>() {
|
||||
|
||||
@Override
|
||||
public String doInConnection(Connection connection)
|
||||
throws SQLException, DataAccessException {
|
||||
@ -87,8 +88,7 @@ public class SimpleDataSourceHealthIndicator implements
|
||||
}
|
||||
});
|
||||
health.withDetail("database", product);
|
||||
}
|
||||
catch (DataAccessException ex) {
|
||||
} catch (DataAccessException ex) {
|
||||
health.down().withException(ex);
|
||||
}
|
||||
String query = detectQuery(product);
|
||||
@ -96,8 +96,7 @@ public class SimpleDataSourceHealthIndicator implements
|
||||
try {
|
||||
health.withDetail("hello",
|
||||
this.jdbcTemplate.queryForObject(query, Object.class));
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
health.down().withException(ex);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user