SpringBoot整合Mybatis

二、代码功能

   

application.perteries

spring.datasource.type=com.alibaba.druid.pool.DruidDataSource

spring.datasource.username=root

spring.datasource.password=123

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/jdbctemplates?useUnicode=true&characterEncoding=utf8&useSSL=true&serverTimezone=GMT

   

   

   

和SSM框架一样我就不写了

   

注:要在

这个类里加入扫描Mapper下的类

   

   

@MapperScan(basePackages="com.hufei.mybatis.mybatisdemo.mapper")

原文地址:https://www.cnblogs.com/fernfei/p/12119644.html