@Spring Boot JPA findBy(Property)方法输入中文,返回结果为空(null)
Spring Boot JPA findBy(Property)方法输入中文,返回结果为空(null)
你也入坑了吧!都是编码惹的祸!
问题产生处
url后面加上:? useUnicode=true&characterEncoding=utf-8
spring:
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/testdb? useUnicode=true&characterEncoding=utf-8
username: root
password: suntek