469,304 Members | 2,303 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

java.sql.SQLException: Data truncated for column at row 1

Hi all,

When I update a table by sql qry, I am getting a error like "java.sql.SQLException: Data truncated for column [column_name] at row 1" . I use mysql 4.1 for my application.
this particular column is in varchar with length 10.

Can anyone help regarding this??
Sep 24 '08 #1
3 20156
JosAH
11,448 Expert 8TB
Most likely you attempted to store a String with more than ten characters in
that column.

kind regards,

Jos
Sep 24 '08 #2
Most likely you attempted to store a String with more than ten characters in
that column.

kind regards,

Jos

But the data is exactly of 9 character and its constant.
Sep 25 '08 #3
JosAH
11,448 Expert 8TB
But the data is exactly of 9 character and its constant.
I don't use mysql myself but I suspect that a char in a varchar is an eight bit
quantity and Java's char is a 16 bit quantity; some encoding is happening
(most likely). Try to change your table column to varchar 20 or so and see
what happens.

kind regards,

Jos
Sep 25 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by uthuras | last post: by
4 posts views Thread by eviewcs | last post: by
madhoriya22
21 posts views Thread by madhoriya22 | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.