tomcat-5.0.28 和 tomcat-5.5.23 的datasource

阅读更多
Datasource of Tomcat-5.0.8
xml 代码
  1. <Context path="/app" docBase="D:/jakarta-tomcat-5.0.28/\webapps/app"  
  2.         debug="0" privileged="true">  
  3.     <Resource name="jdbc/****" scope="Shareable" type="javax.sql.DataSource"/>  
  4.           <ResourceParams name="jdbc/****">          
  5.             <parameter>  
  6.               <name>maxWaitname>  
  7.               <value>5000value>  
  8.             parameter>  
  9.             <parameter>  
  10.               <name>maxActivename>  
  11.               <value>4value>  
  12.             parameter>  
  13.             <parameter>  
  14.               <name>passwordname>  
  15.               <value>savalue>  
  16.             parameter>  
  17.             <parameter>  
  18.               <name>urlname>  
  19.               <value>jdbc:mysql://192.168.83.18:3306/V082value>  
  20.             parameter>  
  21.             <parameter>  
  22.               <name>driverClassNamename>  
  23.               <value>com.mysql.jdbc.Drivervalue>  
  24.             parameter>  
  25.             <parameter>  
  26.               <name>usernamename>  
  27.               <value>savalue>  
  28.             parameter>    
  29.    ResourceParams>  
  30. Context>  


Datasource of tomcat-5.5.23
xml 代码
  1. xml version="1.0" encoding="UTF-8"?>  
  2. <Context docBase="/app" path="/app" reloadable="true" cookies="true" crossContext="true" privileged="true" antiResourceLocking="false" antiJARLocking="false">  
  3.   <Resource  
  4.     name="jdbc/*****"  
  5.     type="javax.sql.DataSource"  
  6.     password="sa"  
  7.     driverClassName="com.mysql.jdbc.Driver"  
  8.     maxIdle="2"  
  9.     maxWait="5000"  
  10.     username="sa"  
  11.     url="jdbc:mysql://192.168.83.18:3306/v082"  
  12.     maxActive="4"/>  
  13. 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"
-->

你可能感兴趣的:(Tomcat,MySQL,JDBC,Oracle,PostgreSQL)