zoukankan      html  css  js  c++  java
  • tomcat6.0 数据源的配置

    tomcat数据源的配置方式有多种。

    以下是其中一种配置方式:

    各个版本的tomcat的数据源的配置也是有区别的,请注意我这里的tomcat版本是6.0的。

    1,首先找到tomcat数据源的配置文件

    tomcat安装路径\context.xml

    例如我的是E:\tomcat6\conf

    E:\tomcat就是我的tomcat的安装路径

    2.配置文件如下:

    <?xml version='1.0' encoding='utf-8'?>
    
    <!-- The contents of this file will be loaded for each web application -->
    <Context>
       <Resource   name="jdbc/erp" auth="Container" type="javax.sql.DataSource"
                   maxActive="100" maxIdle="30" maxWait="10000"
                   username="root" password="root" 
                   driverClassName="com.mysql.jdbc.Driver"
                   url="jdbc:mysql://127.0.0.1:3306/erp"/>           
        <!-- Default set of monitored resources -->
        <WatchedResource>WEB-INF/web.xml</WatchedResource>
    	
        <!-- Uncomment this to disable session persistence across Tomcat restarts -->
        <!--
        <Manager pathname="" />
        -->
    
        <!-- Uncomment this to enable Comet connection tacking (provides events
             on session expiration as well as webapp lifecycle) -->
        <!--
        <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
        -->
    </Context>


    中间的注释可以省略,不过个人觉得留着更好。

  • 相关阅读:
    lua 逻辑运算 and, or, not
    redis和memcache列出所有key
    Linux protobuf
    CGI,FastCGI,PHP-CGI与PHP-FPM
    lua使用笔记2:Linux 中安装php的lua扩展
    lua使用笔记1:Linux 中安装lua
    Android APK反编译详解
    git 常用命令
    git push 403错误解决方法
    linux(centos)搭建SVN服务器
  • 原文地址:https://www.cnblogs.com/mengjianzhou/p/5986876.html
Copyright © 2011-2022 走看看