锘??xml version="1.0" encoding="utf-8" standalone="yes"?>午夜精品一区二区三区三上悠亚,久久久久久久久久久久久夜,麻豆影视在线http://www.aygfsteel.com/123xxx/category/9878.htmljust for javazh-cnFri, 02 Mar 2007 05:00:26 GMTFri, 02 Mar 2007 05:00:26 GMT60webwork涓璲stl鐨勪嬌鐢?/title><link>http://www.aygfsteel.com/123xxx/articles/webwork-jstl.html</link><dc:creator>OO</dc:creator><author>OO</author><pubDate>Thu, 17 Aug 2006 08:34:00 GMT</pubDate><guid>http://www.aygfsteel.com/123xxx/articles/webwork-jstl.html</guid><wfw:comment>http://www.aygfsteel.com/123xxx/comments/64150.html</wfw:comment><comments>http://www.aygfsteel.com/123xxx/articles/webwork-jstl.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/123xxx/comments/commentRss/64150.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/123xxx/services/trackbacks/64150.html</trackback:ping><description><![CDATA[涓鑸儏鍐典笅webwork鐨勬爣絳捐凍澶熸敮鎸侀〉闈㈠紑鍙戠殑闇瑕侊紝鑰屼笖榪欎簺鏍囩涔熻凍澶熺伒媧誨拰寮哄ぇ銆備絾鏄諱細鏈変竴浜涚壒孌婄殑鎯呭喌璁╀綘涓嶅緱涓嶄嬌鐢╦stl鏉ュ鐞唚ebwork鐨剉aluestack涓殑鏁版嵁銆傞偅涔堟庝箞鏍鋒墠鑳藉浣跨敤JSTL鏉ュ彇寰梬ebwork鐨勬暟鎹憿錛熷湪webwork鐨刉IKI涓婇潰鐪嬪埌榪囦嬌鐢ㄦ嫤鎴櫒灝唙aluestack鐨勬暟鎹彇鍑烘潵鍦ㄩ噸鏂版斁鍒皉equest閲岄潰鐨勬柟娉曘傜洰鐨勬槸鑳藉杈懼埌浜嗭紝浣嗘槸灝變負浜嗚繖涔堜竴鐐瑰皬浜嬮渶瑕佸啓涓涓嫤鎴櫒錛屽啀淇敼閰嶇疆鏂囦歡錛屽ソ鍍忎笉澶煎緱銆傚湪涓欏縢oogle涔嬪悗緇堜簬鎵懼埌浜嗕竴涓畝鍗曟槗琛岀殑鏂規硶銆傛鏂規硶鏈鍏堜粠<a >http://www.jroller.com/page/jcarreira?anchor=re_comments_to_struts_vs</a>榪欎釜緗戝潃鐪嬪埌鐨勩?br /><br />聽聽<ww:set name="test" value="pageNum" scope="page"/><br />聽聽ww:<ww:property value="#test"/><br />聽聽EL:${test}<br />聽聽jstl:<c:out value="${test}"></c:out><br />聽聽jsp:<%=pageContext.getAttribute("test")%><br /><br /><br />灝卞儚涓婇潰鐨勪緥瀛愶紝鍙渶瑕佺畝鍗曞湴灝嗗瓨鏀懼湪webwork鐨剉aluestack涓殑鍊煎彇鍑烘潵錛宻et鍒皃age鎴栬卹equest,session閲岄潰錛屽氨鍙互浣跨敤EL 錛孞STL 錛宩sp絳夊緢綆鍗曠殑鍙栧嚭鏉ヤ簡銆俿<br /><img src ="http://www.aygfsteel.com/123xxx/aggbug/64150.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/123xxx/" target="_blank">OO</a> 2006-08-17 16:34 <a href="http://www.aygfsteel.com/123xxx/articles/webwork-jstl.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>common-pool鐨勪嬌鐢?/title><link>http://www.aygfsteel.com/123xxx/articles/40617.html</link><dc:creator>OO</dc:creator><author>OO</author><pubDate>Wed, 12 Apr 2006 05:08:00 GMT</pubDate><guid>http://www.aygfsteel.com/123xxx/articles/40617.html</guid><wfw:comment>http://www.aygfsteel.com/123xxx/comments/40617.html</wfw:comment><comments>http://www.aygfsteel.com/123xxx/articles/40617.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/123xxx/comments/commentRss/40617.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/123xxx/services/trackbacks/40617.html</trackback:ping><description><![CDATA[榪欎釜鍏跺疄娌℃庝箞浠旂粏鐮旂┒錛屼笉榪囧ソ鍍忎篃鎸虹畝鍗曠殑錛屼笅闈㈡槸涓涓畝鍗曠殑渚嬪瓙銆傦紙鍙兘榪樻湁鍏朵粬鏇寸畝鍗曠殑鐢ㄦ硶錛岀瓑鎴戠湅瀹屾簮浠g爜鍐嶈錛?br /><br />1銆傝嚜宸卞疄鐜頒竴涓?span style="color: rgb(0, 0, 0);">PoolableObjectFactory銆備富瑕佹槸瀹炵幇</span><span style="color: rgb(0, 0, 0);">makeObject鏂規硶錛岀敓鎴愬茍榪斿洖涓涓嚜宸辨兂瑕佺殑綾誨疄渚嬨傚鏋滄兂瑕佸疄鐜板彲閲嶇敤涔熷緢綆鍗曪紝鍔犱竴涓猻etObject鐨勬柟娉曪紝鐒跺悗鍦?/span><span style="color: rgb(0, 0, 0);">makeObject涓嬌鐢ㄥ弽灝勬満鍒剁敓鎴愮被鐨勫疄渚嬨?/span><br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">package</span><span style="color: rgb(0, 0, 0);">聽com.pool;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽org.apache.commons.pool.PoolableObjectFactory;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽com.domain.User;<br /><br /></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽MyObjectFactory聽</span><span style="color: rgb(0, 0, 255);">implements</span><span style="color: rgb(0, 0, 0);">聽PoolableObjectFactory聽{<br /><br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">聽id;<br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽MyObjectFactory()聽{<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">super</span><span style="color: rgb(0, 0, 0);">();<br />聽聽聽聽}<br /><br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽Object聽makeObject()聽</span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);">聽Exception聽{<br />聽聽聽聽聽聽聽聽User聽user</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽User();<br />聽聽聽聽聽聽聽聽user.setId(id);<br />聽聽聽聽聽聽聽聽user.setName(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">name</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">id);<br />聽聽聽聽聽聽聽聽id</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">;<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">聽user;<br />聽聽聽聽}<br /><br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽destroyObject(Object聽arg0)聽</span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);">聽Exception聽{<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">聽TODO聽Auto-generated聽method聽stub</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽}<br /><br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);">聽validateObject(Object聽arg0)聽{<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">聽TODO聽Auto-generated聽method聽stub</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;<br />聽聽聽聽}<br /><br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽activateObject(Object聽arg0)聽</span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);">聽Exception聽{<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">聽TODO聽Auto-generated聽method聽stub</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽}<br /><br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽passivateObject(Object聽arg0)聽</span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);">聽Exception聽{<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">聽TODO聽Auto-generated聽method聽stub</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽}<br /><br />}<br /></span></div><br />鐒跺悗閫氳繃濡備笅浠g爜榪涜浣跨敤錛?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽GenericObjectPool聽pool聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽GenericObjectPool(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽MyObjectFactory());<br />聽聽聽聽聽聽聽聽pool.setMaxActive(</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">);</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">榛樿鏄?</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽pool.borrowObject();</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">鍙栧嚭object</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽pool.returnObject(yourobject);</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">鎶婂彇鍑虹殑object榪樼粰瀵硅薄姹?/span></div><br /><img src ="http://www.aygfsteel.com/123xxx/aggbug/40617.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/123xxx/" target="_blank">OO</a> 2006-04-12 13:08 <a href="http://www.aygfsteel.com/123xxx/articles/40617.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Ibatis鍏ラ棬http://www.aygfsteel.com/123xxx/articles/40565.htmlOOOOWed, 12 Apr 2006 02:18:00 GMThttp://www.aygfsteel.com/123xxx/articles/40565.htmlhttp://www.aygfsteel.com/123xxx/comments/40565.htmlhttp://www.aygfsteel.com/123xxx/articles/40565.html#Feedback0http://www.aygfsteel.com/123xxx/comments/commentRss/40565.htmlhttp://www.aygfsteel.com/123xxx/services/trackbacks/40565.html
閰嶇疆鏂囦歡
聽聽聽 sql-map-config.xml
<!DOCTYPE聽sqlMapConfig聽PUBLIC
聽聽聽聽聽聽聽聽聽聽"-//ibatis.apache.org//DTD聽SQL聽Map聽Config聽2.0//EN"聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽"http://ibatis.apache.org/dtd/sql-map-config-2.dtd"
>

