ï»??xml version="1.0" encoding="utf-8" standalone="yes"?>在线国产精品播放,www.久久东京,99成人在线视频http://www.aygfsteel.com/niuniu/zh-cnThu, 03 Jul 2025 07:12:36 GMTThu, 03 Jul 2025 07:12:36 GMT60- Tomcat5.5æ•°æ®æºé…¾|?/title><link>http://www.aygfsteel.com/niuniu/archive/2009/02/05/JDBCDataSources.html</link><dc:creator>ç‰?-ç‰?/dc:creator><author>ç‰?-ç‰?/author><pubDate>Thu, 05 Feb 2009 14:04:00 GMT</pubDate><guid>http://www.aygfsteel.com/niuniu/archive/2009/02/05/JDBCDataSources.html</guid><wfw:comment>http://www.aygfsteel.com/niuniu/comments/253455.html</wfw:comment><comments>http://www.aygfsteel.com/niuniu/archive/2009/02/05/JDBCDataSources.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/niuniu/comments/commentRss/253455.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/niuniu/services/trackbacks/253455.html</trackback:ping><description><![CDATA[<p> å¼€å‘环å¢?<br />
MyEclipse5.5<br />
Tomcat5.5<br />
MsSql2000</p>
æ•°æ®æºé…¾|®åƈä¸éš¾,相对æ¥è¯´æ¯”较éºÈƒ¦(ch¨³),别å“ç€äº?其实ž®±æ˜¯å¤šä¸ªåœ°æ–¹æ‹¯‚´.<br />
<br />
在Tomcat安装目录扑ֈ°confæ–‡äšg夹下的server.xml.打开在Host节点下编è¾?
<div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff"><</span><span style="color: #800000">Resource <br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #ff0000">name</span><span style="color: #0000ff">="jdbc/emp"</span><span style="color: #ff0000"> <br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />auth</span><span style="color: #0000ff">="Container"</span><span style="color: #ff0000"><br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />type</span><span style="color: #0000ff">="javax.sql.DataSource"</span><span style="color: #ff0000"> <br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />username</span><span style="color: #0000ff">="sa"</span><span style="color: #ff0000"><br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />password</span><span style="color: #0000ff">="sa"</span><span style="color: #ff0000"><br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />driverClassName</span><span style="color: #0000ff">="com.microsoft.jdbc.sqlserver.SQLServerDriver"</span><span style="color: #ff0000"> url</span><span style="color: #0000ff">="jdbc:microsoft:sqlserver://localhost;DatabaseName=pubs"</span><span style="color: #ff0000"> <br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />maxActive</span><span style="color: #0000ff">="8"</span><span style="color: #ff0000"> <br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />maxIdle</span><span style="color: #0000ff">="4"</span><span style="color: #ff0000"><br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">/></span></div>
name:属性值å¯éšæ„å–å€?但ä¸å…许为空.<br />
除Auth属性值固定其它都éšéœ€æ±‚而å˜.<br />
例如:usernameçš„å€?éšä½ æ•°æ®åº“登录å而å˜åŠ?<br />
接下æ?我们需è¦åœ¨Tomcat 5.5\conf\Catalina\localhost路径下新å»ÞZ¸€ä¸ªå’Œå·¥ç¨‹ååŒæ ïL(f¨¥ng)š„xmlæ–‡äšg.<br />
å‡è®¾ä½ 新建的Web工程åå«JdbcDataSource,则JdbcDataSource.xml.<br />
<div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff"><?</span><span style="color: #ff00ff">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000ff">?></span><span style="color: #000000"><br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><</span><span style="color: #800000">Context</span><span style="color: #0000ff">></span><span style="color: #000000"><br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><</span><span style="color: #800000">Resource <br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #ff0000">name</span><span style="color: #0000ff">="jdbc/emp"</span><span style="color: #ff0000"> <br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />auth</span><span style="color: #0000ff">="Container"</span><span style="color: #ff0000"><br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />type</span><span style="color: #0000ff">="javax.sql.DataSource"</span><span style="color: #ff0000"> <br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />username</span><span style="color: #0000ff">="sa"</span><span style="color: #ff0000"> <br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />password</span><span style="color: #0000ff">="sa"</span><span style="color: #ff0000"><br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />driverClassName</span><span style="color: #0000ff">="com.microsoft.jdbc.sqlserver.SQLServerDriver"</span><span style="color: #ff0000"> url</span><span style="color: #0000ff">="jdbc:microsoft:sqlserver://localhost;DatabaseName=pubs"</span><span style="color: #ff0000"> <br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />maxActive</span><span style="color: #0000ff">="8"</span><span style="color: #ff0000"> <br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />maxIdle</span><span style="color: #0000ff">="4"</span><span style="color: #ff0000"><br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">/></span><span style="color: #000000"><br />
<img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div>
看清楚了(ji¨£n)å?其实ž®±æ˜¯æŠŠä½ 在server.xml输入的拷è´è¿‡æ¥å°±æ˜¯äº†(ji¨£n).<br />
好了(ji¨£n),我们现在切æ¢åˆ°IDE,在当å‰çš„工程web.xml下冘q›è¡Œä¸€‹Æ¡é…¾|?<br />
<div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff"><</span><span style="color: #800000">resource-ref</span><span style="color: #0000ff">></span><span style="color: #000000"><br />
<img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> </span><span style="color: #0000ff"><</span><span style="color: #800000">res-ref-name</span><span style="color: #0000ff">></span><span style="color: #000000">jdbc/emp</span><span style="color: #0000ff"></</span><span style="color: #800000">res-ref-name</span><span style="color: #0000ff">></span><span style="color: #000000"><br />
<img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> </span><span style="color: #0000ff"><</span><span style="color: #800000">res-type</span><span style="color: #0000ff">></span><span style="color: #000000">javax.sql.DataSource</span><span style="color: #0000ff"></</span><span style="color: #800000">res-type</span><span style="color: #0000ff">></span><span style="color: #000000"><br />
<img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> </span><span style="color: #0000ff"><</span><span style="color: #800000">res-auth</span><span style="color: #0000ff">></span><span style="color: #000000">Container</span><span style="color: #0000ff"></</span><span style="color: #800000">res-auth</span><span style="color: #0000ff">></span><span style="color: #000000"><br />
<img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"></</span><span style="color: #800000">resource-ref</span><span style="color: #0000ff">></span><span style="color: #000000"> </span></div>
一切酾|®Ok,æŽ¥ä¸‹æ¥æˆ‘们楋¹‹è¯•是å¦å¯è¡Œ.<br />
<div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><span style="color: #008080"> 1</span><img id="Codehighlighter1_0_59_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_59_Open_Text.style.display='none'; Codehighlighter1_0_59_Closed_Image.style.display='inline'; Codehighlighter1_0_59_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_0_59_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_0_59_Closed_Text.style.display='none'; Codehighlighter1_0_59_Open_Image.style.display='inline'; Codehighlighter1_0_59_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span id="Codehighlighter1_0_59_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/** */</span><span id="Codehighlighter1_0_59_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br />
</span><span style="color: #008080"> 2</span><span style="color: #008000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> * Tomcat5.5˜qžæŽ¥æ± é…¾|?br />
</span><span style="color: #008080"> 3</span><span style="color: #008000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> * æ•°æ®åº“䨓(f¨´)Ms2000<br />
</span><span style="color: #008080"> 4</span><span style="color: #008000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> * </span><span style="color: #808080">@author</span><span style="color: #008000"> NiuNiu<br />
</span><span style="color: #008080"> 5</span><span style="color: #008000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> *<br />
</span><span style="color: #008080"> 6</span><span style="color: #008000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
</span><span style="color: #008080"> 7</span><span style="color: #000000"><img id="Codehighlighter1_89_629_Open_Image" onclick="this.style.display='none'; Codehighlighter1_89_629_Open_Text.style.display='none'; Codehighlighter1_89_629_Closed_Image.style.display='inline'; Codehighlighter1_89_629_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_89_629_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_89_629_Closed_Text.style.display='none'; Codehighlighter1_89_629_Open_Image.style.display='inline'; Codehighlighter1_89_629_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> Tomcat5_5_Pool </span><span id="Codehighlighter1_89_629_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_89_629_Open_Text"><span style="color: #000000">{ <br />
</span><span style="color: #008080"> 8</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> Connection getConnection()<br />
</span><span style="color: #008080"> 9</span><span style="color: #000000"><img id="Codehighlighter1_135_627_Open_Image" onclick="this.style.display='none'; Codehighlighter1_135_627_Open_Text.style.display='none'; Codehighlighter1_135_627_Closed_Image.style.display='inline'; Codehighlighter1_135_627_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_135_627_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_135_627_Closed_Text.style.display='none'; Codehighlighter1_135_627_Open_Image.style.display='inline'; Codehighlighter1_135_627_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> </span><span id="Codehighlighter1_135_627_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_135_627_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">10</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> Connection con</span><span style="color: #000000">=</span><span style="color: #0000ff">null</span><span style="color: #000000">; <br />
</span><span style="color: #008080">11</span><span style="color: #000000"><img id="Codehighlighter1_168_516_Open_Image" onclick="this.style.display='none'; Codehighlighter1_168_516_Open_Text.style.display='none'; Codehighlighter1_168_516_Closed_Image.style.display='inline'; Codehighlighter1_168_516_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_168_516_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_168_516_Closed_Text.style.display='none'; Codehighlighter1_168_516_Open_Image.style.display='inline'; Codehighlighter1_168_516_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> </span><span style="color: #0000ff">try</span><span style="color: #000000"> </span><span id="Codehighlighter1_168_516_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_168_516_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">12</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span><span style="color: #008000">//</span><span style="color: #008000">åˆå§‹åŒ–查æ‰?/span><span style="color: #008000"><br />
</span><span style="color: #008080">13</span><span style="color: #008000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000"> Context initCtx </span><span style="color: #000000">=</span><span style="color: #0000ff">new</span><span style="color: #000000"> InitialContext();<br />
</span><span style="color: #008080">14</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span><span style="color: #008000">//</span><span style="color: #008000">得到dataSource</span><span style="color: #008000"><br />
</span><span style="color: #008080">15</span><span style="color: #008000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000"> Context envCtx </span><span style="color: #000000">=</span><span style="color: #000000">(Context)initCtx.lookup(</span><span style="color: #000000">"</span><span style="color: #000000">java:comp/env</span><span style="color: #000000">"</span><span style="color: #000000">);<br />
</span><span style="color: #008080">16</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> DataSource dataSource</span><span style="color: #000000">=</span><span style="color: #000000">(DataSource)envCtx.lookup(</span><span style="color: #000000">"</span><span style="color: #000000">jdbc/emp</span><span style="color: #000000">"</span><span style="color: #000000">); <br />
</span><span style="color: #008080">17</span><span style="color: #000000"><img id="Codehighlighter1_377_418_Open_Image" onclick="this.style.display='none'; Codehighlighter1_377_418_Open_Text.style.display='none'; Codehighlighter1_377_418_Closed_Image.style.display='inline'; Codehighlighter1_377_418_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_377_418_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_377_418_Closed_Text.style.display='none'; Codehighlighter1_377_418_Open_Image.style.display='inline'; Codehighlighter1_377_418_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> </span><span style="color: #0000ff">try</span><span style="color: #000000"> </span><span id="Codehighlighter1_377_418_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_377_418_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">18</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> con</span><span style="color: #000000">=</span><span style="color: #000000">dataSource.getConnection();<br />
</span><span style="color: #008080">19</span><span style="color: #000000"><img id="Codehighlighter1_443_512_Open_Image" onclick="this.style.display='none'; Codehighlighter1_443_512_Open_Text.style.display='none'; Codehighlighter1_443_512_Closed_Image.style.display='inline'; Codehighlighter1_443_512_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_443_512_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_443_512_Closed_Text.style.display='none'; Codehighlighter1_443_512_Open_Image.style.display='inline'; Codehighlighter1_443_512_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> }</span></span><span style="color: #000000"> </span><span style="color: #0000ff">catch</span><span style="color: #000000"> (SQLException e) </span><span id="Codehighlighter1_443_512_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_443_512_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">20</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span><span style="color: #008000">//</span><span style="color: #008000"> TODO Auto-generated catch block</span><span style="color: #008000"><br />
</span><span style="color: #008080">21</span><span style="color: #008000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000"> e.printStackTrace();<br />
</span><span style="color: #008080">22</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /> }</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">23</span><span style="color: #000000"><img id="Codehighlighter1_544_610_Open_Image" onclick="this.style.display='none'; Codehighlighter1_544_610_Open_Text.style.display='none'; Codehighlighter1_544_610_Closed_Image.style.display='inline'; Codehighlighter1_544_610_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_544_610_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_544_610_Closed_Text.style.display='none'; Codehighlighter1_544_610_Open_Image.style.display='inline'; Codehighlighter1_544_610_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> }</span></span><span style="color: #000000"> </span><span style="color: #0000ff">catch</span><span style="color: #000000"> (NamingException e) </span><span id="Codehighlighter1_544_610_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_544_610_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">24</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span><span style="color: #008000">//</span><span style="color: #008000"> TODO Auto-generated catch block</span><span style="color: #008000"><br />
</span><span style="color: #008080">25</span><span style="color: #008000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000"> e.printStackTrace();<br />
</span><span style="color: #008080">26</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /> }</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">27</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span><span style="color: #0000ff">return</span><span style="color: #000000"> con;<br />
</span><span style="color: #008080">28</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /> }</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">29</span><span style="color: #000000"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div>
如果getConnection()æ–ÒŽ(gu¨©)³•˜q”回éžç©º,ž®Þp¡¨½Cºæˆ‘们上˜q°åšçš„æ“ä½œéƒ½æ£ç¡®äº?<br />
<br />
注æ„:<br />
æˆ‘ä»¬éœ€è¦æŠŠDBé©±åŠ¨åŒ…ä¹Ÿè¦æ‹·è´åˆ°Tomcat 5.5\common\lib目录ä¸?<br />
Context envCtx =(Context)initCtx.lookup("java:comp/env");<br />
DataSource dataSource=(DataSource)envCtx.lookup("jdbc/emp"); <br />
java:comp/env是固定的,但在WebLogicæœåŠ¡å™¨åˆ™å¯ä»¥ä¸éœ€è¦å†™ä¸?<br />
jdbc/empž®±æ˜¯ä½ 所注册的åå•?<br />
å‚考资æ–?<a >http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html</a>
<img src ="http://www.aygfsteel.com/niuniu/aggbug/253455.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/niuniu/" target="_blank">ç‰?-ç‰?/a> 2009-02-05 22:04 <a href="http://www.aygfsteel.com/niuniu/archive/2009/02/05/JDBCDataSources.html#Feedback" target="_blank" style="text-decoration:none;">å‘表评论</a></div>]]></description></item></channel></rss> <footer>
<div class="friendship-link">
<a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a>
</div>
</footer>
Ö÷Õ¾Ö©Öë³ØÄ£°å£º
<a href="http://" target="_blank">ãþÑôÏØ</a>|
<a href="http://" target="_blank">ºÓÎ÷Çø</a>|
<a href="http://" target="_blank">°²ÇìÊÐ</a>|
<a href="http://" target="_blank">Âé³ÇÊÐ</a>|
<a href="http://" target="_blank">³çÀñÏØ</a>|
<a href="http://" target="_blank">ÄÏÕÄÏØ</a>|
<a href="http://" target="_blank">¿µÂíÏØ</a>|
<a href="http://" target="_blank">ÓÀ¿µÊÐ</a>|
<a href="http://" target="_blank">´ó¶É¿ÚÇø</a>|
<a href="http://" target="_blank">ÄϾ©ÊÐ</a>|
<a href="http://" target="_blank">ºþÄÏÊ¡</a>|
<a href="http://" target="_blank">ÇçÂ¡ÏØ</a>|
<a href="http://" target="_blank">Æ½Ì¶ÏØ</a>|
<a href="http://" target="_blank">ÓÀÖÝÊÐ</a>|
<a href="http://" target="_blank">Äþ¹úÊÐ</a>|
<a href="http://" target="_blank">ÎÅÏ²ÏØ</a>|
<a href="http://" target="_blank">¹óÄÏÏØ</a>|
<a href="http://" target="_blank">ÔÆÃÎÏØ</a>|
<a href="http://" target="_blank">½¨ê±ÊÐ</a>|
<a href="http://" target="_blank">ÒËÀ¼ÏØ</a>|
<a href="http://" target="_blank">½ÃÅÊÐ</a>|
<a href="http://" target="_blank">äàË®ÏØ</a>|
<a href="http://" target="_blank">¸ÞÀ¼ÏØ</a>|
<a href="http://" target="_blank">Áú´¨ÏØ</a>|
<a href="http://" target="_blank">Î÷¹±Çø</a>|
<a href="http://" target="_blank">ãòË®ÏØ</a>|
<a href="http://" target="_blank">¶«¸ÛÊÐ</a>|
<a href="http://" target="_blank">ÓÀÉÆÏØ</a>|
<a href="http://" target="_blank">ÉòÑôÊÐ</a>|
<a href="http://" target="_blank">ºÓ³ØÊÐ</a>|
<a href="http://" target="_blank">³É°²ÏØ</a>|
<a href="http://" target="_blank">½¨ê±ÊÐ</a>|
<a href="http://" target="_blank">Ìï¶«ÏØ</a>|
<a href="http://" target="_blank">¿í³Ç</a>|
<a href="http://" target="_blank">ÁÙÎ÷ÏØ</a>|
<a href="http://" target="_blank">¹ó¸ÛÊÐ</a>|
<a href="http://" target="_blank">ƽ¹ûÏØ</a>|
<a href="http://" target="_blank">ÖÓÉ½ÏØ</a>|
<a href="http://" target="_blank">²©°×ÏØ</a>|
<a href="http://" target="_blank">»ªÈÝÏØ</a>|
<a href="http://" target="_blank">ÃöºîÏØ</a>|
<script>
(function(){
var bp = document.createElement('script');
var curProtocol = window.location.protocol.split(':')[0];
if (curProtocol === 'https') {
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
}
else {
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
</script>
</body>