tomcat5.5.20的连接池配置方法

Tuesday February 27, 2007

配置server.xml,在< /host > 标签前加入

<context
       docBase="C:/eclipse/workspace/myweb/hello"
        path="/hello"
         reloadable="true"
<resource name="jdbc/mysql" auth="Container" type="javax.sql.DataSource"
	maxActive="100" maxIdle="30" maxWait="10000"
	driverClassName="com.mysql.jdbc.Driver"
	username="root" password="123456"
	url="jdbc:mysql://localhost/testmysql"
	defaultAutoCommit="true" removeAbondoned="true"
	removeAbondonedTimeout="60" logAbondoned="true"/>
</context>

配置web.xml

	<resource-ref>
		<res-ref-name>jdb/mysql</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
	</resource-ref>

1 Comment

  1. 请问:
    docBase=”C:/eclipse/workspace/myweb/hello”
    是什么路径?
    path后是不是写的项目文件夹?
    workDir=”C:eclipseworkspacemywebin”>
    是指向哪呀?我的项目里没有这个目录呀。

Leave a reply