<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:lang="http://www.springframework.org/schema/lang"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:util="http://www.springframework.org/schema/util"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-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/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-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/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

	<!-- Root Context: defines shared resources visible to all other web components -->

	<!-- property -->
	<context:property-placeholder location="classpath:/database.properties" />

	<!-- DATASOURCE -->
	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
		<property name="driverClassName" value="${jdbc.driver}" />
		<property name="url" value="${jdbc.url}" />
		<property name="username" value="${jdbc.user}" />
		<property name="password" value="${jdbc.password}" />
		<property name="initialSize" value="${dbcp.initialSize}" />
		<property name="maxActive" value="${dbcp.maxActive}" />
		<property name="maxIdle" value="${dbcp.maxIdle}" />
		<property name="maxWait" value="${dbcp.maxWait}" />
		<property name="poolPreparedStatements" value="${dbcp.poolPreparedStatements}" />
		<property name="testOnBorrow" value="${dbcp.testOnBorrow}" />
		<property name="maxOpenPreparedStatements" value="${dbcp.maxOpenPreparedStatements}" />
		<property name="logAbandoned" value="${dbcp.logAbandoned}" />
		<property name="removeAbandoned" value="${dbcp.removeAbandoned}" />
		<property name="removeAbandonedTimeout" value="${dbcp.removeAbandonedTimeout}" />
		<property name="validationQuery" value="${dbcp.validationQuery}" />
	</bean>

		<!-- IBATIS -->
		<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
			<property name="configLocation" value="classpath:/sqlMapConfig.xml" />
			<property name="dataSource" ref="dataSource" />
			<property name="mappingLocations" value="classpath*:/com/**/**/sqlmap/*-sqlMap.xml" />
		</bean>

		<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
			<property name="dataSource" ref="dataSource" />
		</bean>

</beans>
