1
JavaIntermediate#jdbc
Connection pooling reuses a pool of established database connections instead of opening/closing a new one for every request, drastically reducing latency and resource overhead. Libraries like HikariCP manage pool sizing and connection health.
HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:mysql://localhost/db");
HikariDataSource ds = new HikariDataSource(config);
Connection conn = ds.getConnection(); // reused from pool