Monitoring database health is essential to maintain stability and prevent downtime. With Spring Boot Actuator, you can easily track the health of your Firebird database in real time.
1. What Is Spring Boot Actuator?
Spring Boot Actuator provides built-in endpoints for monitoring and managing applications. It exposes useful information like application status, metrics, and database health through HTTP endpoints or JMX.2. Enable Actuator in Your Project
Add the Actuator dependency to yourpom.xml:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
Once added, Actuator automatically provides endpoints like /actuator/health and /actuator/metrics.
3. Configure Firebird Health Check
To include Firebird in the Actuator health report, make sure your JDBC connection is properly configured inapplication.properties:
spring.datasource.url=jdbc:firebirdsql://localhost:3050/app.fdb
spring.datasource.username=sysdba
spring.datasource.password=masterkey
management.endpoint.health.show-details=always
Actuator will automatically test the connection health.
4. Custom Health Indicator for Firebird
For deeper insights, create a custom health check using Spring’sHealthIndicator:
@Component
public class FirebirdHealthIndicator implements HealthIndicator {
@Autowired
private DataSource dataSource;
@Override
public Health health() {
try (Connection conn = dataSource.getConnection()) {
if (conn.isValid(2)) {
return Health.up().withDetail("database", "Firebird running").build();
}
} catch (Exception e) {
return Health.down().withDetail("error", e.getMessage()).build();
}
return Health.unknown().build();
}
}
This verifies database connectivity and reports status in /actuator/health.
5. View Health Status
Start your application and access:http://localhost:8080/actuator/health
Example output:
{
"status": "UP",
"components": {
"firebirdHealthIndicator": {
"status": "UP",
"details": { "database": "Firebird running" }
}
}
}

image quote pre code