<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 閱讀(232) 評論(0)  編輯  收藏 所屬分類: 開源技術

    主站蜘蛛池模板: 粉色视频成年免费人15次| 亚洲阿v天堂在线2017免费| 4444亚洲国产成人精品| 成年免费a级毛片免费看无码| 免费v片在线观看品善网| 国产一级淫片a视频免费观看| 亚洲精品天堂在线观看| 97在线视频免费| 亚洲国产高清视频在线观看| 麻豆高清免费国产一区| 亚洲美女精品视频| 欧美三级在线电影免费| 亚洲AV无码一区二区三区电影| 国产免费一区二区三区VR| 免费国产黄网站在线看| 中国亚洲女人69内射少妇| 你好老叔电影观看免费| 亚洲AV无码乱码在线观看富二代| 久久精品国产亚洲AV麻豆不卡| 久久香蕉国产线看免费| 亚洲av片不卡无码久久| 国产美女精品视频免费观看| 免费在线人人电影网| 精品国产_亚洲人成在线高清| 亚洲精品国产首次亮相| 国产成人无码区免费网站| 亚洲AV日韩精品久久久久| 97久久免费视频| 久久精品亚洲日本波多野结衣| 久99精品视频在线观看婷亚洲片国产一区一级在线 | 免费一级毛片在级播放| 国精产品一区一区三区免费视频| 亚洲经典在线中文字幕| 国产一级做a爱免费视频| 光棍天堂免费手机观看在线观看| 亚洲乱码一二三四五六区| 日韩免费在线观看| 精品国产污污免费网站| 亚洲男人的天堂网站| 久久影视国产亚洲| 97碰公开在线观看免费视频|