MyBatis核心配置文件
我们以上一篇文章的案例为例:
面向鸿蒙编程的博客_CSDN博客-Java全栈学习笔记,算法题目,MySQL学习笔记领域博主面向鸿蒙编程擅长Java全栈学习笔记,算法题目,MySQL学习笔记,等方面的知识,面向鸿蒙编程关注java,ide,java-ee,mssql领域.https://blog.csdn.net/weixin_43715214
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>
|