Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OJDBC6 and CLOBs?

833169May 21 2015 — edited May 22 2015

Hi,

I am working on a Java program that calls a stored procedure in an Oracle 11.2g database and retrieves a set of records via a ref cursor. The program follows the standard Connection/CallableStatement/ResultSet pattern. A ResultSet object is used to access and iterate through the returned cursor, processing each record in turn.

One of the database fields returned in the cursor is a CLOB, which I'm retrieving using the NClob class's getNClob() method. Two other methods - length() and getSubString() are then used to get the length of the CLOB and copy of it off to a String object respectively.

The problem is that these latter two method calls are relatively slow, taking around 80ms to complete for modestly sized CLOBs of, say, around 10KB in size.

Is this the most efficient way to access a CLOB and retrieve its contents? If so, is there anything I can do, to make it run faster?

Thanks,

William Walker

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 19 2015
Added on May 21 2015
2 comments
1,360 views