Home > Database > Mysql Tutorial > hibernate+mysql中文乱码有关问题

hibernate+mysql中文乱码有关问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:15:29
Original
999 people have browsed it

hibernate+mysql中文乱码问题 小小问题困扰了几天。一路试了N种办法,最后在spring整合hibernate 的applicationContext文件中加了一句 问号后面的(包括问号) !-- 数据库地址 --property name="driverUrl"value="jdbc:mysql://127.0.0.1:3306/appcenter?useU

hibernate+mysql中文乱码问题
小小问题困扰了几天。一路试了N种办法,最后在spring整合hibernate 的applicationContext文件中加了一句  问号后面的(包括问号)

<!-- 数据库地址 -->
		<property name="driverUrl"
			value="jdbc:mysql://127.0.0.1:3306/appcenter
?useUnicode=true&characterEncoding=UTF-8" />
Copy after login


当然前期的工作也可能是有用的,比如 mysql 的my.ini 设置charset为utf8等等,其他方法在网上大多可以搜得到
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template