HikariCP is a JDBC connection pool for Java services that hands out database connections with minimal overhead. It ships as a small Maven dependency with defaults aimed at production use.
Overview
HikariCP manages a pool of JDBC database connections for Java applications. Applications obtain connections through a DataSource implementation configured with driver or DataSource class names, JDBC URLs, and credentials.
The pool exposes tunable timeouts for connection acquisition, idle retirement, keepalive pings, and maximum connection lifetime, along with minimum and maximum pool size controls. Documentation recommends OS-level or driver TCP keepalive so the pool can recover when connections drop to zero.
Configuration properties are optional beyond the essentials, and time values use milliseconds. Integrations can attach a metrics registry programmatically for observability. Microbenchmarks in a companion project compare cycle costs against other popular Java pools.
Artifacts publish to Maven Central for current Java releases, with older Java versions available through deprecated coordinates. Guidance covers pool sizing, spike demand behavior, and time synchronization on virtual machines for reliable timers.
Key features
- JDBC DataSource connection pooling
- Configurable pool and timeout limits
- Connection keepalive and validation
- Sane default configuration
- Maven Central distribution
- Metrics registry integration hook
- Spike demand pool sizing guidance
- Millisecond-based time settings
Use cases
- Java service database access
- Reducing connection acquisition overhead
- Production JDBC pool management
- Tuning pool size under load spikes