<?xml version="1.0" encoding="UTF-8" ?>   
 <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
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
    <!--数据源-->
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
        <property name="username" value="root"></property>
        <property name="password" value="root"></property>
        <property name="url" value="jdbc:mysql://localhost:3306/club?useUnicode=true&amp;characterEncoding=UTF-8"></property>
        <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
        <!-- <property name="initialSize" value="${connection.initialSize}"></property> -->
        <property name="maxActive" value="50"></property>
        <property name="maxIdle" value="80"></property>
        <property name="minIdle" value="20"></property>
        <property name="maxWait" value="3000"></property>
    </bean>
    <!--二级缓存-->
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop key="hibernate.format_sql">false</prop>
            </props>
        </property>
        <property name="packagesToScan">
            <list>
                <value>com.uplooking.club.*.entity</value>
            </list>
        </property>
        <!--
        <property name="configLocations" value="classpath:hibernate.cfg.xml"></property>
        -->
    </bean>
    <!-- 一级缓存-->
    <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
          <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
 </beans>