When using Hibernate for project development, the Chinese edit save garbled problem. A lot of people are Baidu a bit, and then copy paste
The code behind the data connection is as follows
<property name= "Connection.url" >
jdbc:mysql://localhost:3306/tansinglepage
</property>
Modified to:
<property name= "Connection.url" >
jdbc:mysql://localhost:3306/tansinglepage? useunicode=true&characterencoding=utf-8
</property>
But in particular, it is important to note that
Jdbc:mysql://localhost:3306/heshenghuo Useunicode=true&characterencoding=utf-8 This only applies to XML files, if you configure the properties file to read the data. Will not be, garbled still appear.
AMP in the properties file, remove the following wording:
Jdbc:mysql://localhost:3306/heshenghuo?useunicode=true&characterencoding=utf-8
Special Major &
Hibernate Access Chinese garbled