<sqlMapConfig>

聽聽
<properties聽resource="properties/database.properties"/>

聽聽
<settings聽cacheModelsEnabled="true"聽enhancementEnabled="false"
聽聽聽聽聽聽聽聽聽聽聽聽maxSessions
="64"聽maxTransactions="8"聽maxRequests="128" useStatementNamespaces="true"/>

聽聽
<transactionManager聽type="JDBC">
聽聽聽聽
<dataSource聽type="SIMPLE">
聽聽聽聽聽聽
<property聽value="${driver}"聽name="JDBC.Driver"/>
聽聽聽聽聽聽
<property聽value="${url}"聽name="JDBC.ConnectionURL"/>
聽聽聽聽聽聽
<property聽value="${username}"聽name="JDBC.Username"/>
聽聽聽聽聽聽
<property聽value="${password}"聽name="JDBC.Password"/>
聽聽聽聽聽聽
<property聽value="15"聽name="Pool.MaximumActiveConnections"/>
聽聽聽聽聽聽
<property聽value="15"聽name="Pool.MaximumIdleConnections"/>
聽聽聽聽聽聽
<property聽value="1000"聽name="Pool.MaximumWait"/>
聽聽聽聽
</dataSource>
聽聽
</transactionManager>
聽聽
<sqlMap聽resource="com/xxx/sql/Accout.xml"/>
</sqlMapConfig>

