This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Couldn't able to insert image file in MySQL, Data truncation: Data too long for column 'image' at... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Couldn Watch "Couldn New topic
Author

Couldn't able to insert image file in MySQL, Data truncation: Data too long for column 'image' at...

Venkattesh Iyer
Greenhorn

Joined: Jun 15, 2008
Posts: 6
Hello friends,

I dont know what to do, i am tring to insert the image (blob) in to the table but I am getting such error
Data truncation: Data too long for column 'image' at row 1

Here is the code.




Please guide me,


Thanks,

Venkat.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38033
    
  22
Don't know, but what size image are you passing and what size BLOB did you specify?
Venkattesh Iyer
Greenhorn

Joined: Jun 15, 2008
Posts: 6
Ya the size of the file was more than tha size of BLOB.
I could solve by using LONGBLOB

Thanks, Venkat
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38033
    
  22
You're welcome
 
wood burning stoves
 
subject: Couldn't able to insert image file in MySQL, Data truncation: Data too long for column 'image' at...
 
Similar Threads
Null pointer exception in con.createStatement();
How to store image in JSP from BLOB captured in Oracle
image insert problem
Problem with Uploading Pictures using Jsp
Struts 2 -Eclipse