mybatis之mybaits-config.xml一般配置文件

xml version="1.0" encoding="UTF-8"?>
DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>
    
    
    
    <properties resource="db.properties"/>

    
    
    <typeAliases>
        <typeAlias type="cn.itcast.javaee.mybatis.app04.Student" alias="student"/>
    typeAliases>
    

    
    <environments default="mysql_developer">
    
    
        
        <environment id="mysql_developer">
            
            <transactionManager type="jdbc"/>
            
            <dataSource type="pooled">
                
                <property name="driver" value="${mysql.driver}"/>
                <property name="url" value="${mysql.url}"/>
                <property name="username" value="${mysql.username}"/>
                <property name="password" value="${mysql.password}"/>
            dataSource>
        environment>
        
        
        
        
        
        <environment id="oracle_developer">
            
            <transactionManager type="jdbc"/>
            
            <dataSource type="pooled">
                
                <property name="driver" value="${oracle.driver}"/>
                <property name="url" value="${oracle.url}"/>
                <property name="username" value="${oracle.username}"/>
                <property name="password" value="${oracle.password}"/>
            dataSource>
        environment>
    environments>
    
    
    
    
    
    
    <mappers>
        <mapper resource="cn/itcast/javaee/mybatis/app14/StudentMapper.xml"/>
    mappers>
    
    
    
configuration>

 

转载于:https://www.cnblogs.com/wangxiaochao/p/9314597.html

你可能感兴趣的:(mybatis之mybaits-config.xml一般配置文件)