锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品一二三视频,欧美精品激情,最新精品国产http://www.aygfsteel.com/keweibo/category/25073.html涓涓? Java 澶氳兘 Delphi,Powerbuilder ... zh-cnThu, 14 Jul 2011 07:19:11 GMTThu, 14 Jul 2011 07:19:11 GMT60struts2+spring+hibernate 鎳掑姞杞藉紓甯革細org.hibernate.LazyInitializationException: failed to lazily initializehttp://www.aygfsteel.com/keweibo/articles/354252.htmlKeKeWed, 13 Jul 2011 05:55:00 GMThttp://www.aygfsteel.com/keweibo/articles/354252.htmlhttp://www.aygfsteel.com/keweibo/comments/354252.htmlhttp://www.aygfsteel.com/keweibo/articles/354252.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/354252.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/354252.html涓ょ澶勭悊鏂規(guī)硶錛?br />涓銆佸湪鏄犲皠鏂囦歡涓緗甽azy=false銆?br />浜屻佺敤OpenSessionInViewFilter榪囨護鍣紝娉ㄦ剰hibernateFilter榪囨護鍣ㄥ拰struts2榪囨護鍣ㄥ湪鏄犲皠鏃剁殑鍏堝悗欏哄簭銆傚悓鏃惰閰嶇疆浜嬬墿澶勭悊錛屽惁鍒欎細瀵艱嚧session澶勪簬鍙鐘舵佽屼笉鑳藉仛淇敼銆佸垹闄ょ殑鍔ㄤ綔銆?br />鍗沖湪web.xml鏂囦歡涓涓嬮厤緗細
<!-- OpenSessionInView -->
    <filter>
        <filter-name>OpenSessionInViewFilter</filter-name>
        <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>OpenSessionInViewFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
        
    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>


Ke 2011-07-13 13:55 鍙戣〃璇勮
]]>
[杞琞涓涓硾鍨婬ibernate DAO瀹炵幇http://www.aygfsteel.com/keweibo/articles/184372.htmlKeKeThu, 06 Mar 2008 15:17:00 GMThttp://www.aygfsteel.com/keweibo/articles/184372.htmlhttp://www.aygfsteel.com/keweibo/comments/184372.htmlhttp://www.aygfsteel.com/keweibo/articles/184372.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/184372.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/184372.html闃呰鍏ㄦ枃

Ke 2008-03-06 23:17 鍙戣〃璇勮
]]>
Struts+Spring+Hibernate鏁村悎鍏ラ棬璇﹁Вhttp://www.aygfsteel.com/keweibo/articles/150032.htmlKeKeMon, 01 Oct 2007 03:25:00 GMThttp://www.aygfsteel.com/keweibo/articles/150032.htmlhttp://www.aygfsteel.com/keweibo/comments/150032.htmlhttp://www.aygfsteel.com/keweibo/articles/150032.html#Feedback3http://www.aygfsteel.com/keweibo/comments/commentRss/150032.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/150032.html闃呰鍏ㄦ枃

Ke 2007-10-01 11:25 鍙戣〃璇勮
]]>
struts+spring+hibernate 緇勮web搴旂敤http://www.aygfsteel.com/keweibo/articles/146182.htmlKeKeTue, 18 Sep 2007 07:46:00 GMThttp://www.aygfsteel.com/keweibo/articles/146182.htmlhttp://www.aygfsteel.com/keweibo/comments/146182.htmlhttp://www.aygfsteel.com/keweibo/articles/146182.html#Feedback1http://www.aygfsteel.com/keweibo/comments/commentRss/146182.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/146182.html闃呰鍏ㄦ枃

Ke 2007-09-18 15:46 鍙戣〃璇勮
]]>
Struts+Spring+Hibernate澶勭悊Lob(Blob,Clob) http://www.aygfsteel.com/keweibo/articles/145950.htmlKeKeMon, 17 Sep 2007 11:34:00 GMThttp://www.aygfsteel.com/keweibo/articles/145950.htmlhttp://www.aygfsteel.com/keweibo/comments/145950.htmlhttp://www.aygfsteel.com/keweibo/articles/145950.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/145950.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/145950.htmlStruts+Spring+Hibernate澶勭悊Lob(Blob,Clob) 