database.properties
####################################
#聽Database聽Connectivity聽Properties
####################################

driver
=com.mysql.jdbc.Driver
url
=jdbc:mysql://localhost:3306/test
username
=root
password
=


Accout.xml聽 (sqlmap)
<?xml聽version="1.0"聽encoding="UTF-8"聽standalone="no"?>
<!DOCTYPE聽sqlMap聽PUBLIC聽"-//iBATIS.com//DTD聽SQL聽Map聽2.0//En"聽"http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap聽namespace="NS_Account">
聽聽聽聽
<typeAlias聽alias="Account"聽type="com.ibatis.domain.Accout"/>
聽聽聽聽
<resultMap聽id="AccountResult"聽class="Account">
聽聽聽聽聽聽聽聽
<result聽property="accountId"聽column="Account_ID"/>
聽聽聽聽聽聽聽聽
<result聽property="name"聽column="Name"/>
聽聽聽聽聽聽聽聽
<result聽property="password"聽column="Password"/>
聽聽聽聽聽聽聽聽
<result聽property="type"聽column="Type"/>
聽聽聽聽
</resultMap>

聽聽聽聽
<insert聽id="insert"聽parameterClass="Account">
聽聽聽聽聽聽聽聽
<![CDATA[
聽聽聽聽聽聽聽聽insert聽into聽T_Admin_Account(
聽聽聽聽聽聽聽聽聽聽聽聽Name,聽Password,聽Type,聽Account_ID
聽聽聽聽聽聽聽聽)聽values聽(
聽聽聽聽聽聽聽聽聽聽聽聽#name#,聽#password#,聽#type#,聽#accountId#
聽聽聽聽聽聽聽聽)
聽聽聽聽聽聽聽聽
]]>
聽聽聽聽
</insert>

聽聽聽聽
<select聽id="findAll"聽resultMap="AccountResult"聽parameterClass="Account">
聽聽聽聽聽聽聽聽
<![CDATA[
聽聽聽聽聽聽聽聽select聽*聽from聽T_Admin_Account
聽聽聽聽聽聽聽聽order聽by聽Account_ID
聽聽聽聽聽聽聽聽
]]>
聽聽聽聽
</select>

聽聽聽聽
<delete聽id="delete"聽parameterClass="Account">
聽聽聽聽聽聽聽聽
<![CDATA[
聽聽聽聽聽聽聽聽delete聽聽from聽T_Admin_Account
聽聽聽聽聽聽聽聽where聽Account_ID聽=聽#accountId#
聽聽聽聽聽聽聽聽
]]>
聽聽聽聽
</delete>

聽聽聽聽
<update聽id="update"聽parameterClass="Account">
聽聽聽聽聽聽聽聽
<![CDATA[
聽聽聽聽聽聽聽聽update聽T_Admin_Account
聽聽聽聽聽聽聽聽set聽Name聽=聽#name#,聽Password聽=聽#password#,聽Type聽=聽#type#
聽聽聽聽聽聽聽聽where聽Account_ID聽=聽#accountId#
聽聽聽聽聽聽聽聽
]]>
聽聽聽聽
</update>

</sqlMap>
鍙栧緱sqlmapclient:
privatestatic聽SqlMapClient sqlmapclient=null;
//

