日期:2014-05-18 浏览次数:20681 次
<?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-2.0.xsd" default-autowire="byName"> <!-- 数据库的hibernate配置 --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="oracle.jdbc.driver.OracleDriver"> </property> <property name="jdbcUrl" value="jdbc:oracle:thin:@12.61.14.61:1521:KPI"> </property> <property name="user" value="user"></property> <property name="password" value="pass"></property> <property name="maxPoolSize" value="40" /> <!-- 指定连接数据库连接池的最小连接数 --> <property name="minPoolSize" value="1" /> <!-- 指定连接数据库连接池的初始化连接数 --> <property name="initialPoolSize" value="1" /> <!-- 指定连接数据库连接池的连接的最大空闲时间 --> <property name="maxIdleTime" value="20" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource"></ref> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.Oracle9Dialect </prop> <prop key="hibernate.show_sql">false</prop> <prop key="format_sql">true</prop> </props> </property> <property name="mappingResources"> <list> <value> com/rdc/hibernate/bean/Processkpcontract.hbm.xml </value> ........... </list> </property> </bean> <!-- 声明services --> <bean id="service" class="com.rdc.struts.service.ServicesImpl"></bean> <bean id="serviceC" class="com.rdc.struts.service.ServicesImpl_C"></bean> <bean id="serviceL" class="com.rdc.struts.service.ServicesImpl_L"></bean> <bean id="serviceZ" class="com.rdc.struts.service.ServicesImpl_Z"></bean> <bean id="serviceF" class="com.rdc.struts.service.ServicesImpl_F"></bean> <bean id="tr