关于JAVA往MYSQL写入中文,SQLyog显示为问号的解决方法。

在hibernate.cfg.xml文件中源码:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">hadoop</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/itcast0807crm?useUnicode=true&amp;characterEncoding=UTF-8</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialcet">org.hibernate.dialect.MySQL5Dialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="cn/itcast/crm/domain/SysUserGroup.hbm.xml"/>
</session-factory>

</hibernate-configuration>

<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/itcast0807crm的后面插入?useUnicode=true&amp;characterEncoding=UTF-8

猜你喜欢

转载自blog.csdn.net/qq_39206238/article/details/80493576