One: Modify the MySQL configuration file My-default.ini (possibly another name My.ini) add the following (change the original):
This is the part that adds the following
[Client]
Default-character-set=utf8
[Mysqld]
Character-set-server=utf8
Collation-server=utf8_general_ci
[MySQL]
Default-character-set=utf8
Two: Modify the property node in the DataSource node my following:
<property name= "Jdbcurl" value= "Jdbc:mysql://localhost:3306/goods?useunicode=true& Characterencoding=utf-8"/>
Three databases and tables created in MySQL are set to a consistent encoding:
Database settings:
The table (varchar field) also sets the setting:
The 4 effects are as follows:
Three: There are JSP pages to set the encoding as follows:
After an afternoon of the end or the node added up on it out!!
S2sh inserting a record into the MySQL database displays the resolution of the question mark (with Utf-8)