Click to See Complete Forum and Search --> : DB2 Blob support with hibernate & java


Ryland
February 24th, 2009, 09:05 AM
We have an existing database that has user passwords stored in a blob column of a DB2 database. This has worked fine for the existing application (we are able to pull the encrypted password out without issues) but we are working on an EJB3 implementation with hibernate. The data is in multiples of 8 bytes but when I use:


private byte[] password;
@Lob
@Column(name="password")
public byte[] getPassword() {
return password;
}
public void setPassword(byte[] password) {
this.password = password;
}


I get 35 bytes for the password. I have tried various data types instead of "byte[]" but nothing is getting me back the correct size data. Does anybody have any ideas as to what I am doing wrong?

Thanks