I have been using DBCP connection pooling with following details (https://stackoverflow.com/questions/37613362/slowest-component-org-apache-tomcat-dbcp-dbcp-basicdatasource-getconnection-du) but did not find any proper solution yet.
Anyway, With this configuration, the query SELECT 1 is executed each time the Java code calls Connection con = dataSource.getConnection();.
This guarantees that the connection has been tested before it's handed to the application. However, for applications using connections very frequently for short periods of time, this has a severe impact on performance.
I am curious to know that it really effects or causes of slowness which i am having, if so then is there alternative way(Increasing the number of maxActive and maxIdle) around to fix this issue?