spring通过hibernate插入数据,mysql中文显示问号?
经过多番查探,该问题解决,再次做记录:
如果url是写在hibernate.cfg.xml这样的xml文件中,需要在&后面加上:amp;。即xml的配置文件中 “&”要用 “& amp ; ” 代替:
jdbc:mysql://localhost:3306/spring001?useUnicode=true&characterEncoding=UTF-8
如果在其他的则不用,如上,我自己写的db.properties文件则不需要加上
jdbc:mysql://localhost:3306/spring001?useUnicode=true&characterEncoding=UTF-8
spring通过hibernate插入数据,mysql中文显示问号?
https://blog.jeecloud.cn/2017/11/01/20171102041500/