銆銆鍦ㄤ嬌鐢╯truts+spring+hibernate鐨勫紑鍙戜腑錛屾湁浜涙椂鍊欑敤鎴蜂細鏈夋暟鎹簱瀛樺偍鏂囦歡鐨勯渶姹傦紝鍦ㄦ暟鎹簱涓竴鑸細閲囩敤
Blob瀛楁鎴朇lob瀛楁鏉ュ瓨鍌ㄤ簩榪涘埗鍥劇墖銆佹祦濯掍綋鎴栨枃浠躲傜幇灝卞皢鍦ㄥ疄闄呭紑鍙戜腑閬囧埌鐨勯棶棰樺強瑙e喅鏂規(guī)硶鍛婁箣銆?/font>

涓銆侀棶棰橀渶姹傦細

 1.鍦ㄦ寔涔呭寲綾諱腑瀛楁璇ョ敤浠涔堢被鍨嬶紵
 2.鍦⊿truts涓枃浠跺搴旂殑鏁版嵁綾誨瀷鏄粈涔堬紵
 3.鍦℉ibernate涓瓧孌靛搴旂殑綾誨瀷鏄粈涔堬紵
 4.濡備綍鍦⊿pring涓鐞嗚繖浜涙枃浠訛紵

浜屻佽В鍐蟲柟娉曪細

 1.鍦ㄦ暟鎹簱涓繖浜涙枃浠舵渶緇堟槸浠ュ瓧鑺傜殑褰㈠紡瀛樺偍浜岃繘鍒跺璞★紝鎵浠ュ湪鎸佷箙鍖栫被涓皢鐩稿簲鐨勫睘鎬у畾涔変負byte[]綾誨瀷銆?/font>

 2.鍦⊿truts涓彲浠ヤ嬌鐢紲html:file property="" /錛炴爣絳炬潵涓婁紶鏂囦歡錛屾墍浠ヤ笌涔嬪搴旂殑ActionForm鐨勫睘鎬х被鍨嬩負:
FormFile(org.apache.struts.upload.FormFile)綾誨瀷錛屽嵆浣挎槸浣跨敤浜嗗姩鎬丗orm鍚岀悊涔熸槸浣跨敤璇ョ被鍨?
鎻愮ず錛氬悓鏃惰灝唂orm鏍囩淇敼涓猴紲html:form action="/Action.do" method="post" enctype="multipart/form-data"錛?br /> 浠ユ敮鎸佹枃浠朵笂浼犲悗鍙栧緱涓婁紶鏁版嵁銆傚湪緇欐寔涔呭璞¤祴鍊兼椂鍙渶璋冪敤(FormFile) form.get("property")).getFileData();
鏂規(guī)硶鍗沖彲榪斿洖byte[]銆?/font>

 3.鍦℉ibernate涓枃浠跺垪瀵瑰簲鐨勭被鍨嬪彲浠ユ槸org.springframework.orm.hibernate3.support.BlobByteArrayType錛?br /> org.springframework.orm.hibernate3.support.ClobStringType銆乧lob銆乥lob銆乥inary銆備粈涔堟椂鍊欑敤BlobBYteArrayType
