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):
Reference link: https://blog.csdn.net/amesvan/article/details/80938145
Final solution: XML cannot parse special characters (&)
打开sqlMapconfig.xml,使用(& )代替(&)
The final result can be run: