gpt4 book ai didi

mysql - DataSource maxActive在tomcat mysql中没有变化

转载 作者:行者123 更新时间:2023-11-28 23:41:03 25 4
gpt4 key购买 nike

我正在使用 win7-eclipse-tomcat7-mysql5。

首先,在TOMCAT_DIRECTORY/conf/context.xml中设置数据源资源

<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>

<Resource name="jdbc/TestDB" auth="Container"
type="javax.sql.DataSource"
maxActive=100 maxIdle="30" maxWait="10000"
username="dev_id" password="dev_password"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/my_db_name" />
</Context>

并且在 ECLIPSE/MY_PROJECT/WebContent/WEB-INF/web.xml 中

  <resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/TestDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

设置后,我运行我的 eclipse tomcat 7.0 服务器。

然后在jconsole中找到maxActive。 enter image description here

为什么maxActive不能改??请帮助我....

最佳答案

终于找到答案了:)

在 eclipse 中,WTP 有自己的设置。

您会在/server 文件夹中看到 tomcat 服务器设置文件。

如果您运行 eclipse WTP,TOMCAT_DIRECTORY/conf/context.xml 不会影响您的服务器。只依赖eclipse/server/中的资源文件

关于mysql - DataSource maxActive在tomcat mysql中没有变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19620364/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com