473,396 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 27987
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

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

Similar topics

5
by: uthuras | last post by:
Machine : AIX 5.2 Product : UDB DB2 Release 8.1 FP4a I have problem loading data into destination table. The data file is huge with more than 6 Million records. This what i have done 1....
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
0
by: Grip | last post by:
Hi, I have gone throught the group and Microsoft's online help and have seen many suggestions but I am still seeking clarity: 1. I have an excel spreadsheet. Column A contains text that may...
4
by: eviewcs | last post by:
Hello I am a newbie in DB2. I am trying out the Mapping Java definitions to SQL on UDT from the article "DB2's object-relational highlights: Store and invoke structured type objects" by Kathryn...
21
madhoriya22
by: madhoriya22 | last post by:
Hi, Here is the query which I am using to get the values from the database:- "SELECT ?, COUNT(*) AS COUNT " + "FROM DEFECT_DETAIL " + "WHERE TARGET_MILESTONE = ? " + "GROUP BY ?"; ...
1
by: banging | last post by:
Hi there, I have a question regarding locking of tables so that when two or more people try to write or update the mysql tables, it locks up. Basically I only want one person to write to the...
2
by: meenuchotijuhi | last post by:
Hi, I've Recently joined this community coz i m very much interested in Oracle DBA track. Actaully I' m currently working on a project where I m using Java (jdk1.4) as front end and Oracle 9i as...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.