﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-JAVA牛棚-文章分类-开发工具区</title><link>http://www.blogjava.net/chinajox/category/4117.html</link><description>我们爱JAVA</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 14:13:30 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 14:13:30 GMT</pubDate><ttl>60</ttl><item><title>JBuilder自带Tomcat数据连接池配置</title><link>http://www.blogjava.net/chinajox/articles/16532.html</link><dc:creator>JAVA牛棚</dc:creator><author>JAVA牛棚</author><pubDate>Mon, 24 Oct 2005 01:53:00 GMT</pubDate><guid>http://www.blogjava.net/chinajox/articles/16532.html</guid><wfw:comment>http://www.blogjava.net/chinajox/comments/16532.html</wfw:comment><comments>http://www.blogjava.net/chinajox/articles/16532.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/chinajox/comments/commentRss/16532.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chinajox/services/trackbacks/16532.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt" align=center><SPAN lang=EN-US style="FONT-SIZE: 18pt">JBuilder</SPAN><SPAN style="FONT-SIZE: 18pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">自带</SPAN><SPAN lang=EN-US style="FONT-SIZE: 18pt">Tomcat</SPAN><SPAN style="FONT-SIZE: 18pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">数据连接池配置</SPAN><SPAN lang=EN-US style="FONT-SIZE: 18pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="FONT-SIZE: 18pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><SPAN style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作者</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt">: </SPAN><SPAN style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">双面人</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="FONT-SIZE: 14pt">QQ:147670662<o:p></o:p></SPAN></P><SPAN lang=EN-US style="FONT-SIZE: 18pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><BR style="PAGE-BREAK-BEFORE: always" clear=all></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">1.</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">数据库连接池需要</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">commons-dbcp-1.1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">commons-pool-1.1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这两个</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">jar</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包，确认</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">JBuilder</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序目录下的</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">thirdparty\jakarta-tomcat-4.1.24-LE-jdk14\common\lib</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下面有这两个</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">jar</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包。</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">2.</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">把</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">JDBC</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">驱动包</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">COPY</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">到</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">JBuilder</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序目录下的</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">thirdparty\jakarta-tomcat-4.1.24-LE-jdk14\common\lib</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里。</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">3.</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在你的</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">project</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下面有个</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">Tomcat</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">目录，需要添加数据连接池配置内容的文件是</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">webapps\jb-******.xml(******</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是你的</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">Web Module</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">名</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">需要注意的是，要把这个注释去掉</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><!--This comment marks this file as generated, so it may be deleted and regenerated at any time. To preserve manual changes to this file, delete this comment.--> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">4.</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我的</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">jb-*******.xml</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如下：</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><?xml version="1.0" encoding="UTF-8"?><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><Context debug="0" docBase="C:\temp\test22\pool" path="/WebModule1" reloadable="true" workDir="C:\temp\test22\Tomcat\work\WebModule1"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-tab-count: 1">       </SPAN><Resource name="jdbc/Test" auth="Container" type="javax.sql.DataSource"/><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-tab-count: 2">              </SPAN><ResourceParams name="jdbc/Test"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">            </SPAN><SPAN style="mso-tab-count: 1">       </SPAN><parameter><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">            </SPAN><SPAN style="mso-tab-count: 2">              </SPAN><name>username</name><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">            </SPAN><SPAN style="mso-tab-count: 2">              </SPAN><value>sa</value><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">            </SPAN><SPAN style="mso-tab-count: 1">       </SPAN></parameter><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">            </SPAN><SPAN style="mso-tab-count: 1">       </SPAN><parameter><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">            </SPAN><SPAN style="mso-tab-count: 2">              </SPAN><name>password</name><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-spacerun: yes">           </SPAN><SPAN style="mso-tab-count: 2">              </SPAN><value>angeng749</value><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">            </SPAN><SPAN style="mso-tab-count: 1">       </SPAN></parameter><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">            </SPAN><SPAN style="mso-tab-count: 1">       </SPAN><parameter><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">            </SPAN><SPAN style="mso-tab-count: 2">              </SPAN><name>driverClassName</name><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-tab-count: 3">                     </SPAN><value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-tab-count: 2">              </SPAN></parameter><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">            </SPAN><SPAN style="mso-tab-count: 1">       </SPAN><parameter><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">            </SPAN><SPAN style="mso-tab-count: 2">              </SPAN><name>url</name><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-tab-count: 3">                     </SPAN><value>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs</value><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-tab-count: 2">              </SPAN></parameter><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">                </SPAN><parameter><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">                        </SPAN><name>factory</name><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-tab-count: 3">                     </SPAN><value>org.apache.commons.dbcp.BasicDataSourceFactory</value><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-tab-count: 2">              </SPAN></parameter><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">     </SPAN><SPAN style="mso-tab-count: 1">     </SPAN></ResourceParams><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"></Context>5.</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt">web-info\web.xml</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下添加如下内容：</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><resource-ref><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">    </SPAN><description>SqlServer Datasource example</description><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">    </SPAN><res-ref-name>jdbc/Test</res-ref-name><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">    </SPAN><res-type>javax.sql.DataSource</res-type><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><SPAN style="mso-spacerun: yes">    </SPAN><res-auth>Container</res-auth><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"></resource-ref><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">好象这样就差不多啦。</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P><img src ="http://www.blogjava.net/chinajox/aggbug/16532.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chinajox/" target="_blank">JAVA牛棚</a> 2005-10-24 09:53 <a href="http://www.blogjava.net/chinajox/articles/16532.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>