可以从Jar外部加载JDBC.properties的Spring-mybatis配置文件


<beans
        xmlns="http://www.springframework.org/schema/beans"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:aop="http://www.springframework.org/schema/aop"
        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/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc.xsd">
    
    package="com.jiuzhou.crawler"/>

    
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        
    
    class="org.apache.commons.dbcp.BasicDataSource"
          destroy-method="close">
        
        
        
        
        
        

        
        

        
        

        
        

        
        
    

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

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


    
    class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        
    
    

 

转载于:https://www.cnblogs.com/justuntil/p/8042962.html

你可能感兴趣的:(java,测试)