Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

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!

Read a txt file make it a clob

843836Jun 8 2004 — edited Oct 3 2008
Hello. I have a text file that I'd like to read and then set the contents to a clob value. I'm really not too familar with streams and buffers, so everything I've tried has been grasping at straws.

I've tried reading the file with a fileReader object then writing it a string and trying to convert string to clob... no go

FileReader frObject = new FileReader("d:\\jrun4\\servers\\test\\Ndadsbload1.txt");
BufferedReader brObject = new BufferedReader(frObject);
String line = brObject.readLine();
String sFile = "";
Clob clob;

while (line != null) {
sFile += line;
line = brObject.readLine();
}

I've read on clobs, and saw some on ascii streams, but I'm kinda stuck. Can anyone help me out?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2008
Added on Jun 8 2004
4 comments
965 views