日期:2014-05-17 浏览次数:20613 次
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:dataSource.properties" /> </bean> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass"> <value>${datasource.driverClassName} </value> </property> <property name="jdbcUrl"> <value>${datasource.url} </value> </property> <property name="user"> <value>${datasource.username} </value> </property> <property name="password"> <value>${datasource.password} </value> </property> <property name="initialPoolSize"> <value>${jdbc.initialPoolSize} </value> </property> <property name="minPoolSize"> <value>${jdbc.minPoolSize} </value> </property> <property name="maxPoolSize"> <value>${jdbc.maxPoolSize} </value> </property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="mappingResources"> <list> <value>ssh2/login/model/User.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> <prop key="show_sql">true</prop> </props> </property> </bean>