1,首先在安装目录下的conf/context.xml文件中加入配置信息如:
<Resource
name="jdbc/bookstore"
auth = "Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://127.0.0.1:1433;databaseName=bookstore;user=sa;password=sa"
maxActive="50"
maxIdle="15"
maxWait="5000"
/>
2,在相应应用的web.xml中配置连池的反射如:
<resource-ref>
<description>bookstore connection</description>
<res-ref-name>jdbc/bookstore</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
3,在应用程序中动用