http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-
mvc-4.0.xsd">
<!-- 自动扫描 com.entity 包下面和子包下面的注解并且执行 -->
<context:component-scan base-package="com" />
<!-- 引入配置文件 -->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigure
r">
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"
/>
<property name="username" value="BYSJ" />
<property name="password" value="123" />
<!-- 初始化连接大小 -->
<property name="initialSize" value="5"></property>
<!-- 连接池最大数量 -->
<property name="maxActive" value="20"></property>
<!-- 连接池最大空闲 -->
<property name="maxIdle" value="5"></property>
<!-- 连接池最小空闲 -->
<property name="minIdle" value="3"></property>
<!-- 获取连接最大等待时间 -->
<property name="maxWait" value="10000"></property>
</bean>
</beans>
1.6 测试配置进度
项 目 ( 右 键 )—Run As—MyEclipse Server Application – 点 击 服 务 器 ---