日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

tomcat數(shù)據(jù)源的配置--摘抄自官方網(wǎng)站

系統(tǒng) 2282 0
TOmcat5.0和Tomcat5.5在server.xml的寫法不同如下(來自Tomcat官方網(wǎng)站)
Tomcat5.0

server.xml:

<Context?path="/DBTest"?docBase="DBTest"
????????debug="5"?reloadable="true"?crossContext="true">

??<Logger?className="org.apache.catalina.logger.FileLogger"
?????????????prefix="localhost_DBTest_log."?suffix=".txt"
?????????????timestamp="true"/>

??<Resource?name="jdbc/TestDB"
???????????????auth="Container"
???????????????type="javax.sql.DataSource"/>

??<ResourceParams?name="jdbc/TestDB">
????<parameter>
??????<name>factory</name>
??????<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
????</parameter>

????<!--?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?0?for?no?limit.
?????????-->
????<parameter>
??????<name>maxActive</name>
??????<value>100</value>
????</parameter>

????<!--?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.
?????????-->
????<parameter>
??????<name>maxIdle</name>
??????<value>30</value>
????</parameter>

????<!--?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.
?????????-->
????<parameter>
??????<name>maxWait</name>
??????<value>10000</value>
????</parameter>

????<!--?MySQL?dB?username?and?password?for?dB?connections??-->
????<parameter>
?????<name>username</name>
?????<value>javauser</value>
????</parameter>
????<parameter>
?????<name>password</name>
?????<value>javadude</value>
????</parameter>

????<!--?Class?name?for?the?old?mm.mysql?JDBC?driver?-?uncomment?this?entry?and?comment?next
?????????if?you?want?to?use?this?driver?-?we?recommend?using?Connector/J?though
????<parameter>
???????<name>driverClassName</name>
???????<value>org.gjt.mm.mysql.Driver</value>
????</parameter>
?????-->
????
????<!--?Class?name?for?the?official?MySQL?Connector/J?driver?-->
????<parameter>
???????<name>driverClassName</name>
???????<value>com.mysql.jdbc.Driver</value>
????</parameter>
????
????<!--?The?JDBC?connection?url?for?connecting?to?your?MySQL?dB.
?????????The?autoReconnect=true?argument?to?the?url?makes?sure?that?the
?????????mm.mysql?JDBC?Driver?will?automatically?reconnect?if?mysqld?closed?the
?????????connection.??mysqld?by?default?closes?idle?connections?after?8?hours.
?????????-->
????<parameter>
??????<name>url</name>
??????<value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
????</parameter>
??</ResourceParams>
</Context>

TOmcat5.5-Server.xml
<Context?path="/DBTest"?docBase="DBTest"
????????debug="5"?reloadable="true"?crossContext="true">
??<Resource?name="jdbc/TestDB"?auth="Container"?type="javax.sql.DataSource"
???????????????maxActive="100"?maxIdle="30"?maxWait="10000"
???????????????username="javauser"?password="javadude"?driverClassName="com.mysql.jdbc.Driver"
???????????????url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>

</Context>


在web.xml中的配置都是一樣的:
添加:
<resource-ref>
??????<description>DB?Connection</description>
??????<res-ref-name>jdbc/TestDB</res-ref-name>
??????<res-type>javax.sql.DataSource</res-type>
??????<res-auth>Container</res-auth>
??</resource-ref>

tomcat數(shù)據(jù)源的配置--摘抄自官方網(wǎng)站


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 建始县| 唐河县| 格尔木市| 普格县| 商城县| 三门县| 新竹县| 富锦市| 和平区| 丰台区| 包头市| 麻栗坡县| 松桃| 山丹县| 巨野县| 苗栗市| 呼伦贝尔市| 湟中县| 徐州市| 饶平县| 邢台市| 长乐市| 石门县| 平果县| 额敏县| 张家口市| 望奎县| 九龙坡区| 壤塘县| 庆阳市| 天柱县| 会东县| 新乡市| 遂溪县| 慈利县| 奉贤区| 普安县| 松阳县| 巴塘县| 克东县| 资阳市|