该用户从未签到
|
( O" ^! l9 v9 t* k: _7 Z( A' b% X! t6 ]! e; E
( O+ e+ W4 c: Y& G+ n<!-- 定义数据源 -->4 K" i, v) F, r7 t3 p3 `% k
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+ U+ _ N8 J6 B8 n0 B$ ^( ^2 t* m <property name="driverClassName">
: e: K m6 t9 }" d: \7 B9 e* E <value>com.mysql.jdbc.Driver</value>. G% W( V) |. J1 }7 g+ A- K3 T& K5 @
</property>
! | z! }! b8 \1 f: d" M <property name="url">
- }7 T$ Z- o% ^& V8 W+ ^( c! z <value>jdbc:mysql://localhost/bfblog</value>; N. Q$ j) {1 ?/ W4 g- A: O
</property>
. r" j; w2 [' ]9 f1 L <property name="username">
`: k% p* [$ S" E9 p; v4 x) g <value>root</value>3 y4 W6 ]( [# }1 Q7 p
</property>8 I" g8 W% c1 b% P" T
<property name="password">
- G, H" a2 W. g) j( S <value>admin</value>
/ C" `( B+ b$ S) n* b* S# D </property>- _6 e) B- I7 a4 T9 A0 d7 c
</bean>% t& p0 g9 ?" Y7 W! J; V
1 r5 [+ z" k6 x
<!-- 定义SessionFactory -->
, f0 O& x! b H! r+ I* ~ <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">* q% s0 e7 U& P- x$ J3 k- j) x
<property name="dataSource">
4 }8 B' j$ ~- H& R <ref bean="dataSource"/>' ?; t1 x' N- h4 o6 F
</property>
4 Z/ w9 J' j5 X) z1 T- n <property name="hibernateProperties">
& Q# k0 Q! ^8 ~# i7 b <props>
( L7 H o8 A1 s% L <prop key="hibernate.dialect">8 R# L" s' o! Z1 g1 P7 y
org.hibernate.dialect.MySQLDialect* u# K s& ^) Y
</prop>- g9 F) f6 ]8 }* s2 r% I9 d
<prop key="hibernate.show_sql">false</prop>/ q& p: x* c; O4 U! I
</props>
0 k3 F5 c+ r$ r) Z </property>
1 e; `# @2 ~8 q+ W <property name="mappingResources">
9 y! ~" d6 j: S1 V <list> b b. I- i9 i, {
<value>com/ibeifeng/po/User.hbm.xml</value>" V2 B6 [ m* @3 F+ F) F d
</list>
6 {1 z4 k! M! O% u, }* B1 P </property>7 Z2 ], }4 J( o: F( {
</bean> |
|