博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
配置系列:ssm中applicationContext.xml的简单配置
阅读量:7298 次
发布时间:2019-06-30

本文共 2022 字,大约阅读时间需要 6 分钟。

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"

xmlns:context="http://www.springframework.org/schema/context"

xmlns:mvc="http://www.springframework.org/schema/mvc"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd

        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd

        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

<!--配置service的包扫描,自动注入Service-->

<context:component-scan base-package="com.simple"/>

<!-- 使用spring自带的占位符替换功能 -->

<bean

class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

<!-- 允许JVM参数覆盖 -->

<property name="systemPropertiesModeName"        value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />

<!-- 忽略没有找到的资源文件 -->

<property name="ignoreResourceNotFound" value="true" />

<!-- 配置资源文件 -->

<property name="locations">

<list>

<value>classpath:jdbc.properties</value>

<value>classpath:env.properties</value>

</list>

</property>

</bean>

<!-- 数据库连接池 -->

<bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource"

destroy-method="close">

<!-- 数据库驱动 -->

<property name="driverClass" value="${jdbc.driver}" />

<!-- 相应驱动的jdbcUrl -->

<property name="jdbcUrl" value="${jdbc.url}" />

<!-- 数据库的用户名 -->

<property name="username" value="${jdbc.username}" />

<!-- 数据库的密码 -->

<property name="password" value="${jdbc.password}" />

<!-- 检查数据库连接池中空闲连接的间隔时间,单位是分,默认值:240,如果要取消则设置为0 -->

<property name="idleConnectionTestPeriod" value="60" />

<!-- 连接池中未使用的链接最大存活时间,单位是分,默认值:60,如果要永远存活设置为0 -->

<property name="idleMaxAge" value="30" />

<!-- 每个分区最大的连接数 -->

<property name="maxConnectionsPerPartition" value="150" />

<!-- 每个分区最小的连接数 -->

<property name="minConnectionsPerPartition" value="5" />

</bean>

</beans>

本文转自 兴趣e族 51CTO博客,原文链接:

http://blog.51cto.com/simplelife/1695777

转载地址:http://rjwnm.baihongyu.com/

你可能感兴趣的文章
小白学数据分析----->Excel制作INFOGRAPHIC
查看>>
Silverlight Telerik RadGridView动态增删行及行列操作(转载)
查看>>
Html.DropDownListFor练习(2)
查看>>
C++ Primer 学习笔记_75_模板与泛型编程 --模板定义
查看>>
SQL Server里Grouping Sets的威力
查看>>
Spring利用JDBCTemplate实现批量插入和返回id
查看>>
C# asp.net mvc 配置多个route 参数
查看>>
订单数字提醒的实现
查看>>
导出excel——入门
查看>>
设计模式(十)享元模式Flyweight(结构型)
查看>>
有图有真相!同是滑屏,荣耀Magic2不只比小米MIX3缝隙小,还更稳定
查看>>
AI+云 华为开启智能时代新纪元
查看>>
就是好骑!骑ofo小黄蜂和舒畅早晨say hi,跟闹心堵车say bye
查看>>
张旭豪:外卖概念的三点进化
查看>>
机构:去年购房者平均年龄近30岁
查看>>
天津:第十六届西青区民俗文化旅游节开幕
查看>>
[译]Reduce(软件编写)(第五部分)
查看>>
Android 插件框架机制之Small
查看>>
The Best Way to Export an SVG from Sketch
查看>>
透过 OKR 进行项目过程管理
查看>>