该用户从未签到
|
& ^3 P5 t/ S1 s
) ^7 A, m) D* m9 O' |% L' `; T; Q
5 d( A+ E3 T- p8 t6 B" p
<!-- 定义数据源 -->; K& ]$ z" o/ @; @8 E/ k
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
4 W9 Y1 d& M. `/ ~7 x <property name="driverClassName">% G7 h. b) B$ N( [
<value>com.mysql.jdbc.Driver</value>
0 u# T% ~! S3 g: V& g( m5 { y8 H </property>
& T- J. H4 M6 Z! c/ t0 } <property name="url">
$ w$ [6 y: S9 c& S. I, w& N <value>jdbc:mysql://localhost/bfblog</value>
D8 Z$ |9 `" q </property>; h' r) U4 h6 k
<property name="username">
6 O5 k( N4 W6 W5 f) Y5 a" a* ^ <value>root</value>1 N8 M8 t- |% `
</property>
$ `, d1 K* Y* V0 E# ^ <property name="password">+ [1 A4 M' O& Y
<value>admin</value>
: S8 q: r5 T: ^5 I) y </property>
$ R( J |3 O( J7 d; O8 R </bean>
( c: g. ^# v" B2 D7 q8 x2 N) v9 Z
. H3 X9 j$ L- q' ? <!-- 定义SessionFactory -->1 p! ~+ s# j& U# h- ]
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
: s L$ H. \3 Z( V3 m. {, X1 u <property name="dataSource">
. O6 m( B5 f6 e7 c, L <ref bean="dataSource"/>
2 k; @% \2 P, U </property>
" \% H% i/ Q( u2 C- ~ <property name="hibernateProperties">2 M& l6 S: k" u" r* L; o
<props>% c' L" ?( i0 s( _6 c
<prop key="hibernate.dialect">
0 k- ~) g, f% t" T1 V- w1 @- S8 P org.hibernate.dialect.MySQLDialect
- M; U: N3 I2 [7 U0 e5 p </prop>
2 B v# S% X* U) l) R. y <prop key="hibernate.show_sql">false</prop>1 P3 W5 T# E. ~! D O
</props># l7 u' ]$ a* _4 w1 D2 s5 f
</property>
6 _" y: J' ? D <property name="mappingResources">
9 \$ N+ ]& I& F, E5 ]& \! o <list>+ c; g: ]! Z9 P6 t- W4 \
<value>com/ibeifeng/po/User.hbm.xml</value>
+ e* r! M! ?0 ` </list>* O9 K$ f% R1 ~8 z: \" y- ~
</property>* E; L. p" a) ~" m9 M# i
</bean> |
|