开发者

insert Java char into MySQL char

开发者 https://www.devze.com 2023-03-27 14:18 出处:网络
I want to insert a Java char into a MySQL char column , but it gives a Data Truncation error. The size of the MySQL char column is 1 , and the Java char being inserted is \'Q\'

I want to insert a Java char into a MySQL char column , but it gives a Data Truncation error.

The size of the MySQL char column is 1 , and the Java char being inserted is 'Q'

I am not getting the issue , whereas the value being inserted is a proper value , is it that the MySQL char datatype is represented separately , and the Java char is not compatible with it.

Any 开发者_StackOverflow中文版inputs are appreciated.

Thanks Vivek


check with the byte code in mysql and java here is some link so conform with it

MySQL Data Truncation Error

0

精彩评论

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