1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?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:aop="http://www.springframework.org/schema/aop"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xmlns:context="http://www.springframework.org/schema/context"
- 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.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-4.3.xsd" >
-
- <!-- 加载配置文件 -->
- <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="locations">
- <list>
- <value>classpath:jdbc.properties</value>
- <value>classpath:basicInfo.properties</value>
- </list>
- </property>
- </bean>
-
- <!-- 数据源的配置 -->
- <bean id = "dataSource" class="org.apache.commons.dbcp.BasicDataSource">
- <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>
-
- <!-- session工厂 -->
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="dataSource"/>
- <property name="typeAliasesPackage" value="com.fuzamei.entity"/>
- <property name="mapperLocations" value="classpath:com/fuzamei/mapper/*.xml"/>
- <property name="configLocation" value = "classpath:mybatis-config.xml"/>
- </bean>
-
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="com.fuzamei.mapperInterface"/>
- </bean>
-
- </beans>
|