浠涔堟椂鍊欑敤ClobStringType錛熶竴鑸鏋滆澶勭悊鐨勫璞℃槸鏁版嵁搴撳瓧孌電被鍨嬫槸blob鏃?涓昏鏄浘鐗囷紝浜岃繘鍒跺璞$瓑),
鏄犲皠鏂囦歡璁劇疆涓猴細org.springframework.orm.hibernate3.support.BlobByteArrayType 鏁版嵁搴撳瓧孌墊槸clob(澶ф枃鏈璞?
綾誨瀷鏃?瑕佸皢java鐨勫睘鎬х殑綾誨瀷瀹氫負String,鏄犲皠鏂囦歡璁劇疆涓猴細 org.springframework.orm.hibernate3.support.ClobStringType銆?/font>

 4.濡傛灉鍦╯pring涓婅浣跨敤Struts涓嚜甯︾殑涓婁紶鍔熻兘蹇呴』鍦╯pring鐨勯厤緗枃浠朵腑鍔犱互澹版槑.鍚﹁呭皢浼氬嚭鐜?
綈ava.lang.IllegalStateException: No LobHandler found for configuration - lobHandler property
must be set on LocalSessionFactoryBean寮傚父銆傞厤緗涓嬶細

 (1).澹版槑涓涓鐞嗗彞鏌勶細
  錛渂ean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true" /錛?br />  (2).鍦╯essionFactory涓敞鍏obHandler:
  錛渂ean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"錛?br />           錛減roperty name="lobHandler" ref="lobHandler"/錛?br />   錛?bean錛?/font>

 鎻愮ず錛?鎸囧畾lobHandler鏃訛紝瀵逛簬MySQL銆丏B2銆丮S SQL Server銆丱racle 10g錛屼嬌鐢―efaultLobHandler鍗沖彲錛岃孫racle 9i錛?br /> 鍒欏彲浠ヤ嬌鐢∣racleLobHandler銆傚洜涓篛racle9i澶勭悊lob鐨勬柟寮忓拰涓嶅お涓鏍?鎵浠ヨ繖閲岃鐢╯pring鎻愪緵鐨凷impleNativeJdbcExtractor.澶勭悊Oracle9i lob綾誨瀷鐨勭壒孌婂0鏄?

錛渂ean id="nativeJdbcExtractor" lazy-init="true"  class="org.springframework.jdbc.support.nativejdbc.
SimpleNativeJdbcExtractor"/錛?/font>

錛渂ean id="lobHandler" lazy-init="true"   class="org.springframework.jdbc.support.lob.OracleLobHandler"錛?br />         錛減roperty name="nativeJdbcExtractor"錛?br />             錛渞ef bean="nativeJdbcExtractor"/錛?br />         錛?property錛?br /> 錛?bean錛?

錛渂ean id="sessionFactory"銆class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"錛?br />   
 錛?-- 涓哄鐞咮lob綾誨瀷瀛楁鐨勫彞鏌勫0鏄?--錛?br />  錛減roperty name="lobHandler"錛?br />   錛渞ef local="lobHandler" /錛?br />  錛?property錛?br /> 錛?bean錛?/font>

鍚屾椂榪樺簲璇ヤ嬌鐢ㄥ搴旂殑JDBC椹卞姩銆?/font>

Clob瀛楁瀹氫箟:錛減roperty name="灞炴у悕" column="鍒楀悕" type="org.springframework.orm.hibernate.support.ClobStringType"
 length="1048"/錛炶繖閲岀殑length鏄寚瀛楄妭,鏈澶у彲浠ュ埌2G.璇ュ瓧孌靛湪java瀵硅薄涓0鏄庝負String綾誨瀷銆?/font>

    銆濡傛灉浣跨敤鐨勬槸mysql鏁版嵁搴撳叾榛樿鐨勪笂浼犳枃浠跺ぇ灝忓彧鏈?047552瀛楄妭錛氬鏋滀笂浼犵殑鏂囦歡澶т簬1047552瀛楄妭鍒欎細鍑虹幇寮傚父
org.springframework.jdbc.UncategorizedSQLException: You can change this value on the server by setting
the max_allowed_packet' variable.鏍規(guī)嵁鎻愮ず鍙互淇敼mysql鏁版嵁搴撶殑max_allowed_packet灞炴уぇ灝忋?br /> 鎵撳紑my.ini鏂囦歡涓壘鍒? SERVER SECTION鍚庡湪port=3306涓嬮潰鍔犱笂max_allowed_packet=?M銆淇敼瀹屽悗閲嶅惎mysql鏈嶅姟鍗沖彲鎴愬姛涓婁紶銆?/font>

杞嚜:http://xinzhiz.javaeye.com/blog/111731


Ke 2007-09-17 19:34 鍙戣〃璇勮
]]>
MyEclipse 寮鍙?SSH 鏁村悎鏃?java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit 瑙e喅鏂規(guī) http://www.aygfsteel.com/keweibo/articles/140086.htmlKeKeMon, 27 Aug 2007 10:43:00 GMThttp://www.aygfsteel.com/keweibo/articles/140086.htmlhttp://www.aygfsteel.com/keweibo/comments/140086.htmlhttp://www.aygfsteel.com/keweibo/articles/140086.html#Feedback1http://www.aygfsteel.com/keweibo/comments/commentRss/140086.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/140086.htmlMyEclipse 寮鍙?SSH 鏁村悎鏃?java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit 瑙e喅鏂規(guī)

榪欑瘒鏂囩珷瑙e喅浜嗛棶棰? 鏍稿績鎻愮ず:

2007-08-08 鍙戠幇鐢?MyEclipse 5.5 鍋?Struts 1.2 + Spring 2.0 + Hibernate 3.1 鏁村悎鏃跺惎鍔ㄨ繃紼嬩腑鎶ュ涓嬬殑閿欒:


2007-08-08 15:36:17,406 ERROR [org.hibernate.proxy.BasicLazyInitializer] - CGLIB Enhancement failed: dao.User
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
 at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)

Spring 鍜?Hibernate 鍏辯敤鐨勪竴浜?jar 鏂囦歡鍙戠敓浜嗙増鏈啿紿? 鍒犻櫎 WEB-INF/lib/asm-2.2.3.jar 鐒跺悗閲嶅惎 Tomcat.

