Menu

#1 Help with Clob with jPersist

open
nobody
None
5
2010-02-04
2010-02-04
Yu Shao
No

Hi,

I am using Clob type for my "BODY" column in my oracle database. In my Java POJO,

If I have get/set method like this:
public Clob getBody();
public void setBody(Clob c);

I was able to load the data from database, but couldn't save since there's no way to create a clob object from a String object.

But if use get/set method like this:
public String getBody();
public void setBody(String s);

I was able to save the data into the clob column, but couldn't load the data from db, got "invalid column name" error.

I looked at the document about the Clob/Blob, but it's not clear about how to do it. Please help and if you can provide some prototype code that'll be great!

Thanks,
Yu

Discussion


Log in to post a comment.