<?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:mvc="http://www.springframework.org/schema/mvc"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
	<!-- 配置解析properties文件的工具类 -->
	<context:property-placeholder location="classpath:db.properties"/>
	
	<!-- 创建数据源 -->
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    	<property name="driverClassName" value="${jdbc.driver}"></property>
    	<property name="url" value="${jdbc.url}"></property>
    	<property name="username" value="${jdbc.username}"></property>
    	<property name="password" value="${jdbc.password}"></property>
    </bean>
	
	<!-- 创建mybatis的上下文对象  -->
	<bean class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="dataSource">
			<ref bean="dataSource"/>
		</property>
		<property name="configLocation">
			<value>classpath:SqlMapperClient.xml</value>
		</property>
	</bean>
	
	<!-- 扫描mybatis的接口与映射配置文件 -->
	<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
		<property name="basePackage" value="com.bjsxt.mapper"/>
	</bean>
</beans>