Inserting byte[] array as blob in Oracle Database getting ORA-01460: unimplemented or unreasonable conversion requested

孤人 提交于 2019-12-01 22:26:41

If I recall correctly the Oracle JDBC drivers (at least older ones - you didn't tell us which version you are using) don't support setBytes() (or getBytes()).

In my experience, using setBinaryStream() is much more reliable and stable:

InputStream in = new ByteArrayInputStream(data);
pstmt.setBinarySream(4, in, data.length);

try with the below code, this should work for you :-

Blob blobValue = new SerialBlob(data);
pstmt.setBlob(4, blobValue);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!