开发者

mysql jdbc incorrect string value

开发者 https://www.devze.com 2023-03-12 19:17 出处:网络
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

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

精彩评论

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