I am using Connector/J 3.1.6, Tomcat 5, and MySql 4.1. I have successfully set up MySql as a JNDI Datasource as described in the Tomcat HOWTO located at:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/printer/jndi-datasource-examples-howto.html#MySQL%20DBCP%20Example
Depending on what documentation you believe, there are a number of standard properties the JDBC Datasource accepts for configuring the connection pooling. Of particular interest to me are "initialPoolSize" and "minPoolSize"...or, as other documents refer to them.... "initialSize" and "minIdle". I have tried setting all of these properties in my Tomcat <ResourceParams> definition for the DataSource, but when I run the MySql Administrator and view the number of server connections, the number of connections that are created is never more than I have explicitly created myself...1 for each connection.
It makes me wonder if connection pooling is really happening here. If I set 10 as the initial and minimum pool size, it seems that 10 connections should initially get connected no matter how many I am using.
The DataSource does seem to be using other ResourceParams such as connectionProperties, username, password, etc.
Any ideas on why the connection pool is not creating the specified number of connections?
Thanks.