Tomcat 连接池配置中遇到的问题 2008-11-20 20:51
1:将 JDBC 驱动放到 Common/lib 目录下,然后进行下一步。
2:通过修改/conf/server.xml 文件实现连接池的定义
<Resource
name="jdbc/SqlServerDB"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="2"
maxWait="10000"
username="sa"
password="123"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=CarAtte
mperSystem"/>
代码放在* </GlobalNamingResources>前,定义的数据连接池名
字为jdbc/SqlServerDB
其他参数可选
2:通过修改/conf/context.xml 实现 Reloadable="true"
<!-- The contents of this file will be loaded for each web
application -->
<Context reloadable="true">
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>META-INF/context.xml</WatchedResour
ce>
<!-- Uncomment this to disable session persistence across
Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>
评论0
最新资源