How to control no. of JDBC Connections in Tomcat!!!
Sonal Sharma
Ranch Hand
Joined: May 13, 2006
Posts: 62
posted
0
Dear friends, I want to know a way to configure/restrict no of JDBC connections that are available in a connectionpool which has been created programmatically thru my web application.Can we control this functionality through Tomcat in which my application is hosted.
You're already using DBCP!!! You should configure it through Tomcat and define it there!!!
regards, Dave!!!
Rahul Bhattacharjee
Ranch Hand
Joined: Nov 29, 2005
Posts: 2300
posted
0
Look at the javadoc for Apache's DBCP there is a method to set the maximum number of connections in the pool , that is the pool size.
As suggested by David O'Meara , Tomcat already has this feature and in case you configure the connection pool at Tomcal level then pool will be taken care by Tomcat and using JNDI you can make use of the connection pool from within your application.
Dear friends, Cann't we set the Connection pool size manually in the code snippet that I have already provided so that I don't have to make any changes anywhere.