471,887 Members | 1,824 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

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
4 26296
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
sonikaa
1 Bit
Java is one of the most generally used programming languages, and it is utilized as the server-side language for a vast of back-end development projects, including big data and Android development. Java is also commonly used in desktop and mobile computing, games, and numerical calculation. Java is an object-oriented programming language with a high level of abstraction and as few implementation dependencies as possible. Java classes in Pune
Mar 30 '22 #5

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 YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.