2013-10-27 50 views
0

我正在使用win7-eclipse-tomcat7-mysql5。在TOMCAT_DIRECTORY/conf目录DataSource maxActive不会在tomcat中更改mysql

首先,设置数据源资源/ 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不能改变?救救我,请....

回答

0

终于让我找到我的答案:)

在Eclipse WTP有自己的设置。

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

如果您运行eclipse WTP,TOMCAT_DIRECTORY/conf/context.xml不会影响您的服务器。它只依赖于eclipse/server/

中的资源文件
相关问题