asm-2.2.3.jar
       asm.jar
       asm-attrs.jar
      asm-commons-2.2.3.jar
      asm-util-2.2.3.jar

鍘熸枃鍙傝?銆http://heweiya.javaeye.com/blog/101575



Ke 2007-08-27 18:43 鍙戣〃璇勮
]]>
杞澆錛歋pring 鏁村悎 Hibernate 鐨勪竴澶勭畝鍖栭厤緗?/title><link>http://www.aygfsteel.com/keweibo/articles/137783.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Sat, 18 Aug 2007 03:27:00 GMT</pubDate><guid>http://www.aygfsteel.com/keweibo/articles/137783.html</guid><wfw:comment>http://www.aygfsteel.com/keweibo/comments/137783.html</wfw:comment><comments>http://www.aygfsteel.com/keweibo/articles/137783.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/keweibo/comments/commentRss/137783.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/keweibo/services/trackbacks/137783.html</trackback:ping><description><![CDATA[<span style="FONT-SIZE: 10pt">鍦ㄨ繃鍘諱嬌鐢?Spring 鏁村悎 Hibernate 鐨勬椂鍊欙紝閮芥槸鐢ㄨ繖鏍風殑閰嶇疆鏂瑰紡銆?br><br></span> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">bean </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="sessionFactory"</span><span style="COLOR: #ff0000"> lazy-init</span><span style="COLOR: #0000ff">="true"</span><span style="COLOR: #ff0000"><br>      class</span><span style="COLOR: #0000ff">="org.springframework.orm.hibernate3.LocalSessionFactoryBean"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>    </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">property </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="mappingResources"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>        </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">list</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>            </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">resources/icustomer/Contact.hbm.xml</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>            </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">resources/icustomer/Customer.hbm.xml</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>        </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">list</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>    </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">property</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>    <img src="http://www.aygfsteel.com/Images/dot.gif">.<br></span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">bean</span><span style="COLOR: #0000ff">></span></div> <br><span style="FONT-SIZE: 10pt">姣忓綋闇瑕佸姞鍏ヤ竴涓柊鐨?VO 鏃訛紝鎴戦渶瑕佽繃鏉ヤ慨鏀歸厤緗枃浠訛紝鏉ュ紩鍏ュ鏂扮殑 VO 鐨勬敮鎸併?/span><br><br><span style="FONT-SIZE: 10pt">鐜板湪鎴戜嬌鐢ㄧ殑鏃跺欙紝鏄繖涔堥厤鐨勶細<br></span> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">bean </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="sessionFactory"</span><span style="COLOR: #ff0000"> lazy-init</span><span style="COLOR: #0000ff">="true"</span><span style="COLOR: #ff0000"><br>      class</span><span style="COLOR: #0000ff">="org.springframework.orm.hibernate3.LocalSessionFactoryBean"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>    </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">property </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="mappingLocations"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>        </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">list</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>            </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">classpath:resources/**/*.hbm.xml</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>        </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">list</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>    </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">property</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br>    <img src="http://www.aygfsteel.com/Images/dot.gif">.<br></span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">bean</span><span style="COLOR: #0000ff">></span></div> <br><span style="FONT-SIZE: 10pt">鍋氶」鐩紑鍙戠殑鏃跺欙紝灝卞啀涔熸病鏈夋敼榪囬厤緗?/span> <img src ="http://www.aygfsteel.com/keweibo/aggbug/137783.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/keweibo/" target="_blank">Ke</a> 2007-08-18 11:27 <a href="http://www.aygfsteel.com/keweibo/articles/137783.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>spring+hibernate瀵筽roxool榪炴帴姹犵殑閰嶇疆http://www.aygfsteel.com/keweibo/articles/137535.htmlKeKeFri, 17 Aug 2007 06:08:00 GMThttp://www.aygfsteel.com/keweibo/articles/137535.htmlhttp://www.aygfsteel.com/keweibo/comments/137535.htmlhttp://www.aygfsteel.com/keweibo/articles/137535.html#Feedback1http://www.aygfsteel.com/keweibo/comments/commentRss/137535.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/137535.html      destroy-method="close">
    <property name="driver">
      <value>com.mysql.jdbc.Driver</value>
    </property>
    <property name="driverUrl">
