`
gongmingwind
  • 浏览: 579972 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

tomcat5.5 配置数据源(转)

阅读更多
以Tomcat5.5:
(一)在apache-tomcat-5.5\conf的context.xml文件的<Context></Context>元素中:
     
 <Resource name="jdbc/mysql1" auth="Container" type="javax.sql.DataSource"
             maxActive="50" maxIdle="30" maxWait="10000" logAbandoned="true"
             username="root" password="123456" driverClassName="com.mysql.jdbc.Driver"
             url="jdbc:mysql://localhost:3306/dbmy"/>
   <Resource name="jdbc/mysql2" auth="Container" type="javax.sql.DataSource"
             maxActive="50" maxIdle="30" maxWait="10000" logAbandoned="true"
             username="root" password="123456" driverClassName="com.mysql.jdbc.Driver"
             url="jdbc:mysql://localhost:3306/mydb"/> 

(二)在web.xml中:
        
 <resource-ref>
  <description>DB1 Connection</description>
  <res-ref-name>jdbc/mysql1</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
   <description>DB2 Connection</description>
   <res-ref-name>jdbc/mysql2</res-ref-name>
   <res-type>javax.sql.DataSource</res-type>
   <res-auth>Container</res-auth>
</resource-ref> 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics