简体   繁体   English

在Derby DB中插入数据时出现SQL错误

[英]SQL error while inserting data in Derby DB

I am getting this: 我得到这个:

SQLDataException:"java.sql.SQLDataException: An attempt was made to get a data value of type 'VARBINARY' from a data value of type 'BLOB' at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source) ~[derbyclient-10.12.1.1.jar:na]" SQLDataException:“ java.sql.SQLDataException:尝试从org.apache.derby.client.am.SQLExceptionFactory.getSQLException(未知源)上的类型为“ BLOB”的数据值中获取类型为“ VARBINARY”的数据值〜[derbyclient-10.12.1.1.jar:na]”

I would appreciate if anyone has insights on this. 如果有人对此有见解,我将不胜感激。

This is issue is resolved after doing following: 执行以下操作可以解决此问题:

@Basic
@Column(name = "PARSED_DATA")
@Lob
public byte[] getParsedData() {
    return parsedData;
}

Since, table column is BLOB type.This is only issue with Derby. 因为,表列是BLOB类型。这仅与Derby有关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM