Hi All,
I'm having some problems with CLOBs
I'm trying to write a String message into the CLOB. (Oracle)
e.g.
Code:
Record r = new Record();
r.setSomeString(Hibernate.createClob(someString));
This won't compile because method setSomeString(CLOB) in the type Record is not applicable for the arguments (Clob)
BTW, setSomeString(CLOB) takes an argument of type oracle.sql.CLOB
OK fine, so I did a cast like this:
Code:
r.setSomeString((oracle.sql.CLOB) Hibernate.createClob(someString));
At run time however, this will throw an exception with the following message:
Code:
java.lang.ClassCastException: org.hibernate.lob.SerializableClob cannot be cast to oracle.sql.CLOB
My question is: How do I write a String into the CLOB?
Any suggestions?
Thanks