mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 03:13:21 +08:00
Add firebird specific health query
Closes gh-3555
This commit is contained in:
parent
12b876fbfa
commit
b7b6e84d4b
@ -203,13 +203,22 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator implement
|
||||
|
||||
},
|
||||
|
||||
INFORMIX("Informix Dynamic Server", "select count(*) from systables");
|
||||
INFORMIX("Informix Dynamic Server", "select count(*) from systables"),
|
||||
|
||||
FIREBIRD("Firebird", "SELECT 1 FROM RDB$DATABASE") {
|
||||
|
||||
@Override
|
||||
protected boolean matchesProduct(String product) {
|
||||
return super.matchesProduct(product)
|
||||
|| product.toLowerCase().startsWith("firebird");
|
||||
}
|
||||
};
|
||||
|
||||
private final String product;
|
||||
|
||||
private final String query;
|
||||
|
||||
private Product(String product, String query) {
|
||||
Product(String product, String query) {
|
||||
this.product = product;
|
||||
this.query = query;
|
||||
}
|
||||
|
@ -110,6 +110,8 @@ public class DataSourceHealthIndicatorTests {
|
||||
assertThat(Product.forProduct("DB2/LINUXX8664"), equalTo(Product.DB2));
|
||||
assertThat(Product.forProduct("Informix Dynamic Server"),
|
||||
equalTo(Product.INFORMIX));
|
||||
assertThat(Product.forProduct("Firebird 2.5.WI"), equalTo(Product.FIREBIRD));
|
||||
assertThat(Product.forProduct("Firebird 2.1.LI"), equalTo(Product.FIREBIRD));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user