Reader聽reader聽
=null;
try聽{
聽聽reader聽
=聽Resources.getResourceAsReader(
聽聽聽聽
"com/ibatis/domain/sql/sql-map-config.xml");
sqlmapclient=聽SqlMapClientBuilder.buildSqlMapClient(reader);
}聽
catch聽(Exception聽e)聽{
聽聽e.printStackTrace();
}

鍦ㄨ緗ソ榪欎簺涓滆タ鍚庯紝浣跨敤綾諱技涓婇潰鐨勪唬鐮佸彇寰梥qlmapclient涔嬪悗灝卞彲浠ヤ嬌鐢╯qlmapclient榪涜鏁版嵁搴撴搷浣滀簡銆?br />搴旇娉ㄦ剰鍒板洜涓洪厤緗枃浠朵腑浣跨敤浜?/span>namespace錛堝湪<settings涓緗簡 useStatementNamespaces="true"/>錛夛紝鎵浠ュ湪sqlmapclient榪涜鎿嶄綔鏃惰璁頒綇浣跨敤namespace銆傚錛?br />
sqlmapclient.insert("NS_Account.insert",new聽Acount());
榪欐槸涓轟簡閬垮厤sqlmap閰嶇疆鏂囦歡涓嚭鐜扮浉鍚屽悕瀛楃殑鏂規硶鏃朵駭鐢熷啿紿併?br />

