`
antjava2010
  • 浏览: 49789 次
  • 性别: Icon_minigender_1
  • 来自: 株洲
文章分类
社区版块
存档分类
最新评论

数据源配置

 
阅读更多

1:tomcat——context.xml

 

<Resource name="jdbc/struts" auth="Container"

                type="javax.sql.DataSource"

                driverClassName="com.mysql.jdbc.Driver"

                url="jdbc:mysql://localhost:3306/struts?characterEncoding=utf8"

                username="root"

                password="root"              

                maxActive="200"

                maxIdle="50"

                maxWait="3000"/>

 

 

 

2:web.xml

<resource-ref>

      <description>DB Connection</description>

      <res-ref-name>jdbc/struts</res-ref-name>

      <res-type>javax.sql.DataSource</res-type>

      <res-auth>Container</res-auth>

  </resource-ref>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics