I have always said this: not all applications require a connection pool. Generally, a connection pool is used for lightweight purposes, which will reduce the efficiency. how to connect the pool depends on your system bottleneck.
In a common Connection process, local methods are generally used for Connection, which consume system resources very much. link initialization, execute SQL statements, close links in a common link, the total resource allocation should be, 10, 25, of course not so accurate, only to demonstrate that the resources consumed by the real language execution in a link are very small.
If your server is connected only once every five minutes, you can only use this common connection because the entire connection process is only 0.0 seconds, you do not need to enable the connection pool to consume resources in the remaining 4.9 seconds. However, if there are 10 connections per second, the initialization resources consumed by normal connections are high, you can use the connection pool to show its advantages.
So what connection method should you use? It depends on your application and you must perform real concurrency simulation tests. don't believe what the book says in a good way. The true architecture of a platform is an art, not just a technology. You need to test in many aspects to find the best combination. many traps cannot be discovered by technology. for example, you can check that your JVM has many idle resources, but the system has crashed. the JVM does not reflect the consumption of resources such as link initialization in the local method, but there are many such traps in the same physical memory. What is important is experience and testing!