1首先要有相應的jdbc
          2.用tomcat的控制臺配置數(shù)據(jù)源。
          3.到tomcat/conf下添加context。xml
          內(nèi)容如下:<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)  編輯  收藏

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


          網(wǎng)站導航:
           

          統(tǒng)計

          主站蜘蛛池模板: 鹿邑县| 敦煌市| 汪清县| 漳浦县| 鸡泽县| 都昌县| 通渭县| 井陉县| 彭泽县| 德保县| 祁东县| 蓝田县| 普安县| 凤凰县| 郁南县| 中牟县| 建德市| 积石山| 梓潼县| 咸丰县| 丹东市| 新竹市| 绵竹市| 嵊州市| 秦皇岛市| 个旧市| 宁阳县| 叶城县| 宁安市| 云阳县| 扎兰屯市| 平邑县| 六盘水市| 正镶白旗| 当阳市| 咸宁市| 太康县| 河源市| 汶川县| 堆龙德庆县| 武宁县|