Unknown initial character set index ‘255‘ received from server. Initial client character 解决方法

Unknown initial character set index ‘255’ received from server. Initial client character set can be forced via the ‘characterEncoding’ property.

Found a problem with the character set settings from the error message

This error occurs when mysql connects to the database:

//String url = “jdbc:mysql://localhost:3306/db_cjky” If you use this sentence, an error will be reported.
//Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.
String url = “jdbc:mysql://localhost:3306/db_cjky?useUnicode=true&characterEncoding=utf8” ;//Change it to this sentence and it will be fine

Modify the database connection configuration to (still reporting an error):
Insert image description here

Reference link: https://blog.csdn.net/amesvan/article/details/80938145

Final solution: XML cannot parse special characters (&)

打开sqlMapconfig.xml,使用(& )代替(&)

Insert image description here

The final result can be run:
Insert image description here

Supongo que te gusta

Origin blog.csdn.net/qq_45442178/article/details/113274816
Recomendado
Clasificación