How to read bytea image data from PostgreSQL with JPA?
问题 I have PostgreSQL database and there is column 'image' with datatype 'bytea'. I cannot modify columns or database configurations. JPA annotated POJO contains followign mapping @Column(name="image") private byte[] image; The returned data is in following format (this is just a sample) WF5ClN6RlpLZ0hJTUdNQ1FJWmkwcFVGSUdNQ0lDWUE5TUEvanRFeElwK2x0M2tBQUFBQVNVVk9SSzVDWUlJPQo= When I write this data to file (.jpeg) photo viewer says "this is corrupted file". I also understand that actual image byte