In the development of java web, there will be a strange thing that the Chinese content will be garbled when it is written into the database. You can check and solve it according to the following points:

1. Check whether the utf-8 encoding format is set on the page.
 Solution to Chinese garbled code when Java is submitted to MySQL database

2. Check the character set encoding format of the MySQL database.
Execute the statement after logging into the database SHOW VARIABLES LIKE 'character%'; Finally, it is safe to uniformly set it to utf-8
 Solution to Chinese garbled code when Java is submitted to MySQL database

3. Set the encoding format in the java program.
Add the following code in the appropriate location:

 request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");

4. When creating a database, Navicate should ensure that the code is utf-8, as shown in the following figure:
 Solution to Chinese garbled code when Java is submitted to MySQL database

5. Modify the specified code of the connection MySQL address.
Refer to the following modification:

 jdbc: mysql://localhost:3306/ Database name? useUnicode=true&characterEncoding=utf-8