fairnet/src/main/resources/egovframework/spring/com/context-datasource.xml
tolag3 e4632bc333 이준호 jndi설정 변경
- 운영환경에 맞게 jndi 접속정보 받아오도록 수정
    - -Dspring.profiles.active 받아오도록
2024-08-29 11:04:09 +09:00

49 lines
2.5 KiB
XML

<?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:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-4.0.xsd">
<!-- 환경설정 기본정보를 globals.properties 에서 참조하도록 propertyConfigurer 설정 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:/egovframework/egovProps/globals_#{systemProperties['spring.profiles.active']}.properties</value>
</list>
</property>
</bean>
<util:properties id="property" location="classpath:/egovframework/egovProps/globals_#{systemProperties['spring.profiles.active']}.properties" />
<!-- datasource 설정(propertyConfigurer 활용) -->
<alias name="dataSource-${Globals.DbType}" alias="dataSource" />
<alias name="dataSource-${Globals.DbType}" alias="egov.dataSource" />
<!-- Oracle -->
<bean id="dataSource-oracle-spied" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${Globals.DriverClassName}" />
<property name="url" value="${Globals.Url}" />
<property name="username" value="${Globals.UserName}" />
<property name="password" value="${Globals.Password}" />
</bean>
<bean id="dataSource-oracle" class="net.sf.log4jdbc.Log4jdbcProxyDataSource">
<constructor-arg ref="dataSource-oracle-spied" />
<property name="logFormatter">
<bean class="kcc.let.utl.log4j.Log4JdbcCustomFormatter">
<property name="loggingType" value="MULTI_LINE" />
<property name="margin" value="8" />
<property name="sqlPrefix" value="SQL:" />
</bean>
</property>
</bean>
<bean id="mybatisDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<!-- <property name="jndiName" value="jndi/XE"/> -->
<!-- 운영환경에따른 분기 -->
<property name="jndiName" value="jndi/#{systemProperties['spring.profiles.active']}"/>
<property name="resourceRef" value="true" />
</bean>
</beans>