These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: inserting data into clob column - UnsupportedOperation excep
PostPosted: Thu Dec 09, 2004 5:10 pm 
Newbie

Joined: Thu Nov 11, 2004 3:24 pm
Posts: 17
I tried the following code

Session session = PBGManagerBase.getHibernateSession();
Transaction tx = session.beginTransaction();

Note note1 = new Note();
note1.setNoteId(10);
note1.setNoteText(Hibernate.createClob(" "));
session.save(note1);
session.flush();
session.refresh(note1,LockMode.UPGRADE);
oracle.sql.CLOB clob = (oracle.sql.CLOB) note1.getNoteText();
java.io.Writer pw = clob.getCharacterOutputStream();
pw.write("This is a test clob data inserted using hibernate");
pw.close();
tx.commit();
PBGManagerBase.closeHibernateSession();

In this the line session.save(note1) gives me an error
"Unhandled Exception thrown: class java.lang.UnsupportedOperationException"

In my mapping (Note.hbm.xml and Note.java) file the type for attribute noteText is java.sql.Clob.

Can anyone help


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 09, 2004 5:16 pm 
Newbie

Joined: Thu Nov 11, 2004 3:24 pm
Posts: 17
i am able to read the data though easily.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.