• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inserting image to MySQL Database

 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,

I have a mysql database table called hrms_photo. The table details are shows below


I have the following program for uploading the image to MySQL database.



When I run the program, I cannot insert the image which is larger than 50KB. In the log file, I'm getting the error like this



Please help me to sort this issue Ranchers..

Thanks/Regards
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
YOu probably want to swap to a larger BLOB data type if you are hitting the limit. MySQL also has mediumblob and largeblob.
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou Mr.Paul Sturrock ,

I have put mediumblob and it worked fine. But I couldn't find LargeBlob.. Please advise.

Thanks/Regards
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, my mistake. Its called longblob.
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou very much!!

Regards
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is also a MySQL setting. I tried your code, but a) it's limit is 64KB on my machine, and b) it just truncated without aborting.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic