发表时间:2009-02-19
最后修改:2009-02-19
MySql安装目录下找到 conf/context.xml
配置前代码:
<Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>
配置后代码:红色为配置数据源代码
<Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
<!--配置数据源 代码如下-->
<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="20" maxIdle="2" maxWait="5000" name="hibernate/mysql" password="" type="javax.sql.DataSource" url="jdbc:mysql://192.168.12.8:3306/mysql" username="mysql" />
</Context>