Hibernate 处理 clob报错 [问题点数:20分,结帖人nearsun]

Bbs5
本版专家分:3004
结帖率 100%
Bbs7
本版专家分:23647
Blank
红花 2006年8月 Java大版内专家分月排行榜第一
2006年7月 Java大版内专家分月排行榜第一
2006年6月 Java大版内专家分月排行榜第一
Bbs1
本版专家分:30
Bbs5
本版专家分:3004
Bbs5
本版专家分:2744
Bbs5
本版专家分:3004
hibernate操作clob字段
在用<em>hibernate</em>插入<em>clob</em>字段的时候报 ORA-03120: 双工转换例行程序: 整数溢出数据库错误,请问怎么回事,很奇怪的是,绝大部分情况下插入没问题,当我在插"rninteger syear,smon,eyear,emon,result rnrnsyear=integer(mid(arg_start,1,4))rnrneyear=integer(mid(arg_end,1,4))rnrn rnrnsmon=integer(mid(arg_start,6,2))rnrnemon=integer(mid(arg_end,6,2))rnrn如果开始年份syear 等于 截止年份eyearrnrn 则 返回月数result=emon – smonrnrn否则 返回月数result= (eyear - syear)*12+emon – smonrnrn返回 resultrn"rnrn这些数据的时候有问题
hibernate CLOB长度问题
用<em>hibernate</em>向Oracle中inserts时(save),写入CLOB中的字符长度大概超过1000个时出错rnString 到Clob 的转化用rnClobUtil.getClob(str)rnrnrn16:40:51,171 WARN JDBCExceptionReporter:71 - SQL Error: 1461, SQLState: 72000rn16:40:51,171 ERROR JDBCExceptionReporter:72 - ORA-01461: can bind a LONG value only for insert into a LONG columnrnrn16:40:51,171 WARN JDBCExceptionReporter:71 - SQL Error: 1461, SQLState: 72000rn16:40:51,171 ERROR JDBCExceptionReporter:72 - ORA-01461: can bind a LONG value only for insert into a LONG columnrnrn16:40:51,171 ERROR AbstractFlushingEventListener:277 - Could not synchronize database state with sessionrnorg.<em>hibernate</em>.exception.GenericJDBCException: Could not execute JDBC batch updatern at org.<em>hibernate</em>.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)rn at org.<em>hibernate</em>.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)rn at org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.<em>hibernate</em>.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:181)rn。。。。。。rnrn
hibernate如何操作clob
数据库是Oracle9irn<em>hibernate</em>版本是3.3.2rn我要存大文本,请问如何操作<em>clob</em>类型?rn可不可以映射成string啊rn项目中没用spring,只是struts1.2和<em>hibernate</em>3.3.2rn
hibernateclob数据处理
<em>hibernate</em>的<em>clob</em>数据<em>处理</em>: [code=&quot;java&quot;] import org.<em>hibernate</em>.lob.SerializableClob; SerializableClob <em>clob</em>=(SerializableClob) o[0]; String content=<em>clob</em>.getSubString(1, (int)<em>clob</em>.length()); [/code] o...
hibernate存取oracle的clob
<em>hibernate</em>如何存取oracle的<em>clob</em>
hibernate操作clob
现在项目使用<em>hibernate</em>遇到了一个很棘手的问题,就是在操作<em>clob</em>字段的时候当长度超过1000的时候就会<em>报错</em>: rnorg.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Could not execute JDBC batch update; uncategorized SQLException for SQL [insert into DT_CONFIGINFO (OPERATETYPE, OBJECTTYPE, CLASSNAME, CONFIGTIME, ISCONFIRM, USERLABEL, OBJECTNAME, CONFIGINFO, CONFIRMTIME, UUID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [72000]; error code [1483]; ORA-01483: DATE 或 NUMBER 绑定变量的长度无效 rn; nested exception is java.sql.BatchUpdateException: ORA-01483: DATE 或 NUMBER 绑定变量的长度无效 rnrnCaused by: java.sql.BatchUpdateException: ORA-01483: DATE 或 NUMBER 绑定变量的长度无效 rnrnat oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343) rnat oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10656) rnat sun.reflect.GeneratedMethodAccessor325.invoke(Unknown Source) rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) rnat java.lang.reflect.Method.invoke(Method.java:585) rnat org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) rnat org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) rnat $java.sql.Statement$$EnhancerByProxool$$545ba5a8.executeBatch( ) rnat org.<em>hibernate</em>.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) rnat org.<em>hibernate</em>.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246) rnat org.<em>hibernate</em>.engine.ActionQueue.executeActions(ActionQueue.java:237) rnat org.<em>hibernate</em>.engine.ActionQueue.executeActions(ActionQueue.java:141) rnat org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) rnat org.<em>hibernate</em>.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) rnat org.<em>hibernate</em>.impl.SessionImpl.flush(SessionImpl.java:1000) rnat org.springframework.orm.<em>hibernate</em>3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390) rnat org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.execute(HibernateTemplate.java:373) rnat org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.save(HibernateTemplate.java:632) rnat com.metarnet.cms.conf.ConfigPersistentManagerImpl.saveConfigData(ConfigPersistentManagerImpl.java:48) rnat com.metarnet.cms.conf.ManagedJobConfigSyncNewEMSImpl.start(ManagedJobConfigSyncNewEMSImpl.java:201) rnat com.metarnet.cms.job.JobManagerImpl.runJob(JobManagerImpl.java:214) rnat com.metarnet.cms.job.QuartzJob.execute(QuartzJob.java:16) rnat org.quartz.core.JobRunShell.run(JobRunShell.java:195) rnat org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) rn我使用数据库驱动是最新的,ojdbc14 10.2.0.1.0和10.2.0.4.0都用过,hbm.xml文件里是这样映射的 rn rn我还尝试加上length="10000"但是无济于事。不知道到底是什么原因,头痛,望高手们能指点迷津,感激涕零!
重复读取Clob报错
从数据库中取出一个对象,有一个Clob的属性,get这个属性中的Clob,第一次读取Clob没有问题,第二次读取的时候就会<em>报错</em>,无论用下面的哪种方法都会<em>报错</em>rn<em>clob</em>.getCharacterStream();rn<em>clob</em>.getSubString(1, (int) <em>clob</em>.length());rnrn异常信息rnjava.sql.SQLException: could not reset readerrn at org.<em>hibernate</em>.lob.ClobImpl.getCharacterStream(ClobImpl.java:100)rn at org.<em>hibernate</em>.lob.SerializableClob.getCharacterStream(SerializableClob.java:64)
clob字段处理
一种替代ssh的开发框架rn学习简单,简约。上手容易
oracle数据库clob数据类型处理
目标:从文本文件中读取<em>clob</em>数据,并保存到oracle数据库中。   //创建文件流BufferedReader br  = new BufferedReader(new FileReader(&quot;D:\\sq.js&quot;));//建立一个文件读取流String lineContent = &quot;&quot;;//用于记录每一行内容的变量//链接数据库Class.forName(&quot;oracle.jdbc.d...
处理clob字段
我要把表单中的字段放入javabean中,在一个表单中有一个“正文”字段,是oracle 的<em>clob</em>类型,是否需要特殊<em>处理</em>?怎样<em>处理</em>?
CLOB字段处理
CLOB字段<em>处理</em> 对CLOB进行存取的例子
处理Clob数据
事先在MySQL中准备好表: CREATE TABLE user<em>clob</em>( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, note LONGTEXT ); 一、写入Clob数据 import java.io.File; impo...
hibernate在更新CLOB字段的时候报错(不同版本的oracle不一样)
session.update(vo); rn在Hibernate中是这样配置的: rn rn rn @<em>hibernate</em>.property rn column="ScopeStr" rn length="8000" rn rn rn---------------------------------- rnrnsession.update(vo); rnrn如果我用oracle10.1.0.3.0<em>报错</em>如下: rn[net.sf.<em>hibernate</em>.util.JDBCExceptionReporter]-[WARN] SQL Error: 1483, SQLState: 72000 rn[net.sf.<em>hibernate</em>.util.JDBCExceptionReporter]-[ERROR] ORA-01483: invalid length for DATE or NUMBER bind variable rn[net.sf.<em>hibernate</em>.impl.SessionImpl]-[ERROR] Could not synchronize database state with session rn:net.sf.<em>hibernate</em>.exception.GenericJDBCException: Could not execute JDBC batch update rnrnrn但是我用oracle10.2.却没问题,jdbc的驱动也更换了,但是在oracle10.1.0.3.0就是不行
hibernate操作clob奇怪的问题
现在项目使用<em>hibernate</em>遇到了一个很棘手的问题,就是在操作<em>clob</em>字段的时候当长度超过1000的时候就会<em>报错</em>: rnorg.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Could not execute JDBC batch update; uncategorized SQLException for SQL [insert into DT_CONFIGINFO (OPERATETYPE, OBJECTTYPE, CLASSNAME, CONFIGTIME, ISCONFIRM, USERLABEL, OBJECTNAME, CONFIGINFO, CONFIRMTIME, UUID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [72000]; error code [1483]; ORA-01483: DATE 或 NUMBER 绑定变量的长度无效 rn; nested exception is java.sql.BatchUpdateException: ORA-01483: DATE 或 NUMBER 绑定变量的长度无效 rnrnCaused by: java.sql.BatchUpdateException: ORA-01483: DATE 或 NUMBER 绑定变量的长度无效 rnrnat oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343) rnat oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10656) rnat sun.reflect.GeneratedMethodAccessor325.invoke(Unknown Source) rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) rnat java.lang.reflect.Method.invoke(Method.java:585) rnat org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) rnat org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) rnat $java.sql.Statement$$EnhancerByProxool$$545ba5a8.executeBatch() rnat org.<em>hibernate</em>.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) rnat org.<em>hibernate</em>.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246) rnat org.<em>hibernate</em>.engine.ActionQueue.executeActions(ActionQueue.java:237) rnat org.<em>hibernate</em>.engine.ActionQueue.executeActions(ActionQueue.java:141) rnat org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) rnat org.<em>hibernate</em>.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) rnat org.<em>hibernate</em>.impl.SessionImpl.flush(SessionImpl.java:1000) rnat org.springframework.orm.<em>hibernate</em>3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390) rnat org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.execute(HibernateTemplate.java:373) rnat org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.save(HibernateTemplate.java:632) rnat com.metarnet.cms.conf.ConfigPersistentManagerImpl.saveConfigData(ConfigPersistentManagerImpl.java:48) rnat com.metarnet.cms.conf.ManagedJobConfigSyncNewEMSImpl.start(ManagedJobConfigSyncNewEMSImpl.java:201) rnat com.metarnet.cms.job.JobManagerImpl.runJob(JobManagerImpl.java:214) rnat com.metarnet.cms.job.QuartzJob.execute(QuartzJob.java:16) rnat org.quartz.core.JobRunShell.run(JobRunShell.java:195) rnat org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) rn我使用数据库驱动是最新的,ojdbc14 10.2.0.1.0和10.2.0.4.0都用过,hbm.xml文件里是这样映射的 rn rn我还尝试加上length="10000"但是无济于事。不知道到底是什么原因,头痛,望高手们能指点迷津,感激涕零!
hibernate读取Clob字段的问题
我的环境:rnIDE:Eclipse3.2+MyEclipse5.01rn数据库是Oracle9i,驱动是ojdbc14,Hibernate版本是3.1rnrn我在数据库中建了一张表:TGSASSOCIATIONINFO,表的字段如下:rn名称 数据类型 可否为空rnID NUMBER NOT NULLrnITEM_NAME VARCHAR2 NOT NULLrnITEM_CONTENT CLOB rnITEM_DESC VARCHAR2 rnrn用Hibernate自动生成的映射文件为:rnTgsAssociationinfo.hbm.xmlrnrnrnrnrnrn rn rn rn rn TGSASSOCIATIONINFO_ID_SEQrn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrn生成的java文件为:rnpackage tgcom.<em>hibernate</em>.ywj;rnrn/**rn * TgsAssociationinfo generated by MyEclipse - Hibernate Toolsrn */rnrnpublic class TgsAssociationinfo implements java.io.Serializable rnrnrn // Fields rnrn private Long id;rn private String itemName;rn private String itemContents;rn private String itemDesc;rnrnrn // Constructorsrnrn /** default constructor */rn public TgsAssociationinfo() rn rnrn rn /** full constructor */rn public TgsAssociationinfo(String itemName, String itemContents, String itemDesc) rn this.itemName = itemName;rn this.itemContents = itemContents;rn this.itemDesc = itemDesc;rn rnrn rn // Property accessorsrnrn public Long getId() rn return this.id;rn rn rn public void setId(Long id) rn this.id = id;rn rnrn public String getItemName() rn return this.itemName;rn rn rn public void setItemName(String itemName) rn this.itemName = itemName;rn rnrn public String getItemContents() rn return this.itemContents;rn rn rn public void setItemContents(String itemContents) rn this.itemContents = itemContents;rn rnrn public String getItemDesc() rn return this.itemDesc;rn rn rn public void setItemDesc(String itemDesc) rn this.itemDesc = itemDesc;rn rnrnrn问题是:当我写入Clob字段时操作成功,但查询出来的Clob字段却为null, 请问该如何操作这个Clob字段,映射文件和java文件该如何改?rnrnrn
Hibernate 读写Blob和Clob的问题!
今天练习了一下读写Blob和Clob发现点问题~不知道如何解决了.rn如果在Test中只调用reader() 那么一切正常,rn但是如果现调用insert() 那在reader()读取到最后一条记录的时候就会出现异常rnException in thread "main" java.lang.UnsupportedOperationException: Blob may not be manipulated from creating sessionrn at org.<em>hibernate</em>.lob.ClobImpl.excep(ClobImpl.java:128)rn at org.<em>hibernate</em>.lob.ClobImpl.getSubString(ClobImpl.java:94)rn at org.<em>hibernate</em>.lob.SerializableClob.getSubString(SerializableClob.java:37)rn at com.xl.test.Text.reader(Text.java:77)rn at com.xl.test.Text.main(Text.java:34) rnText.java:77指向的却有是一条Clob语句!!苦闷啊~~下边是关键代码.rnrn[code=Java]rnpackage com.xl.vo;rnrnimport java.sql.Blob;rnimport java.sql.Clob;rnrnrn/**rn * Userinfo entity.rn * rn * @author MyEclipse Persistence Toolsrn */rnrnpublic class Userinfo implements java.io.Serializable rnrn // Fieldsrnrn private Integer id;rn private Blob faceimag;rn private Clob remark;rnrn // Constructorsrnrn /** default constructor */rn public Userinfo() rn rnrnrn // Property accessorsrnrn public Integer getId() rn return this.id;rn rnrn public void setId(Integer id) rn this.id = id;rn rnrn public Blob getFaceimag() rn return this.faceimag;rn rnrn public void setFaceimag(Blob faceimag) rn this.faceimag = faceimag;rn rnrn public Clob getRemark() rn return this.remark;rn rnrn public void setRemark(Clob remark) rn this.remark = remark;rn rnrnrn[/code]rnrn[code=Java]rnpackage com.xl.test;rnrnimport java.io.File;rnimport java.io.FileInputStream;rnimport java.io.FileNotFoundException;rnimport java.io.FileOutputStream;rnimport java.io.IOException;rnimport java.io.InputStream;rnimport java.sql.Blob;rnimport java.sql.Clob;rnimport java.sql.SQLException;rnimport java.util.Iterator;rnimport java.util.List;rnrnimport org.<em>hibernate</em>.Hibernate;rnimport org.<em>hibernate</em>.Session;rnimport org.<em>hibernate</em>.Transaction;rnrnimport com.xl.se.HibernateSessionFactory;rnimport com.xl.vo.Userinfo;rnrnpublic class Text rnrn /**rn * @param argsrn */rn private static Session session = HibernateSessionFactory.getSession();rn public static void main(String[] args) rn //如果不执行insert()那么就将一切正常~~~rn String filePath = new File("bin").getAbsolutePath()+"\\image\\1.jpg";rn insert(filePath);rn System.out.print("插入成功!");rn rn reader();rn rnrn private static void insert(String filePath)rn try rn rn FileInputStream file = new FileInputStream(filePath);rn Blob blob = Hibernate.createBlob(file);rn Userinfo user = new Userinfo();rn user.setFaceimag(blob);rn rn rn Clob <em>clob</em> = Hibernate.createClob("This is Clob DataType");rn user.setRemark(<em>clob</em>);rn rn Transaction tra = session.beginTransaction();rn session.save(user);rn tra.commit();rn rn file.close();rn rn catch (FileNotFoundException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn rn private static void reader()rn try rn InputStream is = null;rn FileOutputStream file = null;rn List list = session.createQuery("from Userinfo").list();rn Iterator it = list.iterator();rn int count = 0;rn while(it.hasNext())rn count++;rn System.out.println(count);rn Userinfo user = (Userinfo)it.next();rn int id = user.getId();rn Clob <em>clob</em> = user.getRemark();rn String remark = <em>clob</em>.getSubString(1, (int)<em>clob</em>.length());//这句话报异常rn System.out.println(remark);rn rn Blob blob = user.getFaceimag();rn is = blob.getBinaryStream();rn file = new FileOutputStream("d://"+count+".jpg");rn rn byte [] bytes = new byte[1024];rn int len;rn while((len = is.read(bytes)) != -1)rn file.write(bytes);rn rn rn is.close();rn file.flush();rn file.close();rn rn catch (FileNotFoundException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rnrnrn[/code]
hibernate clob字段修改问题
项目是用SpringMVC+Spring+Hibernate 开发rnrn其中一个实体Bean rnpublic class Producttb implements Serializable rn rn private String id ;rn rn private String names;rnrn private String <em>clob</em>str; //实体Bean中为Stringrn rn rnrn<em>clob</em>str 映射数据库中 Producttb表 <em>clob</em>str 字段 (该字段类型为CLOB):rnrn rn现在发现保存一个Producttb 与取出一个Producttb没问题rn 但是修改一个Producttb 发生SQL异常 rnjava.sql.SQLException: ORA-00932: 数据类型不一致: 应为 -, 但却获得 CLOBrn很郁闷啊! rn我估计可能是oracle的驱动包有问题 各位大虾们有何高见?rnrn
hibernate中的clob字段的用法?
ORACLE中的VARCHAR2只有4K的长度,太短了;LONG听说要被ORACLE抛弃;只好选择CLOB,但是CLOB极其不好用,特别是用在HIBERNATE中。映射为CLOB类型,代码很变态;映射为STRING类型,好像也只能是4K。rn哪位达人在HIBERNATE中用过CLOB字段,告诉我如何完美解决吧。多谢了。rn欢迎大家讨论。
请教hibernate的blob和clob问题。
我想请教一下如何使用<em>hibernate</em>来向数据库中插入、更新、删除一个blob/<em>clob</em>类型的对象。可以以向数据库中插入、更新、删除一张图片作为示例!多谢您的帮忙!在下感激不尽。
Hibernate与oracle clob字段的问题
temp.setFields(fields.toString());rn queryService.updateQueryTemplate(temp);----------里面就是一个很简单的<em>hibernate</em>.save(temp).rntemp是一个String类型的,在oracle存储的是<em>clob</em>类型。。。rn问题就是字段值一旦大了就保存不了,小一点可以保存。。。求高手指教
hibernate保存blob,clob对象
NULL 博文链接:https://sxpujs.iteye.com/blog/368960
hibernate 插入 Clob 问题,求助
代码如下:rnpublic void save(News news) rn //this.getHibernateTemplate().saveOrUpdate(news);rn SessionFactory sessionFactory = getHibernateTemplate().getSessionFactory();rn Session session = sessionFactory.openSession();rn Transaction tt = session.beginTransaction();rn rn tryrn news.setContent(Hibernate.createClob(" "));rn Serializable result = session.save(news);rn session.flush(); rn rn session.refresh(news, LockMode.UPGRADE);rn int intId = news.getId().intValue();rn String contentStr = news.getContentStr();rn oracle.sql.CLOB content = (oracle.sql.CLOB)news.getContent();rn content.putString(1,contentStr);rn tt.commit();rn rn catch(Exception e)rn tt.rollback();rn e.printStackTrace();rn finallyrn session.close();rn sessionFactory.close();rn rn rn rn实体类rn…………rnrnprivate Clob content; rnprivate String contentStr;rnrnpublic Clob getcontent() rn return content;rnrnrnpublic void setcontent(Clob content) rn this.content= content;rnrnpublic String getcontentStr() rn return contentStr;rnrn public void setcontentStr(String contentStr) rn this.contentStr= contentStr;rnrnrn…………rn实体Formrnprivate String contentStr;rnrnpublic String getcontentStr() rn return contentStr;rn rnpublic void setcontentStr(String contentStr) rn this.contentStr= contentStr;rnrnrn现在的问题是在 save方法中的oracle.sql.CLOB content = (oracle.sql.CLOB)news.getContent();这一步返回的content是nullrn请问是为什么??
struts + hibernate 结构中处理Clob的问题?急!急!急!
请教一个问题rnstruts + <em>hibernate</em> 结构中,<em>hibernate</em> 的 POJO 类rn和 struts 的 ActionForm 的协同<em>处理</em>Clob问题。rnPOJO 类用于持久层映射,ActionForm 用于表示层存放数据。现在POJO 类中有Clob 类型,ActionForm如何与之对应?如果ActionForm 中也用Clob 那显然会紧耦合,而且表示层不好<em>处理</em>,要是改用String 问题就来了。通常我们在Action 中把ActionForm 中的数据与POJO类中的数据交换。当ActionForm 中的数据要持久化的时候(insert或update)我可以把 String(对应Clob) 作为参数传给DaoImpl类,由DaoImpl负责转换并持久化。但当执行查询操作时,POJO 类中的Clob 类型是传到Action后再与ActionForm 交换数据还是在DaoImpl类中就先转换好,然后再传给Action?rn要是在Action 中就<em>处理</em>,那么Action就要负责直接从数据库中读取Clob的内容(???这样行不?);要是在DaoImpl类中<em>处理</em>,那么DaoImpl类中就要导入ActionForm类,那么下层就导入了上层的包(这显然更不行),那应该怎么办???
hibernate 操作 oracle clob的问题
在网上看了很多<em>hibernate</em>操作oracle <em>clob</em>的文章,看到说下载最新版的oracle jdbc驱动就可以在<em>hibernate</em>中直接操作string来操作数据库的<em>clob</em>。rnrn rn我在官方网站上下载了最新的驱动ojdbc14.jar,ojdbc5.jar,ojdbc6.jar。rnrnrn在hbm.xml文件中如下配置:rnrnrn rnrnrn rnrnjava类中:rnrnprivate String text;rnrnpublic String getText() rn return text;rnrnrnpublic void setText(String text) rn this.text = text;rnrnrn rnrn<em>hibernate</em>配置文件:rnrnoracle.jdbc.driver.OracleDriverrnjdbc:oracle:thin:@...:1521:...rn...rn...rntruernutf-8rnrnrnorg.<em>hibernate</em>.dialect.Oracle10gDialectrnrn rnrn我的数据库是10.2 版本的,<em>hibernate</em>是3.3.0。JDK1.6rnrn我下载了3个最新驱动,我都尝试过,connection.SetBigStringTryClob也试过。但都报如下错误:rnrn71047 [http-8080-2] WARN org.<em>hibernate</em>.util.JDBCExceptionReporter - SQL Error: 17090, SQLState: nullrn71047 [http-8080-2] ERROR org.<em>hibernate</em>.util.JDBCExceptionReporter - 不允许的操作: streams type cannot be used in batchingrnrn请教是我哪里配置错了,还是不能使用thin的原因。rn
hibernateclob类型值
<em>hibernate</em>怎么取不到<em>clob</em>类型的字段值,取出来为空(数据库中是存在的)rn知道的说下,很急
Hibernate对BLOB CLOB操作
NULL 博文链接:https://ylsuccess.iteye.com/blog/411005
Hibernate对Blob,Clob的操作
使用Hibernate映射Blob,Clob字段,并对这些字段完成存,取功能
hibernate处理长字符串存储oracle 10g的clob类型
最近项目中(SSH2+ORACLE 10g)出现对长字符串<em>处理</em>的问题终于搞定了,在此记录一下   表中有一个字段 content <em>clob</em> create table table_name (      ...      content <em>clob</em> not null,      ... )   (1)在使用ojdbc14.jar的情况下(批量<em>处理</em>有影响) 使用注解  @Lob ...
CLOB等大字段在Hibernate中的处理总结
最近在做一个项目的前台页面展现时要对一个存在Clob大字段实体(UserEntity.java)进行查询操作,考虑到在某些展现页面中是不需要展现大字段的,听过<em>hibernate</em>有对普通属性进行延迟抓取,所以查看了一下Reference,发现配置这个延迟抓取还不简单,需要运行时字节码增强,一看就很晕,在网上查了下资料,就对大字段的查询<em>处理</em>问题,总结了一下,初步有3种实现方案:       1、使用h...
hibernate 处理 clob 问题,报错:ORA-01483: DATE 或 NUMBER 赋值变量的长度无效
我想这个问题比较老,上网查了不少资料,rn项目大体上使用spring 和 hiber
PB6.0 ,处理ORACLE的CLOB字段,如何处理
我用的是PB6.0,数据库是ORACLE,某张表有CLOB字段。rnrn我要把文章存到此字段中,如何操作?需要注意什么,最好有简单的例子。rnrn万分感谢~~
读取clob报错,求救
我用下面的方法读取<em>clob</em>时<em>报错</em>,rnrnsql = "select big from web_test where id=1";rn pstmt = conn.prepareStatement(sql);rn rs = pstmt.executeQuery();rn if(rs.next())rn Reader <em>clob</em>=((oracle.sql.CLOB)rs.getClob(1)).getCharacterStream();rn //rn BufferedReader in = new BufferedReader(<em>clob</em>);rn StringBuffer sb = new StringBuffer();rn String read = in.readLine();rn while (!read.equals(""))rn sb.append(read);rn read=in.readLine();rn rn in.close();rnrn System.out.println(sb.toString());rnrnrnjava.io.IOException: 类型长度大于最大值rnrn at oracle.jdbc.dbaccess.DBError.SQLToIOException(DBError.java:716)rnrn at oracle.jdbc.driver.OracleClobReader.needChars(OracleClobReader.java:222)rnrn at oracle.jdbc.driver.OracleClobReader.read(OracleClobReader.java:163)rnrn at java.io.BufferedReader.fill(BufferedReader.java:136)rnrn at java.io.BufferedReader.readLine(BufferedReader.java:299)rnrn at java.io.BufferedReader.readLine(BufferedReader.java:362)rnrn at miscellaneous.ClobTest.readClob(ClobTest.java:64)rnrn at miscellaneous.ClobTest.main(ClobTest.java:87)rnrn我搜索了一下论坛,已经有不少帖子问过类似的问题但都没有答案,现在我也遇到了,请高人解决以下。谢谢。
处理大对象数据-处理CLOB数据
大对象<em>处理</em>主要值CLOB和BLOB两种类型的字段,在CLOB中可以存储海量文字,在BLOB中可以存储二进制数据,如果在程序中药理大对象数据,则必须使用PreparedStatement完成,所有的内容要通过IO流的方式从大文本字段中保存和读取。 1 使用IO流保存操作import java.sql.* ; import java.io.File ; import java.io.FileInput
处理大数据对象:处理CLOB数据
<em>处理</em>大数据对象:<em>处理</em>CLOB数据
hibernate 报错
出现如下错误:rnrnHTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: java.lang.NullPointerExceptionrn org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:690)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnroot cause rnrnjava.lang.NullPointerExceptionrn com.yourcompany.struts.action.ZhuceAction.execute(ZhuceAction.java:66)rn org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)rn org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)rn org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:690)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs.rnrnrn代码如下:rnZhuce Read = new Zhuce();rnRead.setName("name");rnZhuceDAO ZDao = new ZhuceDAO();rnTransaction tra = ZDao.getSession().beginTransaction();rnZDao.attachDirty(Read);rntra.commit();rnZDao.getSession().close();rnreturn null;
HIBERNATE报错
SERVICE================================rnpublic List save(List lists) rn List lis=new ArrayList();rn for(DBHtml onehtml:lists)rn DBHtml oldhtml=new DBHtml();rn oldhtml=htmlDao.findByID(onehtml.getId());rn oldhtml.setTitle(onehtml.getTitle());rn oldhtml.setUrl(onehtml.getUrl());rn lis.add(oldhtml);rn onehtml=null;rn oldhtml=null;rn rn return htmlDao.save(lis);rn rnDAOIMPL================================================rnrn public List save(List lists) rn this.getHibernateTemplate().saveOrUpdateAll(lists);rn System.out.println("===============================");rn return lists;rn rn错误rnrnorg.springframework.orm.<em>hibernate</em>3.HibernateSystemException: a different object with the same identifier value was already associated with the session: [com.fs.po.DBHtml#4]; nested exception is org.<em>hibernate</em>.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.fs.po.DBHtml#4]rn at org.springframework.orm.<em>hibernate</em>3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:661)rn at org.springframework.orm.<em>hibernate</em>3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.doExecute(HibernateTemplate.java:424)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.saveOrUpdateAll(HibernateTemplate.java:764)rnrn求高手解决!
hibernate 报错!!!!!!!!!
页面<em>报错</em>,myeclipse的Console没有<em>报错</em>rnhibernante 的配置是使用myeclipse自动生成的。rn[code=text]rnjava.lang.reflect.InvocationTargetExceptionrn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn java.lang.reflect.Method.invoke(Method.java:601)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn[/code]rnrn
hibernate报错
部分错误信息为:rn2013-4-1 22:03:01 org.apache.catalina.core.StandardContext reloadrn信息: Reloading Context with name [/stuinfomag] has startedrn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader clearReferencesThreadsrn严重: The web application [/stuinfomag] appears to have started a thread named [AWT-Windows] but has failed to stop it. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@ba8fce]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@3744bc]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@130500f]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@d8326d]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1d6b049]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1cfad77]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@18590c5]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn22:03:02,335 INFO XmlConfigurationProvider:42 - Parsing configuration file [struts-default.xml]rn22:03:02,617 INFO XmlConfigurationProvider:42 - Unable to locate configuration files of the name struts-plugin.xml, skippingrn22:03:02,617 INFO XmlConfigurationProvider:42 - Parsing configuration file [struts-plugin.xml]rn22:03:02,632 INFO XmlConfigurationProvider:42 - Parsing configuration file [struts.xml]rn22:03:02,632 INFO BeanSelectionProvider:42 - Loading global messages from globalMessagesrn1405090311rn9780574084a579ea95b55ad454096c8ern22:03:07,391 INFO Environment:543 - Hibernate 3.3.1.GArn22:03:07,391 INFO Environment:576 - <em>hibernate</em>.properties not foundrn22:03:07,407 INFO Environment:709 - Bytecode provider name : javassistrn22:03:07,422 INFO Environment:627 - using JDK 1.4 java.sql.Timestamp handlingrn22:03:07,594 INFO Configuration:1460 - configuring from resource: /<em>hibernate</em>.cfg.xmlrn22:03:07,594 INFO Configuration:1437 - Configuration resource: /<em>hibernate</em>.cfg.xmlrn22:03:07,734 INFO Configuration:586 - Reading mappings from resource : com/jackc/bean/Student.hbm.xmlrnorg.<em>hibernate</em>.InvalidMappingException: Could not parse mapping document from resource com/jackc/bean/Student.hbm.xmlrn at org.<em>hibernate</em>.cfg.Configuration.addResource(Configuration.java:602)rn at org.<em>hibernate</em>.cfg.Configuration.parseMappingElement(Configuration.java:1621)rn at org.<em>hibernate</em>.cfg.Configuration.parseSessionFactory(Configuration.java:1589)rn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1568)rn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1542)rn at org.<em>hibernate</em>.cfg.Configuration.configure(Configuration.java:1462)rn at com.jackc.<em>hibernate</em>session.HibernateSessionFactory.(HibernateSessionFactory.java:17)rn at com.jackc.stu.dao.StudentDAO.login(StudentDAO.java:23)rn at com.jackc.stu.action.LoginAction.login(LoginAction.java:59)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn逛论坛,有人给出的答案说是id标签的出的问题,但是我改其他的值还是不行,之前几天又是能运行的,现在又不能运行了,困扰多天,望有人给出正解。
Hibernate报错
Hibernate: rn selectrn seq_user.nextval rn fromrn dualrn2012-3-1 15:30:07 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet action threw exceptionrnjava.sql.SQLException: ORA-02289: 序列不存在rnrn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)rn at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)rn at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)rn at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)rn at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:213)rn at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:796)rn at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1031)rn at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:836)rn at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1124)rn at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)rn at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)rn at org.<em>hibernate</em>.id.SequenceGenerator.generate(SequenceGenerator.java:75)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)rn at org.<em>hibernate</em>.impl.SessionImpl.fireSave(SessionImpl.java:535)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:523)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:519)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:693)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.doExecute(HibernateTemplate.java:419)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.save(HibernateTemplate.java:690)rn at com.ssh.dao.UserDAO.save(UserDAO.java:13)rn at com.ssh.service.UserService.save(UserService.java:21)rn at com.ssh.action.UserAction.init(UserAction.java:32)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rn已插入数据就<em>报错</em> 求解啊
hibernate报错。。。
08:33:30,031 ERROR DTDEntityResolver:72 - Don't use old DTDs, read the Hibernate 3.x Migration Guide!rn Hibernate: select seq.nextval from dualrnException in thread "main" org.<em>hibernate</em>.HibernateException: identifier of an instance of com.donna.model.Role was altered from 152 to 152rn at org.<em>hibernate</em>.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:81)rn at org.<em>hibernate</em>.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:187)rn at org.<em>hibernate</em>.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:143)rn at org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)rn at org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)rn at org.<em>hibernate</em>.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:49)rn at org.<em>hibernate</em>.impl.SessionImpl.flush(SessionImpl.java:1028)rn at org.<em>hibernate</em>.impl.SessionImpl.managedFlush(SessionImpl.java:366)rn at org.<em>hibernate</em>.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)rn at Test.test(Test.java:36)rn at Test.main(Test.java:21)rnrnrn===================================rnrnrnrnrn rn rn rn rn seqrn rn rn rn rn rn rnrn========================================rn请问这是什么原因啊。。。。
Hibernate报错!!!
[b]Cat实体[/b]rn[code=java]rnpackage com.jafee.app.domain;rnrnimport java.util.Date;rnrnimport javax.persistence.Column;rnimport javax.persistence.Entity;rnimport javax.persistence.GeneratedValue;rnimport javax.persistence.GenerationType;rnimport javax.persistence.Id;rnimport javax.persistence.JoinColumn;rnimport javax.persistence.ManyToOne;rnimport javax.persistence.Table;rnimport javax.persistence.Temporal;rnimport javax.persistence.TemporalType;rnrn@Entityrn@Table(name="t_cat")rnpublic class Cat rn @Idrn @GeneratedValue(strategy = GenerationType.AUTO)rn private Integer id;rn @Column(name = "name")rn private String name;rn @Column(name = "description")rn private String descrition;rn @ManyToOnern @JoinColumn(name = "mother_id")rn private Cat mother;rn @Temporal(TemporalType.TIMESTAMP)rn @Column(name = "createDate")rn private Date createDate;rn public Integer getId() rn return id;rn rn public void setId(Integer id) rn this.id = id;rn rn public String getName() rn return name;rn rn public void setName(String name) rn this.name = name;rn rn public String getDescrition() rn return descrition;rn rn public void setDescrition(String descrition) rn this.descrition = descrition;rn rn public Cat getMother() rn return mother;rn rn public void setMother(Cat mother) rn this.mother = mother;rn rn public Date getCreateDate() rn return createDate;rn rn public void setCreateDate(Date createDate) rn this.createDate = createDate;rn rnrn[/code]rnrn[b]<em>hibernate</em>.cfg.xml[/b]rn[code=java]rnrnrnrnrnrn rnrn rn com.mysql.jdbc.Driverrn jdbc:mysql://127.0.0.1:3306/<em>hibernate</em>rn rootrn rootrnrn rn org.<em>hibernate</em>.dialect.MySQLDialectrnrn rn threadrnrn rn truernrn rn creaternrn rn rnrnrn[/code]rnrnHibernateUtilrn[code=java]rnpackage com.jafee.app.util;rnrnimport org.<em>hibernate</em>.SessionFactory;rnimport org.<em>hibernate</em>.cfg.Configuration;rnrnpublic class HibernateUtil rn private static final SessionFactory sessionFactory;rnrn static rn tryrn sessionFactory = new Configuration().configure().buildSessionFactory();rn catch(Throwable ex)rn System.out.println("Initial SessionFactory creation failed." + ex);rn throw new ExceptionInInitializerError(ex);rn rn rn rn public static SessionFactory getSessionfactory() rn return sessionFactory;rn rnrn[/code]rnrn[b]就是创建sessionFactory的时候出错了,我用的是3.6.0版本,所以用Configuration应该没问题吧,用AnnotationConfiguration反而会被提示过时的类。[/b]rnrn错误信息:rn[code=java]rnInitial SessionFactory creation failed.org.<em>hibernate</em>.MappingException: An AnnotationConfiguration instance is required to use rnException in thread "main" java.lang.ExceptionInInitializerErrorrn at com.jafee.app.util.HibernateUtil.(HibernateUtil.java:14)rn at com.jafee.app.manager.CatTest.main(CatTest.java:34)rnCaused by: org.<em>hibernate</em>.MappingException: An AnnotationConfiguration instance is required to use rn at org.<em>hibernate</em>.cfg.Configuration.parseMappingElement(Configuration.java:1634)rn at org.<em>hibernate</em>.cfg.Configuration.parseSessionFactory(Configuration.java:1589)rn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1568)rn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1542)rn at org.<em>hibernate</em>.cfg.Configuration.configure(Configuration.java:1462)rn at org.<em>hibernate</em>.cfg.Configuration.configure(Configuration.java:1448)rn at com.jafee.app.util.HibernateUtil.(HibernateUtil.java:11)rn ... 1 morernrn[/code]
Hibernate报错
%%%% Error Creating SessionFactory %%%%rnorg.<em>hibernate</em>.MappingException: invalid configurationrn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1535)rn at org.<em>hibernate</em>.cfg.Configuration.configure(Configuration.java:1476)rn at com.yu.factory.HibernateSessionFactory.(HibernateSessionFactory.java:30)rn at com.yu.sqlTest.test.testQueryCard(test.java:16)rn at com.yu.sqlTest.test.main(test.java:48)rnCaused by: org.xml.sax.SAXParseException: The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)".rn at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)rn at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)rn at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)rn at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)rn at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2017)rn at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:901)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)rn at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)rn at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)rn at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)rn at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)rn at org.dom4j.io.SAXReader.read(SAXReader.java:465)rn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1532)rn ... 4 morernrnrn配置文件我都检查了,好像没什么问题啊!但是就是报这个错。郁闷!麻烦各位帮忙解决下。
hibernate报错?
我的<em>hibernate</em>运行到这句就<em>报错</em>rnsessionFactory=new Configuration().configure("<em>hibernate</em>.cfg.xml").buildSessionFactory();rnrn错误信息:rnjava.lang.ExceptionInInitializerErrorrn All.HibernateUtil.(HibernateUtil.java:28)rn com.toshiba.servlet.addminRegisterServlet.doPost(addminRegisterServlet.java:71)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrn<em>hibernate</em>.cfg.xml文件:rnrnrnrnrnrnrn rn sarn rn jdbc:microsoft:sqlserver://localhost:3121;DatabaseName=Logisticsrn rn rn org.<em>hibernate</em>.dialect.SQLServerDialectrn rn conSQLrn sarn rn com.microsoft.jdbc.sqlserver.SQLServerDriverrn rn rn rn rn rn rn rn rn rnrn rnrn
oracle数据库CLOB字段的SQL处理
1、CLOB字段(内容较少) 直接用o_char 2、CLOB字段(内容较多,有规律,情况较少) 用DBMA_LOB.SUBSTR函数截取,然后拼接 select b.wfss, ength(b.wfss) fcd, case when length(b.wfss)&amp;amp;gt;4000 then DBMA_LOB.SUBSTR(b.wfss,4000,1)||DBMA_LOB.SUBSTR(b.wfs...
DB2\Oracle数据库对clob处理
spring定义了一个以统一的方式操作各种数据库的Lob类型数据的LobCreator(保存的时候用),同时提供了一个LobHandler为操作二进制字段和大文本字段提供统一接口访问。 举例,例子里面的t_post表中post_text字段是CLOB类型,而post_attach是BLOG类型: [code=&quot;java&quot;] //db2数据库 public class PostJdbc...
oracle中clob字段处理
我在oracle存储过程中有一大字段类型(CLOB),如何将这个大字段类型的转成varchar2.rn因为我在游标中,又用了这个大字段类型来拼装游标的SQL,结果oralce不认识。请大侠指点:rnserarchSql :按条件拼装的查询SQL,其中包含了CLOB字段的数据rnprojectTableInfo :自定义游标rnOPEN projectTableInfo FOR serarchSql;rnrn结果两者一结合,oracle不认识,原本serarchSql是varchar2类型,里面包含了<em>clob</em>类型之后,oralce自动转换了变成了long类型。rnrn妄求大侠指点!
处理CLOB的存储过程,出错???急
create table news(rnnews_id number(9),rnnews_title varchar2(80),rnnews_text <em>clob</em>rn);rnrn我写了个过程:rnCLOB字段操作可传递表名table_name,表的唯一标志字段名field_id,<em>clob</em>字段名field_name,记录号v_id,开始<em>处理</em>字符的位置v_pos,传入的字符串变量v_<em>clob</em>rncreate or replace procedure update<em>clob</em>(rn table_name in varchar2,rn field_id in varchar2, rn field_name in varchar2,rn v_id in number,rn v_pos in number,rn v_<em>clob</em> in varchar2)rnisrn lobloc <em>clob</em>;rn c_<em>clob</em> varchar2(32767);rn amt binary_integer;rn pos binary_integer;rn query_str varchar2(1000);rnbeginrn pos:=v_pos*32766+1;rn amt := length(v_<em>clob</em>);rn c_<em>clob</em>:=v_<em>clob</em>;rn query_str :='select '||field_name||' from '||table_name||' where '||field_id||'= :id for update ';rn--initialize buffer with data to be inserted or updatedrn EXECUTE IMMEDIATE query_str INTO lobloc USING v_id;rn--from pos position, write 32766 varchar2 into loblocrn dbms_lob.write(lobloc, amt, pos, c_<em>clob</em>);rn commit;rnexceptionrn when others thenrn rollback;rnend;rn调用方法为:rnbeginrnEXECUTE update<em>clob</em>('news','news_id','news_text',11,1,'sfdfsd');rnend;rn调用时出错:rnERROR 位于第 2 行:rnORA-06550: 第 2 行, 第 9 列:rnPLS-00103: 出现符号 "UPDATE_CLOB"在需要下列之一时:rn:=.(@%;immediatern符号 ":=" 被替换为 "UPDATE_CLOB" 后继续。rnrn哪里错了?rn
JDBC 中处理CLOB字段
public void insertMarketRept(List list, String sql) throws SQLException, IOException { if (list.size() &gt; 0) { conn = JdbcUtilsOracle.getConnection(); conn.setAutoCommit(false); Pr...
JDBC处理包含CLOB字段
  public static List&amp;lt;Map&amp;lt;String,Object&amp;gt;&amp;gt; getDetail(final String instance,final String sql) throws Exception{ String key=&quot;&quot;; Connection con=null; Statement st=null; ...
用Hiberate处理CLOB字段
用Hiberate<em>处理</em>CLOB字段 ;通过Hiberate<em>处理</em>CLOB类型的数据;
Sqoop处理Clob与Blob字段
[Author]: kwu Sqoop<em>处理</em>Clob与Blob字段,在Oracle中Clob为大文本,Blob存储二进制文件。遇到这类字段导入hive或者hdfs需要特殊<em>处理</em>。
Mybatis大字段clob处理
1. 实体类View package com.ttt.sysManager.po; public class View { private String VIEW_NAME; private String TEXT_LENGTH; private String TEXT; private String EDITIONING_VIEW; private String READ_ONL
jdbc 处理clob类型字段
主要是整合了jdbc<em>处理</em><em>clob</em>类型的增删改查方法,有需要的同学可以看下
Mybatis -处理clob类型数据
当执行sql语句,返回的是map类型时, 比如 public List> query(@Param("sql") String sql)得到的数据是List类型数据,此时,如果有返回的有<em>clob</em>字段时,数据是这样的oracle.sql.CLOB@63636de0 ,显然,这不是我想要的,我需要的是字符串数据 那么怎么来<em>处理</em><em>clob</em>字段呢,很简单
spring2 hibernate3 处理clob blob
rn rn rnrn rn rn rn rn rn rn是不是最新版本的spring和<em>hibernate</em>不用这么配置 就能直接操作<em>clob</em>和blob字段了,就像其他字段一样 不需要特殊<em>处理</em>?oracle数据库rn
Hibernate读写Clob和Blob类型字段
来自:http://esffor.iteye.com/blog/168264   数据库脚本: create   table  testcb(id  varchar ( 32 )  primary   key ,name  varchar ( 32 ),photo blob,description  text );  Hibernate....
关于Clob类型在Hibernate中 的应用小结
关于Clob类型在Hibernate中 的应用小结关于Clob类型在Hibernate中 的应用小结关于Clob类型在Hibernate中 的应用小结关于Clob类型在Hibernate中 的应用小结
hibernate的4.3.11中大对象Blob和Clob的设置
1、设置对象 Student s = new Student(); s.setAge(13); s.setName("zhang三"); s.setScore(12.22); File f1 = new File("image/Koala.jpg"); InputStream is = new FileInp
Hibernate存储Clob字段的方式总结
介绍了利用Hibernate将一个长字符串转换为流存储至Clob字段中,然后再从Clob字段中读出来,转换为字符串输出的方式
hibernate直接操作oracle中clob数据
在<em>hibernate</em>.xml配置中 添加 &amp;lt;prop key=&quot;<em>hibernate</em>.connection.SetBigStringTryClob&quot;&amp;gt;true&amp;lt;/prop&amp;gt;    如:     &amp;lt;property name=&quot;<em>hibernate</em>Properties&quot;&amp;gt;        &amp;lt;props&amp;gt;            &amp;lt;prop k
【深入Hibernate】——根据业务自定义Clob数据类型
引言     最近项目涉及到大文本字段Clob,它是大文本中多字节存储数据类型,还有一个与它类似的是Blob,Blob是大文 本单字节存储数据类型。看《深入浅出Hibernate》里看到Clob可以进行自定义数据类型,很受用,所以这里将代码 留存下来备用。   代码   public class StringClobType implements User
hibernate Blob、Clob字段的映射的例子
<em>hibernate</em> Blob、Clob字段的映射的例子.数据库mysql,数据库放在文件夹里面,例子的说明文章在我的csdn blog: http://blog.csdn.net/zhengcandan
关于Clob类型在Hibernate中的应用小结
关于Clob类型在Hibernate中的应用小结(2) (2007-06-22 21:35:14) 4.2 CRUD的实现 4.2.1 创建(Create) ………… public class MeetingHeadDAOHibernate extends BaseDAOHibernate implements Mee...
Hibernate对与Oracle中Clob类型的使用
Hibernate对与Oracle中Clob类型的使用   一.理解和分析:1.为何实用Clob:oracle数据库当需要存入大数据量(大于4000)时,varchar2不够用,可以使用<em>clob</em>,本文描述<em>clob</em>怎么和Hibernate一起使用。   2.Clob类型的属性的赋值方式——String转Clob:   String content = request.getParame...
Hibernate不支持Oracle的clob类型吗?
发现<em>clob</em>类型的数据load出来都是nullrn怎么解决呢?rn谢谢!
求解决Hibernate操作clob问题
类rnrnpackage BlobLoginDao;rnrnimport java.io.BufferedReader;rnimport java.io.IOException;rnimport java.io.Reader;rnimport java.sql.Clob;rnimport java.sql.SQLException;rnrnimport org.<em>hibernate</em>.Hibernate;rnimport org.<em>hibernate</em>.Session;rnimport org.<em>hibernate</em>.SessionFactory;rnimport org.<em>hibernate</em>.Transaction;rnimport org.<em>hibernate</em>.cfg.Configuration;rnrnimport com.<em>hibernate</em>.Login.Login;rnrnpublic class ClobLogin rn private Session session = null;rn private Transaction tran = null;rn private static final ThreadLocal s = new ThreadLocal();rn rn public ClobLogin()rn rn Configuration config = new Configuration().configure();rn SessionFactory factory = config.buildSessionFactory();rn this.session = s.get();rn if(session == null)rn rn this.session = factory.openSession();rn s.set(session);rn rn rn rn rn public int save<em>clob</em>(Login login,String description)rn rn tran = this.session.beginTransaction();rn login.setDescription(Hibernate.createClob(description));rn session.save(login);rn tran.commit();rn rn return login.getId();rn rn public String getClob(int id) throws SQLException, IOExceptionrn Login login = (Login)session.get(Login.class, id);rn Clob desc = (Clob)login.getDescription();rn rn Reader rd = desc.getCharacterStream();//字符输出流rn BufferedReader br = new BufferedReader(rd);rn String sdesc = br.readLine();rn return sdesc;rn rn rn rn rnrn配置文件rnrnrnrn rnrn rn rn rn rn S_IDrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn错误:rnrnSLF4J: The requested version 1.6 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8]rnSLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.rnlog4j:WARN No appenders could be found for logger (org.<em>hibernate</em>.cfg.Environment).rnlog4j:WARN Please initialize the log4j system properly.rnlog4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.rnHibernate: select max(ID) from LOGINrnHibernate: insert into MWJ.LOGIN (USERNAME, PASSWORD, IMAGE, DESCRIPTION, ID) values (?, ?, ?, ?, ?)rnid=36rnException in thread "main" java.sql.SQLException: could not reset readerrn at org.<em>hibernate</em>.lob.ClobImpl.getCharacterStream(ClobImpl.java:100)rn at org.<em>hibernate</em>.lob.SerializableClob.getCharacterStream(SerializableClob.java:64)rn at BlobLoginDao.ClobLogin.getClob(ClobLogin.java:48)rn at com.<em>hibernate</em>.test.Test.main(Test.java:93)rn
hibernate中如何设置clob类型的字段?
在<em>hibernate</em>中遇到 使用java.sql.Clob类型 不知道怎样去用它,rn请各位前辈指点。
hibernate动态映射表处理oracle的clob类型
<em>hibernate</em>动态映射表<em>处理</em>oralce10g的<em>clob</em>类型,压缩包为整个工程包. 真诚地希望能帮到你,同时真诚地希望你能和我交流, about any question^_^
hibernate插入clob异常(在线等)
请大家帮帮忙,用<em>hibernate</em>向oracle中的colob插入数据,少字符能插入,但字符多了就出现上述异常rnrn执行方法:rnrnrnpublic void save(TfttcExhibition transientInstance) rn log.debug("saving TfttcExhibition instance");rn try rn getHibernateTemplate().save(transientInstance);rn log.debug("save successful");rn catch (RuntimeException re) rn log.error("save failed", re);rn throw re;rn rn rnrn映射文件:rnrnrnrnrnrn rn rn rn rn tfttc_exh_idrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn
hibernate中Blob,Clob字段类型,二级缓存的问题
我用的是<em>hibernate</em> 3.1.3版本,数据库SQLServer2000,二级缓存EhCache rn问题是这样的,在我的pojo实体类中有一个Blob字段 rn这个实体类我开启了二级缓存,read-write rn当dynamic-insert="false" dynamic-update="false"这两个属性为false时 rninsert,出现异常 rnjava.lang.UnsupportedOperationException: Blobs are not cacheable rn...略 rn当我把dynamic-insert="true" dynamic-update="true"这两个属性设为true时 rninsert成功,图片也成功的写入了数据库里 rnrn但是读取时还是出现异常, rnjava.lang.UnsupportedOperationException: Blobs are not cacheable rnrn是不是有Blob或Clob这种大型的字段在,实体类就不能采用二级缓存策略了 rn按书里说的一种办法,把Blob分离出来,单独做一个子类,在父类使用缓存,但是我觉得这个办法不好 rn为了一个字段就另写一个类和一个hbm.xml映射文件是不是太小题大作了一点 rnrn请问各位牛人老大,有没有什么更好的解决办法,或者是有另外的配置方法 rn小弟我初学<em>hibernate</em>,请各为老大多多指教
用户hibernate如何读取oracle中的clob
我用<em>hibernate</em>读取oracle中的<em>clob</em>类型的时候,怎么会是null值呢?我是用String类型去接收的,但我进行保存的时候却没问题?哪位大哥能和我说说了。。
hibernate怎么读oracle中clob的值
bean里与<em>clob</em>列相映射的属性的类型应该是什么?rn我用java.lang.String时,bean.get()是得到的是nullrn还是用java.sql.Clob还是oracle.sql.CLOBrn[code=Java]rnrnrnrn[/code]rnrninfo再数据库里是CLOB类型的rn我用的数据库是oracle10g,版本10.1.0.2.0rnrn恳请高手指点指点!!!谢谢了!
hibernate存取Clob(在线等!)
我的代码:rn<em>hibernate</em> mapping rn rnpo:rn public java.sql.Clob getWorkSum() rn return this.workSum;rn rn public void setWorkSum(java.sql.Clob workSum) rn this.workSum = workSum;rn rnvo:rnpublic void setWorkSum(String workSum) rn this.workSum = workSum;rn rnrn public String getExamineYear() rn return this.examineYear;rn rnrnAction:rn hs.setWorkSum(Hibernate.createClob(" "));rn oracle.sql.CLOB <em>clob</em>= (oracle.sql.CLOB) hs.getWorkSum();//这句有问题rn Writer out= <em>clob</em>.getCharacterOutputStream();rn if(out!=null) rn out.write(vohs.getWorkSum());rn out.flush();rn out.close();rn rn hs = this.getHumanProfessumService().saveHumanProfessum(hs);//执行保存操作rnrnrn就这些东西在我执行插入的时候会报java.lang.ClassCastException的错误rn请帮忙....rn
oracle版本不同导致数据库操作报错 CLOB
由11.2.0.1版本的数据库导入到11.2.0.4版本的数据时,某些SQL报:ORA-00932: inconsistent datatypes: expected - got CLOB ,但是原来库是正常的。   原因 WMSYS.WM_CONCAT函数在不同的版本结果类型不一样,具体哪些版本暂时不知道   解决方案:   去掉这些函数,使用其他方法实现 ...
sql查询clob字段报错问题
<em>报错</em>: org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: No serializer found for class oracle.jdbc.driver.OracleClobReader and no properties discovered to creat...
CLOB与Clob之间的转换
我想将:rnimport java.sql.Clob;rn转换成rnimport oracle.sql.CLOB;rn这样的JAVA方法如何写?请高人指教。rn
ORA-22859 解决办法 (blob,clob 数据类型修改报错
删除列,然后新增列
create table a(a clob);为什么报错
SQL> create table a(a <em>clob</em>);rncreate table a(a <em>clob</em>)rn *rn错误位于第1行:rnORA-22866: 默认字符集具有不同的宽度
DB2 CLOB类型 插入数据超过32K报错
如题,DB2 CLOB类型 插入数据超过32K<em>报错</em>,已经更改该字段长度为15M,但是依然<em>报错</em>。请各位大神搭救!急求解决办法!
SSH + Oracle CLOB字段Insert时报错
映射文件rn[code=xml]rnrn[/code]rnrnPOrn[code=java]private java.lang.String txt;[/code]rnrnrnDAOrn[code=java] rnpublic ContentTxt save(ContentTxt bean) rn getSession().save(bean);rn return bean;rn rn[/code]rnrn错误信息:rnHTTPステータス 500 - Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: Hibernate flushing: could not insert: [cn.com.neauce.hljs.portal.cms.entity.main.ContentTxt]; uncategorized SQLException for SQL [insert into jc_content_txt (txt, txt1, txt2, txt3, content_id) values (?, ?, ?, ?, ?)]; SQL state [72000]; error code [1460]; ORA-01460: 转换请求无法实现或不合理。rnrn添加4000以下的数据是好使的,超过4000就<em>报错</em>。rn修改的时候没有任何问题,我Google了一些方法,貌似无法解决问题,请大神们帮解答,谢谢。
oracle作业下载
对oracle基础考察,主要是为了提高学习数据库的能力, 相关下载链接:[url=//download.csdn.net/download/jiangshugotoschool/3749344?utm_source=bbsseo]//download.csdn.net/download/jiangshugotoschool/3749344?utm_source=bbsseo[/url]
apachetomcat6.0下载
Tomcat 6.0 相关下载链接:[url=//download.csdn.net/download/xiao630/4019385?utm_source=bbsseo]//download.csdn.net/download/xiao630/4019385?utm_source=bbsseo[/url]
worklight 学习demo下载
一天时间学习worklight的成果,主要学习了worklight开发环境(包括mac os),ios,android应用的创建,worklight adapter,但adapter还有问题,会报“TrpeError:Cannot use 'in' operator to search for 'SUPPORT_COOKIES' in null”错误,正在解决中。 相关下载链接:[url=//download.csdn.net/download/m__point/4609068?utm_source=bbsseo]//download.csdn.net/download/m__point/4609068?utm_source=bbsseo[/url]
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数
我们是很有底线的