<!--鐢ㄦ埛鍚嶅拰瀵嗙爜鍐欏湪涓璧鋒墠璋冪敤鎴愬姛,涓嶇劧浼氭姤閿?-->
      <value>jdbc:mysql://localhost:3306/test?user=root&amp;password=7814195</value>
    </property>
    <property name="user"><!-- 蹇呴』鍦ㄨ繖閲屼篃璁劇疆錛屼絾鏄?proxool鍗翠笉浣跨敤瀹冿紝鎴栬鏄釜bug-->
      <value>root</value>
    </property>
    <property name="password"><!-- 蹇呴』鍦ㄨ繖閲屼篃璁劇疆錛屼絾鏄?proxool鍗翠笉浣跨敤瀹冿紝鎴栬鏄釜bug-->
      <value>7814195</value>
    </property>
    <property name="alias">
      <value>mysql</value>
    </property>
    <property name="houseKeepingSleepTime">
      <value>90000</value>
    </property>
    <property name="prototypeCount">
      <value>5</value>
    </property>
    <property name="maximumConnectionCount">
      <value>100</value>
    </property>
    <property name="minimumConnectionCount">
      <value>10</value>
    </property>
    <property name="trace">
      <value>true</value>
 </property>
 </bean>

Ke 2007-08-17 14:08 鍙戣〃璇勮
]]>
spring+hibernate瀵筩3p0榪炴帴姹犵殑閰嶇疆http://www.aygfsteel.com/keweibo/articles/137534.htmlKeKeFri, 17 Aug 2007 06:07:00 GMThttp://www.aygfsteel.com/keweibo/articles/137534.htmlhttp://www.aygfsteel.com/keweibo/comments/137534.htmlhttp://www.aygfsteel.com/keweibo/articles/137534.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/137534.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/137534.html<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "<beans>
<bean id="dataSource"
    class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
    <property name="driverClass">
     <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
    </property>
    <property name="jdbcUrl">
     <value>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=news</value>
    </property>
        <property name="properties">
              <props>
                      <prop key="c3p0.minPoolSize">5</prop>
                      <prop key="hc3p0.maxPoolSize">10</prop>
                      <prop key="hc3p0.timeout">60</prop>
                      <prop key="c3p0.max_statement">50</prop>
                      <prop key="c3p0.testConnectionOnCheckout">true</prop> 
                      <prop key="user">sa</prop>
                      <prop key="password"></prop>
              </props>
    </property>
</bean>
<bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource">
     <ref bean="dataSource" />
    </property>
    <property name="hibernateProperties">
     <props>
      <prop key="hibernate.dialect">
       org.hibernate.dialect.SQLServerDialect
      </prop>
     </props>
    </property>
    <property name="mappingResources">
     <list>
      <value>bo/Users.hbm.xml</value></list>
    </property>
</bean>
<bean id="UsersDAO" class="dao.UsersDAO">
    <property name="sessionFactory">
     <ref bean="sessionFactory" />
    </property>
</bean>

<bean id="UserService" class="service.UserService">
    <property name="userDAO">
     <ref bean="UsersDAO"/>
    </property>
</bean>

<bean name="/login" class="org.spell.action.LoginAction" singleton="false">
    <property name="userService">
     <ref bean="UserService"/>
    </property>
</bean>

<bean name="/register" class="org.spell.action.RegisterAction" singleton="false">
    <property name="userService">
     <ref bean="UserService"/>
    </property>
</bean>
</beans>

--------------------------------
鍦ㄩ厤緗殑鏃跺?nbsp;  cp30鐨勫睘鎬х殑鍚嶅瓧蹇呴』鏄?nbsp;  ''driverClass'   ,   'jdbcUrl',   'user'   ,   'password'   鑰?nbsp;  <property   name="properties">鐨勫悕瀛椾篃蹇呴』鏄?#8220;properties”錛屽彟澶朿p30閰嶇疆鏂囦歡鐨勫睘鎬у悕涔熼兘鏄濡傦細"c3p0.minPoolSize"銆?hc3p0.maxPoolSize"絳夌瓑



Ke 2007-08-17 14:07 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 乳源| 呼伦贝尔市| 淄博市| 德兴市| 苏州市| 大渡口区| 沛县| 大竹县| 海宁市| 佛教| 崇仁县| 怀集县| 晋州市| 神池县| 海伦市| 金乡县| 甘孜县| 乐至县| 长沙市| 福州市| 拜泉县| 曲周县| 乌恰县| 尼木县| 大足县| 东乡县| 沧州市| 金塔县| 万盛区| 丹东市| 察雅县| 方正县| 皮山县| 宁都县| 蓬安县| 津南区| 调兵山市| 龙泉市| 十堰市| 白玉县| 安西县|