初次没习hibernate,其中遇到问题在网上找的答案与大家共同分享!
hibernate.cfg.xml加上属性.
true UTF-8 mysql 的驱动用3.0.15以上版本的,
加个Filter, 使用UTF-8字符集就可以了,
若使用Spring则写在spring中的sessionFactory里即可。
例如:
BR>"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
root
jdbc:mysql://localhost:3306/hibernate_table
org.hibernate.dialect.MySQLDialect
mySql hibernatetable
12345678
com.mysql.jdbc.Driver
true
UTF-8
true
true
Statement: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