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UAAC1uj1vWUsR/poVDtz+qwuOlzhFDRENVpYlqRCSTgWw8wOeNdoRd6zLYScOqsqRy6I0eL6u4Gg396s8V2nuWzpmbk/uJ6kxD51hB1Cr+qNVeL3RuPfz0R1+YsV/nhnNKAQB3c3ceipWIUiWAZPtdx9AKnZPraFcmz8gwYQ6RadfiIUxTh0706hxro+AoiauwaqY1F5pnKazJtJNEbJckZWUv0+BubrBe8bU6zC6di1/W7nS7l5LbDKED4Gs4onP62MiusE5VKVr0crIwjOqcoFddzlLHgMxqh/XDlhMDi5ik1o7V7qqdzY/14vfnFP9IUDkzT1UrC54ee2j3tJI/6EqBen9K2fL6u05/jr6rgdAlAN/C7f4cg3oAd+ncwNgT2U7DESi2mw+QWuZ6WWrsVd+IrXWxzm37VTIcbdptkcOcptDlzi9Sd3SdE77q0jl6mA/LlwIAGNync8rjvpR/X/92edyS0LTi62YaW1vmacszXJtYDFdZccvStdSkUTrCcLbO0bfycmqIZvKt1H3dnxP9eSPLdO37tVnrH1tKjuy7dUWBQ7WIGVUHADyUu/MtlbyC9H+eN6I+Tnfo3FgeirQB4W96FDTnpd7G6mpkmSoPp0fn1i/k9w3CMZ3rykPhMqcfsbm6vQTTue28G+e8yHDJCaezcEjyU0tL52RRg1MHwFdwc9yyeuCv007mNDBFTMo+nduW2/Y1d8XbDJ1L0cXyeHRvIeehFFsd0Tnrezp+1OlAlYfVsNo0aNmK5Wr7GNO54pLQPeuiNwpREsK9JDm2p5dMLYdXB8Dzedr4HOXyx+W/fx5XRuSGdC6JjDyyeN0BFSpq5cYULmsPpZStIV2xRxQ1pq6f6Hdp4e4GPTLWPToJALiHX9I5ZiPxwu8Ynr+5DgAA38Av6VzgPgasNQAAvJ7P/4Z//vfuRgAAAAAX8fn///2vf/755+5mAAAAAJfw+df//Ouff/7n7mYAAAAAl/B/pXrqRRPIeGoAAAAASUVORK5CYII=" alt="" />
在配置文件里配置 Bean 时, 有时需要在 Bean 的配置里混入系统部署的细节信息(例如: 文件路径, 数据源配置信息等). 而这些部署细节实际上需要和 Bean 配置相分离
Spring 提供了一个 PropertyPlaceholderConfigurer 的 BeanFactory 后置处理器, 这个处理器允许用户将 Bean 配置的部分内容外移到属性文件中. 可以在 Bean 配置文件里使用形式为 ${var} 的变量, PropertyPlaceholderConfigurer 从属性文件里加载属性, 并使用这些属性来替换变量.
Spring 还允许在属性文件中使用 ${propName},以实现属性之间的相互引用。
一个原始的数据库源配置
1.引入类库-c3p0 和 mysql:
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.35</version>
</dependency>
2.配置ComboPooledDataSource数据源bean实例:
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="user" value="root"></property>
<property name="password" value="root"></property>
<property name="driverClass" value="com.mysql.jdbc.Driver"></property>
<property name="jdbcUrl" value="jdbc:mysql://127.0.0.1:3306/retrieval?characterEncoding=UTF-8"></property>
</bean>
3.测试:
public class App { @SuppressWarnings("resource")
public static void main(String[] args) throws SQLException {
ApplicationContext ctx = new ClassPathXmlApplicationContext("beans-properties.xml");
DataSource ds = ctx.getBean("dataSource",DataSource.class);
System.out.println(ds.getConnection());
} }
结果:
六月 18, 2015 10:20:03 上午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@2919d975: startup date [Thu Jun 18 10:20:03 CST 2015]; root of context hierarchy
六月 18, 2015 10:20:03 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [beans-properties.xml]
六月 18, 2015 10:20:04 上午 com.mchange.v2.log.MLog
信息: MLog clients using java 1.4+ standard logging.
六月 18, 2015 10:20:04 上午 com.mchange.v2.c3p0.C3P0Registry
信息: Initializing c3p0-0.9.5.1 [built 16-June-2015 00:06:36 -0700; debug? true; trace: 10]
六月 18, 2015 10:20:04 上午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource
信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1bqwdwp9a18ly9s70r2uf|45daddae, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1bqwdwp9a18ly9s70r2uf|45daddae, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://127.0.0.1:3306/retrieval?characterEncoding=UTF-8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
com.mchange.v2.c3p0.impl.NewProxyConnection@79af126e [wrapping: com.mysql.jdbc.JDBC4Connection@54e3322b]
从外部属性文件中读取
1.创建一个属性文件-db.properties
user=root
password=root
driverClass=com.mysql.jdbc.Driver
jdbcUrl=jdbc:mysql://127.0.0.1:3306/retrieval?characterEncoding=UTF-8
2.注册 PropertyPlaceholderConfigurer.使其可以从属性文件中加载属性.
首先引入命名空间context.
<!-- 导入属性文件 -->
<context:property-placeholder location="classpath:db.properties"/> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<!-- 使用外部属性文件中的属性 -->
<property name="user" value="${user}"></property>
<property name="password" value="${password}"></property>
<property name="driverClass" value="${driverClass}"></property>
<property name="jdbcUrl" value="${jdbcUrl}"></property>
</bean>
这样就完成部署了.
这样做的好处:修改外部属性文件的成本要比修改Spring 配置文件的成本要低的多.
spring4-2-bean配置-6-使用外部属性文件的更多相关文章
- Spring4.0学习笔记(4) —— 使用外部属性文件
1.配置xml文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="htt ...
- Spring4学习笔记 - 配置Bean - 自动装配 关系 作用域 引用外部属性文件
1 Autowire自动装配 1.1 使用:只需在<bean>中使用autowire元素 <bean id="student" class="com.k ...
- Spring - 配置Bean - 自动装配 关系 作用域 引用外部属性文件
1 Autowire自动装配1.1 使用:只需在<bean>中使用autowire元素<bean id="student" class="com.kej ...
- IoC容器-Bean管理XML方式(引入外部属性文件)
IoC操作Bean管理(引入外部属性文件) 1,直接配置数据库信息 (1)配置德鲁伊连接池 (2)引入德鲁伊连接池依赖jar包 2,通过引入外部属性文件配置数据库连接池 (1)创建外部属性文件,pro ...
- spring 使用外部属性文件
一.PropertyPlaceholderConfigurer spring提供的PropertyPlaceholderConfigurer实现类能够使Bean在配置时引用外部属性文件. Proper ...
- [原创]java WEB学习笔记99:Spring学习---Spring Bean配置:自动装配,配置bean之间的关系(继承/依赖),bean的作用域(singleton,prototype,web环境作用域),使用外部属性文件
本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...
- Spring(十):Spring配置Bean(三)Bean的作用域、使用外部属性文件
Bean的作用域: 支持四种配置,分别是singleton,prototype,request,session. singleton 默认情况下在spring confinguration xml文件 ...
- 使用外部属性文件配置Bean以及Bean的生命周期方法
1.使用外部属性文件配置Bean 在配置文件里配置 Bean 时, 有时需要在 Bean 的配置里混入系统部署的细节信息(例如: 文件路径, 数据源配置信息等). 而这些部署细节实际上需要和 Bean ...
- Spring-Bean配置-使用外部属性文件(转)
Spring-Bean配置-使用外部属性文件 所以可以通过@value注解获取配置文件的key-value,生成一个配置文件bean.用以在代码中直接使用bean的方式. •在配置文件里配置Bean时 ...
随机推荐
- video4linux(v4l)使用摄像头的实例基础教程与体会(转)
1. video4linux基础相关 1.1 v4l的介绍与一些基础知识的介绍 I.首先说明一下video4linux(v4l). 它是一些视频系统.视频软件.音频软 ...
- ecmall挂件开发实例二(转)
下述例子讲述了快速增加挂件的方法,但对系统中的代码未做更改,基本参照image_ad挂件的方法. 第 一步: 了解首页模板结构 首页文 件结构 include hearder.html 包含的头文件, ...
- wdlinux中apache配置反向代理模块
想要在.htaccess中开启反向代理功能都不行[apache中没有mod_proxy模块] .htaccess 文件内容如下 RewriteEngine On RewriteBase / Rewri ...
- wdlinux重新编译nginx
背景: 由于web站点需要换主机,并且切换环境. 站点需要做反相代理(nginx),主机从美国迁移到香港[考虑到速度问题,为什么不用大陆阿里云ECS服务器?几十个域名备案麻烦,还有阿里云内地没有多ip ...
- cocos2dx 3.0 编译工程
下载完2dx,运行setup.py,参考设置ANDROID_SDK,NDK_ROOT,ANT_ROOT变量 创建工程 cocos new testGame -p com.game.test -l cp ...
- jmeter线程组 讲解
- java web 程序---登陆的验证码实现显示
是一个java文件 package com.sss; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; im ...
- [转]Jsp 映射
<servlet> <servlet-name>SimpleJspServlet</servlet-name> <jsp-file>/jsp/simpl ...
- Mybatis扩展
分页插件PageHelper 其实Mybstis内部有实现逻辑分页的功能,但是较为麻烦和难用.这里记录一个分页插件PageHelper的使用,我们可以在它的github地址https://github ...
- 【洛谷】P1095 守望者的逃离(递推)
题目描述 恶魔猎手尤迪安野心勃勃,他背叛了暗夜精灵,率领深藏在海底的娜迦族企图叛变.守望者在与尤迪安的交锋中遭遇了围杀,被困在一个荒芜的大岛上.为了杀死守望者,尤迪安开始对这个荒岛施咒,这座岛很快就会 ...