再贴一下tomcat连接池的配置方法:tomcat连接池的配置是非常简单的,5.5以上的配置,在不改变tomcat的任何配置的情况下建立连接池:1 在项目的WebRoot下建立META-INF文件夹2 在META-INF下建立context.xml文件3 在context.xml中加入如下样例代码
    <Context path="/appName" docBase="appName"
    debug="5" crossContext="true" reloadable="false"
    cachingAllowed="true" cacheMaxSize="20480"
    cacheTTL="10000">
    <Resource name="jdbc/mysql" auth="Container" removeAbandoned="true"
    removeAbandonedTimeout="60" logAbandoned="true"
    type="javax.sql.DataSource" maxActive="50" maxIdle="10"
    maxWait="10000" username="root" password="root"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/dbname?autoReconnect=true" />
    </Context>在web.xml中加入   
<resource-ref>
        <description>DB Connection</description>
        <res-ref-name>jdbc/mysql</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>
以上配置文件,参数自己在重新设置设置,别忘了把驱动放到你的项目的classpath下
再加一点内容:
如果用hibernate,那么在hibernate.cfg.xml中这么配置
<hibernate-configuration>
  <session-factory name="java:hibernate/SessionFactory">
    <!-- JNDI datasource -->
    <property name="connection.datasource">
      java:comp/env/jdbc/mysql
    </property>
    <property name="dialect">
      org.hibernate.dialect.MySQLInnoDBDialect
    </property>
</hibernate-configuration>大概流程是这样,希望对你有所帮助