当我们用Tomcat5.0.XX时,以Oracle为例,一般我们的配置如下,但直接移到5.5.XX时就会发生错误
Resource name="jdbc/XXX" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/XXX">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>password</name>
<value>password</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@localhost:1521:SID</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>username</name>
<value>username</value>
</parameter>
</ResourceParams>
当要移植到Tomcat5.5.XX时,配置应当修改一下,如下所示:
<Resource
name="jdbc/XXX"
type="javax.sql.DataSource"
password="password"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="username"
url="jdbc:oracle:thin:@localhost:1521:SID"
maxActive="4"/>
当移动到6.0时,可这么改写
<Context path="/mznt" docBase="D:\\09 10 11\\MYECLIPSE\\mznt\\WebRoot"
debug="5" reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_MysqlTest_log." suffix=".txt"
timestamp="true"/>
<Resource
name="jdbc/oracl"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="30"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@localhost:1521:orcl"
maxActive="100"/>
</Context>
Resource name="jdbc/XXX" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/XXX">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>password</name>
<value>password</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@localhost:1521:SID</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>username</name>
<value>username</value>
</parameter>
</ResourceParams>
当要移植到Tomcat5.5.XX时,配置应当修改一下,如下所示:
<Resource
name="jdbc/XXX"
type="javax.sql.DataSource"
password="password"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="username"
url="jdbc:oracle:thin:@localhost:1521:SID"
maxActive="4"/>
当移动到6.0时,可这么改写
<Context path="/mznt" docBase="D:\\09 10 11\\MYECLIPSE\\mznt\\WebRoot"
debug="5" reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_MysqlTest_log." suffix=".txt"
timestamp="true"/>
<Resource
name="jdbc/oracl"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="30"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@localhost:1521:orcl"
maxActive="100"/>
</Context>