SpringBoot 的目的就是为了简化spring的初始搭建及开发过程 就是简化 依赖 及配置文件
1.springboot的特点
① 创建独立的 Spring 应用程序
② 嵌入的 Tomcat,无需部署 WAR 文件
③ 简化 Maven 配置
④ 自动配置 Spring
⑤ 提供生产就绪型功能,如指标,健康检查和外部配置
⑥ 开箱即用,没有代码生成,也无需 XML 配置。
2. 创建过程
3.SpringBoot内置有tomcat运行 在controller下写
为mapper接口生成代理实现类
在application.properties中配置文件
#
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql:///liu
spring.datasource.username=root
spring.datasource.password=123456
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl