欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

第二十章、SpringBoot2.x整合Mybatis3.x注解配置(SpringBoot2.x)

程序员文章站 2022-07-07 11:27:02
...

SpringBoot2.x整合Mybatis3.x注解配置

        1、使用starter, maven仓库地址:http://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter

        2、加入依赖(可以用 http://start.spring.io/ 下载)

<!-- 添加mybatis依赖 -->
<dependency>
	<groupId>org.mybatis.spring.boot</groupId>
	<artifactId>mybatis-spring-boot-starter</artifactId>
	<version>2.1.1</version>
	<scope>runtime</scope>
</dependency>

<!-- MySQL的JDBC驱动包 -->
<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
        <version>5.1.37</version>
	<scope>runtime</scope>
</dependency>

<!-- 引入第三方数据源  阿里巴巴的连接池 -->
<dependency>
	<groupId>com.alibaba</groupId>
	<artifactId>druid</artifactId>
	<version>1.1.6</version>
</dependency>

     

相关标签: SpringBoot 2.x