aspose file tools*
The moose likes Java in General and the fly likes Read a text file in Unix Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Read a text file in Unix" Watch "Read a text file in Unix" New topic
Author

Read a text file in Unix

Greg Mendez
Greenhorn

Joined: Aug 23, 2010
Posts: 5
The java program stays in a windows box.
The text file stays in a unix box and Oracle also stays in the same unix box.
So the java program wants the content of the text file.

I can do this via JDBC
LOOP
BEGIN
utl_file.get_line(vInHandle, vNewLine);
dbms_output.put_line(vNewLine);
EXCEPTION
WHEN OTHERS THEN
EXIT;
END;
END LOOP;

I can use VARCHAR2, but it has limits. Only 4k size.
So how exactly can java gets the content?
By the way, no ftp, or share drive exists.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

You can use a CLOB instead of VARCHAR2


Regards, Rene Larsen
Dropbox Invite
Greg Mendez
Greenhorn

Joined: Aug 23, 2010
Posts: 5
Thanks Rene. Works great.
Here is the code if anyone wants to see it.


Here is the code in oracle...

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Read a text file in Unix