Chinese garbled characters occur in THE JDBC database
When LEARNING JDBC, I have more than once encountered the database Chinese garble problem. The solution is as simple as adding the following statement to the url of the configuration file.
? useUnicode=true&characterEncoding=utf8
Copy the code
Chinese garbled characters appear because the encoding and decoding character set does not match, we only need to set the character set to UTF8 in the Java configuration file. Add the above code to the URL and the problem is solved.