springboot 启动后访问报错
问题:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
原因:mybatis 的全局配置文件和 sql 映射文件没有写
解决:在 application.yml 中添加 mybatis 配置
mybatis:# 全局配置文件config-location: classpath:mybatis/mybatisConf.xml# sql 映射文件mapper-locations: classpath:mybatis/mapper/*.xml
# configuration:
# # 开启驼峰命名
# map-underscore-to-camel-case: true
application.yml 问题整合(application.properties)
问题:driver-class-name: com.mysql.cj.jdbc.Driver
爆红
解决:在 pom.xml 中添加 mysql 依赖
<dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId></dependency>