|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | | -<beans xmlns="http://www.springframework.org/schema/beans" |
3 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
4 | | - xsi:schemaLocation="http://www.springframework.org/schema/beans |
| 2 | +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans |
5 | 3 | http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> |
6 | 4 |
|
7 | | -<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> |
8 | | - <property name="driverClassName" value="com.mysql.jdbc.Driver"/> |
9 | | - <property name="url" value="jdbc:mysql://www.example.com:3306/test"/> |
10 | | - <property name="username" value="root"/> |
11 | | - <property name="password" value="mysecret"/> |
12 | | - <property name="initialSize" value="30"/> |
13 | | - |
14 | | - <property name="maxActive" value="500"/> |
15 | | - <property name="maxIdle" value="2"/> |
16 | | - <property name="minIdle" value="1"/> |
17 | | -</bean> |
| 5 | + <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> |
| 6 | + <property name="driverClassName" value="com.mysql.jdbc.Driver" /> |
| 7 | + <property name="url" value="jdbc:mysql://www.example.com:3306/test" /> |
| 8 | + <property name="username" value="root" /> |
| 9 | + <property name="password" value="mysecret" /> |
| 10 | + <property name="initialSize" value="30" /> |
18 | 11 |
|
19 | | -<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> |
20 | | - <property name="dataSource" ref="dataSource"/> |
21 | | - |
22 | | - <property name="annotatedClasses"> |
23 | | - <list> |
24 | | - <value>com.example.entity.Users</value> |
25 | | - </list> |
26 | | - </property> |
27 | | - |
28 | | - <property name="hibernateProperties"> |
29 | | - <value> |
| 12 | + <property name="maxActive" value="500" /> |
| 13 | + <property name="maxIdle" value="2" /> |
| 14 | + <property name="minIdle" value="1" /> |
| 15 | + </bean> |
| 16 | + |
| 17 | + <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> |
| 18 | + <property name="dataSource" ref="dataSource" /> |
| 19 | + |
| 20 | + <property name="annotatedClasses"> |
| 21 | + <list> |
| 22 | + <value>com.example.entity.Users</value> |
| 23 | + </list> |
| 24 | + </property> |
| 25 | + |
| 26 | + <property name="hibernateProperties"> |
| 27 | + <value> |
30 | 28 | hibernate.dialect=org.hibernate.dialect.MySQLDialect |
31 | 29 | hibernate.hbm2ddl.auto=update |
32 | 30 | hibernate.show_sql=true |
33 | 31 | hibernate.cache.use_second_level_cache=false |
34 | 32 | hibernate.cache.provider_class=org.hibernate.cache.internal.NoCacheProvider |
35 | 33 | hibernate.generate_statistics=true |
36 | 34 | </value> |
37 | | - </property> |
38 | | -</bean> |
| 35 | + </property> |
| 36 | + </bean> |
39 | 37 | </beans> |
0 commit comments