This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes reading clob Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "reading clob " Watch "reading clob " New topic

reading clob

pendse anagha
Ranch Hand

Joined: Mar 09, 2005
Posts: 44
Hello ,
I have a huge text file which contains the emails and city .
There would be thousands of such records in the file .

I have uploaded the file into Oracle into a clob .

Now I want to read the clob and do some procesing for each line
i.e . : email,city

I want to get each line from the clob .

Could someone kindly point me to an example
Also what are the best practices while reading from clob ?

Thanks in advance ,
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 31588

The easest way is to call getCharacterStream() on the Clob. That way you can deal with the result as a familiar reader object.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: reading clob