Datasource of Tomcat-5.0.8
xml 代码
<Context path=
"/app" docBase=
"D:/jakarta-tomcat-5.0.28/\webapps/app" debug=
"0" privileged=
"true"> <Resource name=
"jdbc/****" scope=
"Shareable" type=
"javax.sql.DataSource"/> <ResourceParams name=
"jdbc/****"> <parameter> <name>maxWait
</name> <value>5000
</value> </parameter> <parameter> <name>maxActive
</name> <value>4
</value> </parameter> <parameter> <name>password
</name> <value>sa
</value> </parameter> <parameter> <name>url
</name> <value>jdbc:mysql://192.168.83.18:3306/V082
</value> </parameter> <parameter> <name>driverClassName
</name> <value>com.mysql.jdbc.Driver
</value> </parameter> <parameter> <name>username
</name> <value>sa
</value> </parameter> </ResourceParams> </Context>
<context path="/contextPath" docbase="Your app path"></context><context path="/jenespace" docbase="D:/jakarta-tomcat-5.0.28/\webapps/jenespace"></context><resource type="javax.sql.DataSource" scope="Shareable" name="jdbc/*****"></resource><resourceparams name="jdbc/iconnectDS"></resourceparams>
Datasource of tomcat-5.5.23
xml 代码
<?xml version=
"1.0" encoding=
"UTF-8"?> <Context docBase=
"/app" path=
"/app" reloadable=
"true" cookies=
"true" crossContext=
"true" privileged=
"true" antiResourceLocking=
"false" antiJARLocking=
"false"> <Resource name=
"jdbc/*****" type=
"javax.sql.DataSource" password=
"sa" driverClassName=
"com.mysql.jdbc.Driver" maxIdle=
"2" maxWait=
"5000" username=
"sa" url=
"jdbc:mysql://192.168.83.18:3306/v082" maxActive=
"4"/> </Context>
<context path="/jenespace" docbase="/jenespace" privileged="true" cookies="true" reloadable="true" antijarlocking="false" antiresourcelocking="false" crosscontext="true"></context>
For other database,the url and driverClassName will be different:
1.ms-sql driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=SAM_GDCZ"
2.oracle driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@127.0.0.1:1521:SAM_GDCZ"
3.postgresql driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://127.0.0.1:5432/SAM_GDCZ"
4.mysql driverClassName="org.gjt.mm.mysql.Driver"[old mySql jdbc driver]
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306/SAM_GDCZ"
-->
相关资源:apache-tomcat-5.5.23