Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate Converting byte[] into SQL Blob

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have defined a column in my mysql table as blob, as i intend to use it to store images which are actually array of byte that is byte[], I have generated
all the hibernate codes and its works perfectly


and the Java Accessor


But in my program i want to know how can i convert a byte[] into Blob, since i am expected to pass a Blob object into the setImageByte method
 
Walter Bernstein
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Abiodun Adisa:
... since i am expected to pass a Blob object into the setImageByte method

No.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic