Springプロファイルの構成


Springプロファイルの構成
一、P r o p e r t y PlaceholderConfigurerプロパティファイル配置構成
<bean  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
	<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
	<property name="ignoreResourceNotFound" value="true" />
	<property name="locations">
		<list>
			<value>classpath*:/application.properties</value>
		</list>
	</property>
</bean>

二、データソース及びデータ接続プールの配置
 
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close">
		<!-- Connection Info -->
		<property name="driverClassName" value="${jdbc.driver}" />
		<property name="url" value="${jdbc.url}" />
		<property name="username" value="${jdbc.username}" />
		<property name="password" value="${jdbc.password}" />

		<!-- Connection Pooling Info -->
		<property name="initialSize" value="${jdbc.initialSize}" />
		<property name="maxActive" value="${jdbc.maxActive}" />
		<property name="maxIdle" value="${jdbc.maxIdle}" />
		<property name="maxWait" value="${jdbc.maxWait}" />
		<property name="poolPreparedStatements" value="${jdbc.poolPreparedStatements}" />
		<property name="defaultAutoCommit" value="${jdbc.defaultAutoCommit}" />
	</bean>