濡傛灉浣跨敤spring榪涜浠g爜鐨勭粍緇囷紝閭d箞浜嬫儏灝嗗彉寰楁洿鍔犵畝鍗曪紝浣犲彧瑕佸湪spring鐨勯厤緗枃浠墮噷闈嬌鐢?br />
聽聽聽聽<bean聽id="sqlMapClient"聽class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
聽聽聽聽聽聽聽聽
<property聽name="configLocation">
聽聽聽聽聽聽聽聽聽聽聽聽
<value>com/ibatis/domain/sql/sql-map-config.xml</value>
聽聽聽聽聽聽聽聽
</property>
聽聽聽聽聽聽聽聽
<property聽name="dataSource">
聽聽聽聽聽聽聽聽聽聽聽聽
<ref聽bean="dataSource"/>
聽聽聽聽聽聽聽聽
</property>
聽聽聽聽
</bean>
瀵?/span>sqlMapClient榪涜娉ㄥ唽錛岀劧鍚庢敞鍏ュ埌鐩稿簲鐨刣ao閲岄潰灝卞彲浠ヤ簡錛宻pring榪樻彁渚涗簡綆渚跨殑SqlMapClientDaoSupport錛岃繖涔熶細瀵逛綘鐨勭▼搴忓緢鏈夊府鍔┿?br />
濡傛灉浣犲彧鏄兂浣跨敤ibatis鑷繁鎻愪緵鐨刣ao妗嗘灦涔熷彲浠ャ備負浜嗕嬌鐢╠ao妗嗘灦錛岃繕闇瑕佸彟澶栫殑閰嶇疆鏂囦歡錛?br />dao.xml:
<?xml聽version="1.0"聽encoding="UTF-8"?>
<!DOCTYPE聽daoConfig聽PUBLIC聽"-//iBATIS.com//DTD聽DAO聽Configuration聽2.0//EN"聽"http://www.ibatis.com/dtd/dao-2.dtd">
<daoConfig>
聽聽聽聽
<!--聽Example聽SQL聽Maps聽DAO聽Configuration聽-->
聽聽聽聽
<context>
聽聽聽聽聽聽聽聽
<transactionManager聽type="SQLMAP">
聽聽聽聽聽聽聽聽聽聽聽聽
<property聽name="SqlMapConfigResource"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽value
="sql-map-config.xml"/>
聽聽聽聽聽聽聽聽
</transactionManager>
聽聽聽聽聽聽聽聽
<dao聽interface="com.ln.dao.CategoryDao"
聽聽聽聽聽聽聽聽聽聽聽聽implementation
="com.ln.daoImpl.ibatis.CategoryDaoImplSqlMap"/>
聽聽聽聽聽聽聽聽聽聽聽聽
<dao聽interface="com.ln.dao.CalDao"
聽聽聽聽聽聽聽聽聽聽聽聽implementation
="com.ln.daoImpl.ibatis.CalDaoImplSqlMap"/>
聽聽聽聽
</context>
</daoConfig>
鑰屼笖鍦ㄤ綘鐨刣ao interface涓緇ф壙com.ibatis.dao.client.Dao鎺ュ彛錛堣繖鍙槸涓涓爣蹇楁у熷彛錛屾病鏈変換浣曟柟娉曪級
鍦ㄧ▼搴忎腑灝卞彲浠ヤ嬌鐢細
聽聽聽聽聽聽聽聽Reader聽reader聽=null;
聽聽聽聽聽聽聽聽DaoManager聽daoManager
=null;
聽聽聽聽聽聽聽聽
try聽{
聽聽聽聽聽聽聽聽聽聽reader聽
=聽Resources.getResourceAsReader(
聽聽聽聽聽聽聽聽聽聽聽聽
"com/ibatis/domain/sql/dao.xml");
聽聽聽聽聽聽聽聽聽聽daoManager聽
=聽DaoManagerBuilder.buildDaoManager(reader);
聽聽聽聽聽聽聽聽}聽
catch聽(Exception聽e)聽{
聽聽聽聽聽聽聽聽聽聽e.printStackTrace();
聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽daoManager.getDao(CalDao.
class);

榪欐牱鐨勭▼搴忔潵鍙栧緱dao錛岃繖涔熻兘寰堝ソ鐨勬妸dao鎻愪緵鐨勬柟娉曚笌鍏蜂綋鐨勫疄鐜板垎紱誨紑鏉ャ?br />鍦ㄤ嬌鐢╥batis鐨刣ao妗嗘灦鏃訛紝鏈濂藉湪dao瀹炵幇綾諱腑緇ф壙ibatis鎻愪緵鐨凷qlMapDaoTemplate ,
瀹冩槸dao妗嗘灦鎻愪緵鐨勪竴涓ā鐗堢被錛岀敤鏉ョ鐞哾ao mapper妗嗘灦鐨勫悇涓柟闈紝涔熷彲浠ョ畝鍖栦綘鐨勫伐浣?/span>

publicclassCalDaoImpl extends SqlMapDaoTemplate implementsCalDao{
聽聽
publicCalDaoImpl (DaoManager聽daoManager)聽{
聽聽聽聽
super(daoManager);
聽聽}
}

緇ф壙涔嬪悗鍙敤鍦ㄥ疄鐜頒竴涓甫DaoManager 鍙傛暟鐨勬瀯閫犲嚱鏁板氨鍙互浜嗐傝繖涓瀯閫犲嚱鏁板茍涓嶉渶瑕佹墜鍔ㄨ皟鐢紝浣跨敤daoManager.getDao(CalDao.class);鏉ュ彇寰梔ao瀹炰緥鐨勬椂鍊欙紝妗嗘灦浼氳嚜鍔ㄨ繘琛岃皟鐢ㄣ?/span>
涔嬪悗鍦ㄤ綘鐨刣aoImpl閲岄潰灝卞彲浠ョ洿鎺ヤ嬌鐢╭ueryForList絳塻qlmapclient鎻愪緵鐨勬柟娉曚簡銆?br />
榪欐牱ibatis鐨勪粙緇嶅熀鏈畬鎴愩?br />

閭d負浠涔堣浣跨敤Ibatis鍛紵鍘熷洜寰堢畝鍗曪紝瀹冨緢濂藉湴灞忚斀鎺変簡
Connection,statement,resultset絳夌洿鎺ヤ嬌鐢╦dbc鏄緢鐑︿漢鐨勫湴鏂癸紝鍙堝彲浠ョ洿鎺ヤ嬌鐢╯ql璇彞闈炲父鐏墊椿鍦拌繘琛屾暟鎹簱鎿嶄綔錛堢壒鍒槸閰嶇疆鏂囦歡涓殑鍔ㄦ乻ql璇彞鏇存槸瓚沖鐨勭伒媧伙級錛岃屼笖榪樻彁渚涗簡榪炴帴姹狅紝cache錛屼簨鍔$鐞嗙瓑鏀寔銆備嬌鐢ㄨ搗鏉ョ畝鍗曡屽張寮哄ぇ


OO 2006-04-12 10:18 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 蚌埠市| 丰顺县| 嵊州市| 徐汇区| 屏东市| 青岛市| 桑植县| 大姚县| 佛学| 牙克石市| 阆中市| 竹溪县| 南昌县| 宣武区| 靖边县| 民权县| 大同县| 长武县| 临朐县| 时尚| 宜章县| 黄大仙区| 赤水市| 石林| 乐陵市| 黔西县| 玉屏| 卢湾区| 万载县| 平江县| 荣昌县| 谷城县| 娄底市| 兴安县| 太白县| 邓州市| 邵阳市| 德州市| 大洼县| 南开区| 蒙自县|