Preparing your application to use a connection pool

One of the first things we should learn in our life, after feeding, is using a connection pool. Especially when we are talking about databases. This is the case covered here.

Why? Because a connection opened with the database is costly in terms of resources used for it. Even worse, if we look closer at the process of opening a new connection, it uses a lot of CPU resources, for example.

Maybe it won't make much difference if you have two users using a database with a couple of registers in a few tables. But it can start causing trouble if you have dozens of users, or if the database is large and gives you sleepless nights when you have hundreds of users using a huge database.

Actually I, ...

Get Java EE 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.