In some scenarios we would have store large data into database like image or file. For large date Blob type is best one. If you use Hibernate as your ORM framework, there is a small trick to store Blob object into Database.
@Column(name="ImageData")
@Lob()
byte[] imageData;
Just add @Lob() annotation for variable or table column in Entity class, rest handling the Blob type will be taken care by Hibernate.
Comments
Post a Comment