
ractically every request from a user's JSP/servlet creates a new database connection, which takes time and exhausts system resources. Using a limited number of database connections substantially improves Web server productivity and eases the load on your database. To the extent that servlets enable you to store information between user requests, distributed programming solutions, such as connection pools, can help generate Web content dynamically, quickly loading data from your database to your Web site.
A connection pool helps you manage and control the database connections from JSP/servlets, where you can store information between client requests. This article discusses the advantages of using a connection pool in your Java distributed systems programming. It requires a working knowledge of Java Web programming, databases, and JDBC, as well as an environment where you can access these technologies.
What Exactly Is a Connection Pool?
To understand connection pools, first think of servlets. Servlets are easy; they're just ordinary Java classes. A servlet request loads a Java class into the JVM and creates an instance of this class. Further, this one class instance processes all client requests in a separate thread. Between breaks, the instance remains in resident condition and is not removed. This way, it keeps all available information as instance objects, which is exactly what the connection pool is.