该用户从未签到
|
! ~' I( r0 O# Q7 q. Q: o
7 L- P& {+ l0 R2 l ]
% f' t- n8 z- a: b* t4 {<!-- 定义数据源 -->- m( B& Y4 R% |/ D! g" w7 W
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
) d4 |, n+ F4 {& ~9 i <property name="driverClassName">
% ]+ ~! C; A9 t) B, X% |& Y <value>com.mysql.jdbc.Driver</value>
# X( `2 D& d- r7 m: Z </property>
7 @7 {- f# P% v7 p <property name="url">
" ?5 \: J# s" H3 q* Q5 f3 D <value>jdbc:mysql://localhost/bfblog</value>1 ^# D5 T, ~4 ]$ ?
</property>
+ _7 c% Y: i6 @# I/ v <property name="username">
3 J& L+ M( [( `) U8 k* c <value>root</value>
; Y4 }& H! X5 C- r/ U: t0 h2 q </property>
6 @7 J/ x: \( ]( a <property name="password">
1 G# N* A- D% N" \8 [+ u Q <value>admin</value>
0 s4 u" R" Z' X" d* V6 b </property>
! L$ D9 X) m) I# W3 n8 _' F% p </bean>$ f* _/ k2 x& t" |
1 O$ K; P; ]$ G2 e( J% S <!-- 定义SessionFactory -->2 ]" f5 b' D- T% F" k: Z
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
2 q2 m' z. u3 U; c' y <property name="dataSource">
4 r% H7 f* i( s5 F- q! B <ref bean="dataSource"/>0 r3 n8 u6 x8 \, o" Z# I! H
</property>* g% ~1 T3 p9 O
<property name="hibernateProperties">0 K% I; y# r2 @- |
<props>& f Z" [' [7 T/ L
<prop key="hibernate.dialect">
# y) \$ u6 Q. q org.hibernate.dialect.MySQLDialect
* x i3 g* q1 R& W* {* b% m </prop>( A) ^ }8 r7 D, f Y5 m( g
<prop key="hibernate.show_sql">false</prop>
! A8 o' B. }( [ </props>
V4 x; l. A! q, S/ j </property>3 J! j" Q' h4 |' v% b( T4 R
<property name="mappingResources">
% Q6 V, U6 a5 p: d' s <list>- q* @$ `5 N' ^! ?/ w
<value>com/ibeifeng/po/User.hbm.xml</value> q7 k* q( l- N. I. ?
</list>
. v9 P3 H- @$ [8 { </property>
" K/ Q L1 M# G9 ^ </bean> |
|