<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Jeffrey's Sky

    Go with wind
    隨筆 - 14, 文章 - 1, 評論 - 15, 引用 - 0
    數據加載中……

    開源軟件問題記錄系列 之一 在 Tomcat 中設置 Datasource

    Tomcat提供了靈活且簡單的JNDI及Datasource設置方式。

    這里,記錄我在學習應用過程中的問題。

    1. 首先要在你的自己的應用程序中WEB-INF/web.xml 中添加一個Resource-ref, 指定Datasource 的 JNDI。
        <resource-ref>
          <description>DB Connection</description>
          <res-ref-name>jdbc/storedb</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
      </resource-ref>
    2. 在Tomcat的 config/context.xml中添加Resource。 (本例中使用的是MySql作為 DB)

       <!-- maxActive: Maximum number of dB connections in pool. Make sure you
             configure your mysqld max_connections large enough to handle
             all of your db connections. Set to -1 for no limit.
             -->

        <!-- maxIdle: Maximum number of idle dB connections to retain in pool.
             Set to -1 for no limit.  See also the DBCP documentation on this
             and the minEvictableIdleTimeMillis configuration parameter.
             -->

        <!-- maxWait: Maximum time to wait for a dB connection to become available
             in ms, in this example 10 seconds. An Exception is thrown if
             this timeout is exceeded.  Set to -1 to wait indefinitely.
             -->

        <!-- username and password: MySQL dB username and password for dB connections  -->

        <!-- driverClassName: Class name for the old mm.mysql JDBC driver is
             org.gjt.mm.mysql.Driver - we recommend using Connector/J though.
             Class name for the official MySQL Connector/J driver is com.mysql.jdbc.Driver.
             -->
       
        <!-- url: The JDBC connection url for connecting to your MySQL dB.
             -->

      <Resource name="jdbc/storedb" auth="Container" type="javax.sql.DataSource"
                   maxActive="100" maxIdle="30" maxWait="10000"
                   username="root" password="passw0rd" driverClassName="com.mysql.jdbc.Driver"
                   url="jdbc:mysql://localhost:3306/storedb"/>


    posted on 2010-08-02 10:51 Jeffrey Feng 閱讀(228) 評論(0)  編輯  收藏 所屬分類: 開源技術

    主站蜘蛛池模板: 最近2019免费中文字幕6| 国产精品高清免费网站| 精品福利一区二区三区免费视频| 国产亚洲午夜高清国产拍精品 | 精品少妇人妻AV免费久久洗澡| 亚洲日本在线免费观看| 黄+色+性+人免费| 亚洲成AV人片久久| 国产成人A在线观看视频免费| 亚洲w码欧洲s码免费| 黄瓜视频高清在线看免费下载| 亚洲综合在线一区二区三区| 日本特黄特黄刺激大片免费| 婷婷国产偷v国产偷v亚洲| 浮力影院亚洲国产第一页| 99免费精品视频| 噜噜噜亚洲色成人网站∨| 午夜国产精品免费观看| 亚洲乱妇熟女爽到高潮的片| 免费女人18毛片a级毛片视频| 亚洲精品视频免费观看| 亚洲人成在线电影| 最近的免费中文字幕视频| 美女视频黄频a免费观看| 国产亚洲色婷婷久久99精品91| 久久久久久久99精品免费| 亚洲制服丝袜在线播放| 又爽又高潮的BB视频免费看| 男女一进一出抽搐免费视频| 一级毛片大全免费播放下载| 亚洲色成人网站WWW永久| 84pao强力永久免费高清| 亚洲AV性色在线观看| 久久久久亚洲精品无码网址| 18禁美女黄网站色大片免费观看| 亚洲性无码一区二区三区| 亚洲日韩乱码中文无码蜜桃臀网站| 亚洲第一网站免费视频| 美女黄色免费网站| 亚洲国产av高清无码| 国产综合精品久久亚洲|