分布式项目开发-spring-dao.xml基础配置

基础步骤:

1 数据源

2 sqlSessionFactory

3 MapperScan

打包。

db.properties文件

db.username=root
db.password=123456
db.url=jdbc:mysql://192.168.15.135:3310/user
db.driverClassName=com.mysql.jdbc.Driver  

 



    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">

    
    class="com.alibaba.druid.pool.DruidDataSource">
        
        
        
        
            value="${db.driverClassName}" />
    

    
    class="org.mybatis.spring.SqlSessionFactoryBean">
        
        
        
    

    
    class="org.mybatis.spring.mapper.MapperScannerConfigurer">
      
      
    

 

你可能感兴趣的:(分布式项目开发-spring-dao.xml基础配置)