Connection Pooling in JDBC — Why It Is Critical
Fast recall
Quick revision
Core answer
Whether you understand pooling reuses costly connections and bounds the count.
Opening a new connection per request, hurting performance and overloading the DB.
Mention borrow/return lifecycle, max pool size, and HikariCP as the standard.
Interview-ready guide
Interview answer
Without a pool, a service may repeatedly create and authenticate physical connections. With HikariCP, application code calls DataSource.getConnection, performs a short transaction, and closes it; the pool usually resets and reuses the underlying connection. If all connections are busy, callers wait instead of opening unlimited sessions. A pool cannot make a ten-second query fast, and holding a connection during remote HTTP calls wastes capacity.
Connection Pooling in JDBC — Why It Is Critical
Direct Answer
A connection pool maintains reusable database connections and lends logical Connection handles to callers. Reuse avoids repeated connection establishment/authentication and, more importantly, places a bound on concurrent database sessions. Pooling supports throughput and backpressure, but it does not fix slow SQL and a larger pool can overload the database.
Common Mistakes & Pitfalls
Opening a new connection per request, hurting performance and overloading the DB.
Check your understanding
Answer these without looking back at the article.
- What is HikariCP and how do you configure it in Spring Boot?
- What happens when all connections in a pool are in use?
- What is a connection leak in JDBC and how do you prevent it?
Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.