SpringBoot学习路上遇到的问题
有 N 人看过
数据库无法连接
配置文件异常 例如:
1
2
3
4
5
6
7spring:
datasource:
driver-class-name: com.mysql.jdbc.Driver
Url: jdbc:mysql://:/WXDinner?
username:
password:但是下方的方式可以使用
1
2
3
4spring.datasource.driver-class-name= com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://:/WXDinner?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false
spring.datasource.username=
spring.datasource.password=没装连接用的jar包
SpringBoot测试
例子
1 |
|
Service错误
未使用注释@Service,若使用serviceimp则应在impl中标注@Service
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
mapper.java与mapper.xml文件名应相同
1 | mapper-locations未配置正确 |