<?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:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<!-- db oracle 연결
destory-method : 소멸자
drverClassName : 해당 DB 드라이버
url : DB연결정보
username : 접속ID
password : 접속PW
initialSize : 초기연결수
maxActive :최대연결수
maxIdle : Idle 상태 소유한 최대연결수
minIdle : Idle 상태 소유한 최소연결수
maxWait : 커넥션이 존재하지 않을 때, 커넥션을 얻기까지 대기하는 최대 대기시간
removeAbandoned : 유효하지 않는 커넥션의 제거 여부
removeAbandonedTimeout : 유효하지 않은 커넥션의 삭제시의 타임아웃
validationQuery : 연결 정상확인
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
목록에 엇는 사용값
testOnBorrow : 풀에서 커넥션을 가져올시 커넥션의 유효성 검사(TRUE || FALSE)
testOnReturn : 풀에 커넥션을 리턴할 때 커넥션의 유효성 검사(TRUE || FALSE)
testWhileIdle : Idle상태에 커넥션의 유효성 검사(TRUE || FALSE)
timeBetweenEvictionRunsMillis : 설정된 주기를 통해 Evict(유효하지 않는 커넥션/정의된 시간이 만료된 커넥션을 풀에서 제거) 쓰레드를 수행
minEvictableIdleTimeMiilis : Evict 쓰레드를 수행시, 만료여부를 체크할 시간을 정의
numTestsPerEvictionRun : Evict 쓰레드를 수행시 수행할 커넥션의 갯수
logAbandoned : 유효하지 않는 커넥션을 생성한 코드 위치 로그생성 여부(TRUE || FALSE)
defaultAutoCommit : 생성된 커넥션의 기본 auto commit 여부(TRUE || FALSE)
defaultReadOnly : 생성된 커넥션의 기본 read-only 여부(TRUE || FALSE)
defaultTransactionIsolation : 생성된 커넥션의 기본 트랜잭션 격리 수준
defaultCatalog : 생성된 커넥션의 기본 카탈로그
connectionInitSqls : SQL statements의 컬렉션으로 물리적 커넥션의 최기화에 사용. 설정된 커넥션 생성. DEFAULT : NULL?
poolPreparedStatements : Prepared Statements 사용 여부(TRUE || FALSE)
maxOpenPreparedStatements : Prepared Statements 최대 Open 갯수
accessToUnderlyingConnectionAllowed : 물리적 연결 여부 (TRUE || FALSE)?
minIdle : Idle상태에 풀이 소유한 최소 커넥션 갯수
-->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
p:driverClassName="oracle.jdbc.driver.OracleDriver"
p:url="jdbc:oracle:thin:@localhost:1521:orcl"
p:username="ID"
p:password="PW"
p:initialSize="2"
p:maxActive="30"
p:maxIdle="10"
p:minIdle="3"
p:maxWait="30000"
p:removeAbandoned="true"
p:removeAbandonedTimeout="30"
p:validationQuery="SELECT 1 FROM DUAL" />
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="/WEB-INF/spring/mybatis-config.xml" /> <!-- mybatis 설정 -->
<!--<property name="typeAliasesPackage" value="com.test.web" /> -->
<property name="mapperLocations" value="classpath*:mapper/*Mapper.xml" /> <!-- mapper 경로 -->
<!-- <property name="mapperLocations" value="classpath*:mapper/*Mapper.xml" /> -->
</bean>
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="sqlSessionFactory" />
</bean>
<!-- dao 스캔 -->
<bean class= "org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.java.spring.mapper" /> <!-- mapper interface pakage -->
</bean>
</beans>