下面我以配置mysql为例:
Tomcat6.0连接池配置 1. 配置tomcat下的conf下的context.xml文件,在之间添加连接池配置: <Resource name="jdbc/mysql" auth="Container" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/databaseName" username=" user " password="password" maxActive="100" maxIdle="30" maxWait="10000" /> 2. 配置你的应用下的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> 3.把连接数据库的第三方驱动放到common/lib下面就ok了
4.测试程序我就不写了