“Incorrect string value” when trying to insert UTF-8 into MySQL via JDBC?

前端 未结 18 934
无人及你
无人及你 2020-11-22 07:51

This is how my connection is set:
Connection conn = DriverManager.getConnection(url + dbName + \"?useUnicode=true&characterEncoding=utf-8\", userName, password

18条回答
  •  花落未央
    2020-11-22 08:01

    Its mostly caused due to some unicode characters. In my case it was the Rupee currency symbol.

    To quickly fix this, I had to spot the character causing this error. I copy pasted the entire text in a text editor like vi and replaced the troubling character with a text one.

提交回复
热议问题