日期:2014-05-16 浏览次数:20433 次
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="jdbcUrl" value="jdbc:mysql://localhost/zfzy?useUnicode=true&characterEncoding=gbk" /> <property name="maxPoolSize" value="20"/> <property name="minPoolSize" value="10"/> <property name="idleConnectionTestPeriod" value="30"/> <property name="acquireIncrement" value="5"/> <property name="properties"> <props> <prop key="user">root</prop> <prop key="password">123456</prop> </props> </property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"></property> <property name="mappingResources"> <list> <value>org/zfzy/model/Counter.hbm.xml</value> <value>org/zfzy/model/Info.hbm.xml</value> <value>org/zfzy/model/Topic.hbm.xml</value> <value>org/zfzy/model/Subject.hbm.xml</value> <value>org/zfzy/model/Author.hbm.xml</value> <value>org/zfzy/model/Book.hbm.xml</value> <value>org/zfzy/model/Gwyzl.hbm.xml</value> <value>org/zfzy/model/GwyzlTopic.hbm.xml</value> <value>org/zfzy/model/Acl.hbm.xml</value> <value>org/zfzy/model/Role.hbm.xml</value> <value>org/zfzy/model/User.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.c3p0.max_size">20</prop> <prop key="hibernate.c3p0.min_size">10</prop> <prop key="hibernate.c3p0.timeout">120</prop> <prop key="hibernate.c3p0.max_statements">100</prop> <prop key="hibernate.c3p0.idle_test_period">120</prop> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="show_sql">false</prop> <prop key="hibernate.generate_statistics">false</prop> </props> </property> </bean>