MyBatis配置文件标签详解(尚硅谷)
MyBatis核心配置文件
我们以上一篇文章的案例为例:
mybatis-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>
<!-- 1.设置连接数据库的环境 -->
<environments default="development">
<!-- 具体环境 -->
<environment id="development">
<!-- 事务管理器 -->
<transactionManager type="JDBC"></transactionManager>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/demo?serverTimezone=UTC"/>
<property name="username" value="root"/>
<property name="password" value="888888"/>
</dataSource>
</environment>
</environments>
<!-- 2.配置映射文件 -->
<mappers>
<mapper resource="mappers/ProductMapper.xml"/>
</mappers>
</configuration>
<environments>:
<environment>:
<transactionManager>:
<dataSource>:
<properties>:
<typeAliases>:
<typeAliase>
<package>
<mappers>:
<mapper>
<package>