springBoot整合mybatis(待补充)
1.创建工程,导入依赖
创建springBoot工程的步骤忽略,在pom中加入依赖:
<!-- Spring Boot Mybatis 启动依赖 --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.0</version> </dependency><!-- Spring Boot Web 依赖:web项目启动需要 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
会发现,在对应的pom中导入了mybatis需要依赖的jar包
配置yml或者 properties文件
配置数据库连接信息
这步一定不能少,否则无法正常启动,会报连接异常