<?xml version="1.0" encoding="UTF-8"?>
<!– The contents of this file will be loaded for each web application –>
<context>
<!– Default set of monitored resources 172.16.5.28:KM–>
<watchedresource>WEB-INF/web.xml</watchedresource>
<resource?
???????? name="jdbc/test"
???????? auth="Container"
???????? type="javax.sql.DataSource"
???????? maxactive="500"
???????? maxidle="30"
???????? maxwait="10000"
???????? username="test"
???????? password="test
???????? driverClassName="oracle.jdbc.OracleDriver"
???????? url="jdbc:oracle:thin:@localhost:1521:orcl">
</resource>
</context>
然后附件中的文件就派上用場(chǎng)了(encrypt2.bat,commons-dbcp-1.2.2.jar和commons-pool-1.4.jar )
1、進(jìn)入tomcat的安裝目錄: tomcatroot\common\lib
2、復(fù)制encrypt2.bat和commons-dbcp-1.2.2.jar和commons-pool-1.4.jar 進(jìn)入該目錄
3、進(jìn)入cmd狀態(tài),切換入tomcatroot\common\lib目錄 ,非常重要的是需要把webapps下面的各個(gè)應(yīng)用里面的重復(fù)的jar刪掉也就是要把所有的字母里面的commons-dbcp*.jar和commons-pool*.jar刪掉
4、輸入encrypt2.bat test (test)還是原密碼,界面上會(huì)輸出:
test 加密后: jAVagnSq2eQ=
test 解密后: test
5、修改context.xml password="jAVagnSq2eQ=" 并注意增加一行: factory="org.apache.commons.dbcp.BasicDataSourceFactory"
那么我們最后的配置就是:
<?xml version="1.0" encoding="UTF-8"?>
<!– The contents of this file will be loaded for each web application –>
<context>
<!– Default set of monitored resources 172.16.5.28:KM–>
<watchedresource>WEB-INF/web.xml</watchedresource>
<resource
?????????? name="jdbc/test"
?????????? auth="Container"
?????????? type="javax.sql.DataSource"
?????????? maxactive="500" maxidle="30"
?????????? maxwait="10000"
?????????? username="test"
?????????? password="jAVagnSq2eQ="
?????????? driverClassName="oracle.jdbc.OracleDriver"
?????????? factory="org.apache.commons.dbcp.BasicDataSourceFactory"??????????????
?????????? url="jdbc:oracle:thin:@localhost:1521:orcl">
</resource>
</context>
好了,重啟試試吧
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元
