oracle clob jpa,Hibernate4 JPA 读写Clob类型出现的问题
问题描述:
由于某表需要用到大字符串类型
@Lob
@Basic(fetch = FetchType.LAZY)
@Column(name="content", nullable=true)
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
错误信息为:
报错信息为:
严重: Servlet.service() for servlet simplepageServlet threw exception
java.lang.AbstractMethodError: org.apache.commons.dbcp.DelegatingPreparedStatement.setCharacterStream(ILjava/io/Reader;J)V
at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$4$1.doBind(ClobTypeDescriptor.java:131)
at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:90)
at
其实代码本身是没有错的,
http://my.oschina.net/u/989426/blog/201912 正解
可能是dbcp连接池过时了吧
换了druid的连接池就ok了。
sqlserver下自动建立的数据类型为 varchar(max)
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)