1首先要有相應的jdbc
          2.用tomcat的控制臺配置數據源。
          3.到tomcat/conf下添加context。xml
          內容如下:<Context>
          ??? <WatchedResource>WEB-INF/web.xml</WatchedResource>
          ??? <Resource??? name="jdbc/mysql"??? type="javax.sql.DataSource"??? password="sa"??? driverClassName="com.mysql.jdbc.Driver"??? maxIdle="2"??? maxWait="5000"??? username="root"??? url="jdbc:mysql://127.0.0.1/test"??? maxActive="4" />

          </Context>
          4。配置你相應的項目的web。xml添加:
          <resource-ref>
          ? ?<description>DB Connection</description>
          ? ?<res-ref-name>jdbc/mysql</res-ref-name>
          ? ?<res-type>javax.sql.DataSource</res-type>
          ? ?<res-auth>Container</res-auth>? ?
          ? ?<res-sharing-scope>Shareable</res-sharing-scope>
          ? </resource-ref>
          Ok!

          posted on 2006-12-14 11:11 yt 閱讀(325) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          統計

          主站蜘蛛池模板: 郑州市| 黄龙县| 台安县| 平果县| 郑州市| 山丹县| 阜南县| 潞西市| 视频| 东乌珠穆沁旗| 宝丰县| 隆德县| 固原市| 吉木乃县| 锡林浩特市| 怀宁县| 建瓯市| 武义县| 海兴县| 育儿| 林芝县| 江陵县| 阿城市| 曲水县| 宁陵县| 新民市| 桂林市| 饶河县| 重庆市| 通榆县| 沙坪坝区| 辉南县| 德保县| 吴堡县| 唐海县| 桦川县| 全南县| 安庆市| 中牟县| 新昌县| 原平市|