Configure mybatis introduced properties file

<? Xml Version = "1.0" encoding = "UTF-8" ?> 
<! DOCTYPE the Configuration 
  the PUBLIC "- // mybatis.org//DTD Config 3.0 // EN" 
  "http://mybatis.org/dtd/mybatis config.dtd--3 " > 
< the Configuration > 
 <-! introduction of external properties file must be on the front, otherwise it will error -> 
 < properties Resource =" db.properties " > </ properties > 
<-! and after the abolition of environments Spring integration configuration -> 
  < Environments default = "Development" > 
    < Environment the above mentioned id = "Development " > 
    <-! using JDBC transaction management  -->
      <transactionManager type="JDBC"/>
      <!--数据库连接池  -->
      <dataSource type="POOLED">
        <property name="driver" value="${jdbc.driverClass}"/>
        <property name="url" value="${jdbc.url}"/>
        <property name="username" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>
      </dataSource>
    </environment>
  </environments>
  <!--加载xml文件  -->
  <mappers>
    <mapper resource="mapper/UserMapper.xml"/>
  </mappers>
</configuration>

 Reference:  https://blog.csdn.net/m0_37294838/article/details/59491177

Guess you like

Origin www.cnblogs.com/zjulanjian/p/10972960.html