aspose file tools*
The moose likes JDBC and the fly likes Problem to display clob data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem to display clob data" Watch "Problem to display clob data" New topic
Author

Problem to display clob data

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 740
Hello,

Oracle version is: 11.2, jdk7 and tomcat apache-tomcat-6.0.18
I am facing problem to retriew record from database. my code is as follow:


The record exists for desc2 but the above code output is "null" for desc2 whereas I checked on SQL prompt and its working fine.


I also called only desc2 column and its displaying ok.


My table structure is:

I stuck here. Please help me

Best regards
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Farakh,
You state that the data type for column DESC2 in table NEWSARTICLES is CLOB.
In that case I believe you must change the following line of your java code:

to this:

Good Luck,
Avi.
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 740
Thanks Avi Abrami I tried and now it displaying:


Best regards
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19759
    
  20

If you'd check the methods in java.sql.Clob you'd see one that returns a String. It takes two parameters, the start and end of the substring. If you provide 0 and clob.length() that will get you the entire text.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem to display clob data