摘要: 问题: 在hibernate中实体类中blob类型字段为 private String textBlob; 查询时报错: java.sql.SQLException: 无效的列类型: getString not implemented for class oracle.jdbc.driver.T4CBlobAccessor at oracle.jdbc.driver.Access
问题:
在hibernate中实体类中blob类型字段为
private String textBlob;
查询时报错:
java.sql.SQLException: 无效的列类型: getString not implemented for class oracle.jdbc.driver.T4CBlobAccessor
at oracle.jdbc.driver.Accessor.unimpl(Accessor.java:412)
数据库版本 :oracle 11g r2
原因: oracle 11g r2不再支持blob 的getString方法
Oracle JDBC Driver 11g Release 2 (11.2) no longer supports getString method for retrieving BLOB column values
解决方法:
Do not use "select *" and select only none-blob type columns in the select statement.
(OR)
Downgrade Oracle client to 11g R1
其实只要用byte[]映射blob类型即可
private byte[] textBlob;
参考文章
http://www-01.ibm.com/support/docview.wss?uid=swg21596361