0

I'm using Spring framework & DB2 as database i have an entity with image field annotated as follow

@Lob
@Type(type="binary")
private byte[] image;

or

@Lob 
@Basic(fetch=FetchType.LAZY)
@Column(name="image",columnDefinition="MEDIUMBLOB")
private byte[] image;

this not work for db2 and it's return :

Caused by: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: null

Using MySQL i have never seen this error before.

Please help

1 Answers1

0

According to this question:

SqlException: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: null

SQL code -302 means the column in DB2 is too small. Try changing to a bigger BLOB data type.

Community
  • 1
  • 1
javaguest
  • 399
  • 2
  • 8