---
title: "What is a connection pool?"  
description: "What is a connection pool?"  
author: "Sunita  Singh"  
published: 2017-11-14  
canonical: https://answers.mindstick.com/qa/30542/what-is-a-connection-pool  
category: "programming"  
reading_time: 1 minute  

---

# What is a connection pool?

What is a [connection](https://www.mindstick.com/articles/123/connection-string) [pool](https://www.mindstick.com/blog/266120/the-pleasure-of-swimming-in-your-own-pool)?

## Answers

### Answer by Arti Mishra

**“Connection Pool”** \

Connection Pool is the **cache of a database**, which **maintain the connection when we reused future requests**. Generally, it is used for **increasing the performance of executing commands** on a database. In connection pooling, when the connection is created, it is **placed in the pool** and **reused again before establishing new connections.** \
**"Connection Pool Architecture"**![What is a connection pool?](https://answers.mindstick.com/questionanswer/37e2b050-14db-4088-b712-600c32a05070/images/4f5b9634-c1a9-4c9c-87ad-9c083bfef41c.gif)\
\
**JDBC Connection Pooling Scope:** **\**import java.sql.*; public class JDBCServlet extends HttpServlet { \
private Connection connection; public void init(ServletConfig c) throws ServletException { …………….. …………….. // write some code for Open the connection …………………. } public void destroy() { ……………………….. …………………. //write some code for Close the connection } public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException { …………….. ………….. //Use the connection here Statement stmt = connection.createStatement(); ………………….. …………………. // perform JDBC Work ………………… } } \


---

Original Source: https://answers.mindstick.com/qa/30542/what-is-a-connection-pool

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
