MyBatis 中两表关联查询MYSQL (14)

MyBatis两表关联查询MYSQL

1、创建数据库表语句

MyBatis 中两表关联查询MYSQL (14)

2、插入测试数据

MyBatis 中两表关联查询MYSQL (14)

 

 3、pom文件内容

<?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> <environments default="development"> <environment> <transactionManager type="JDBC"/> <dataSource type="POOLED"> <property value="com.mysql.jdbc.Driver"/> <property value="jdbc:mysql://127.0.0.1:3306/mybatis01"/> <property value="root"/> <property value="root"/> </dataSource> </environment> </environments> <mappers> <!-- jack.zhao 加载映射文件 --> <mapper resource="com/mybatis03/mapper/personMapper.xml"/> <mapper resource="com/mybatis03/mapper/TeacherMapper.xml"/> </mappers> </configuration>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwxwxw.html