0

I am having difficulty while reading from oracle database using hibernate. The column is of clob type and mapped class property is of String type. The database is Oracle 11G. I have tried to update my driver as suggested by some posts, But it was of no use. The problem is that All other columns(which are not clob) are read properly and the column which is clob is returned null besides it has data. Thanks in advance.

The query is :

select id,about_us,other_details,periodicity,active,createts,updatets from Details where id = ?

This above the HQL query where about_us and other_details are clob type in database. The java entity contains it as type String.

Rahul

2 Answers 2

2

I tried many solutions as suggested in different posts, It includes: 1) Updating odbc jar. 2) Using @lob on the porperty in hibernate mapping/entity.

Both of the above solutions did not work for me, Rather I used the hibernate function str(clob_property) to read it, It worked for me and I could get the property read.

Regards Rahul

Sign up to request clarification or add additional context in comments.

Comments

0

Have you tried something like this?

@Lob @Column(name = "long_text")
private String longText;

1 Comment

Yes, I have tried using @Lob annotation, but it was of no respite. In fact, Hibernate detects itself the underlying columng with just use of @Column annotations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.