该用户从未签到
|
c! v% |; ^# D6 j4 J) l4 r" ]
* ]: a! d& K9 `3 Q4 ~/ {. [
, Z; p" r8 k3 E4 D9 V' t. s9 z<!-- 定义数据源 -->
+ b" P7 w1 `. h7 w0 @) |2 _9 k <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
6 f M/ g1 P; ]+ |' N* s. \4 e; \ <property name="driverClassName">
) ]0 {; ^% z6 {0 h* n/ l' G; s0 [ <value>com.mysql.jdbc.Driver</value>
+ ]4 p& D! T( \9 Y6 f0 n; k </property># Z& \0 v9 r4 H3 Z
<property name="url">: t& X& O! p1 Q2 Y9 H& g
<value>jdbc:mysql://localhost/bfblog</value>& u6 Z4 H) D; D5 i6 ^
</property>
& u% ~* q5 `# _7 r9 ] <property name="username">
' C0 F( g$ i' l. o6 h1 @ <value>root</value>
2 r& }2 c+ p! \ </property>& K- r0 r- q( j
<property name="password">) R! _6 L# v9 H
<value>admin</value>
' i5 i! G) [8 N% w7 }" r </property>0 Z. }8 J& f. x2 z1 H1 ~' U# d. x- l
</bean>) d- J- _1 I; C/ v1 u/ z
9 U9 F1 f& K3 d' {' J% Q' \2 n% {
<!-- 定义SessionFactory -->
6 [. S4 d& Z4 h% p <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
$ ], ]" C& B( o5 s( d2 w <property name="dataSource">/ ^# B' E: G9 m) `
<ref bean="dataSource"/>
* H# B4 t/ A6 _ </property>
" x6 o. H7 \0 Q W5 ` <property name="hibernateProperties">3 A! c, s0 F. D9 _
<props>; h: P. A2 I2 i, E" ~; g
<prop key="hibernate.dialect">
4 H/ G* c& h; v/ d G! s org.hibernate.dialect.MySQLDialect4 [6 r& u& H( G4 ?6 g. D# r
</prop>; @% W( O' t/ o
<prop key="hibernate.show_sql">false</prop>) G2 n4 D X7 o* V) o$ M, u; w
</props>
$ M' w0 s8 i& w- x! s </property>
4 a* n0 \' e9 K0 @ <property name="mappingResources">6 t5 ? w2 B; k) u; C
<list>* g- o5 V; {3 D
<value>com/ibeifeng/po/User.hbm.xml</value>1 {0 v" j1 r- b% d1 a
</list>
8 X/ s# H% O/ u8 G </property>
. n4 u( T( z8 d: F0 w3 U </bean> |
|