开发者

mysql jdbc incorrect string value

I am executing this query

insert into tbl (name) values('Î');

When I execute this query from my application with jdbc then I get following error

Incorrect string value: '\xEF'

If I execute same query with Sql Manager for MySql then it executes successfully

开发者_Python百科

my jdbc connection string is like this

jdbc:mysql://localhost:3306/mydb?useUnicode=yes&characterEncoding=UTF-8

any idea where am I wrong ?


your mysql instance might not be configured to accept your character set. Im not an expert but i saw this in the mysql documentation

ALTER TABLE myTable MODIFY myColumn VARCHAR(255) CHARACTER SET utf8;

found here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