Beginner |
|
Joined: Thu Jul 22, 2004 10:51 pm Posts: 29 Location: sydney australia
|
Hibernate 3.2.2
Postgres 8.2
I'm trying to store a GZIP byte array in my database. My field is a byte[], and my column type is text of unspecified length. with this combination i get the error:
column "myColumn" is of type text but expression is of type bytea
I tried using field type String and converting the byte[] to String using new String(byte[], Charset.forName("UTF8")) (which worked) but when inserting via hibernate I was getting this error:
ERROR: invalid byte sequence for encoding "UTF8": 0x00
So is there a better data type to use rather than text or is there a way of encoding the byte[] to String so it doesn't cause problems?
|
|