This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Read a text file in Unix

 
Greg Mendez
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use a CLOB instead of VARCHAR2
 
Greg Mendez
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rene. Works great.
Here is the code if anyone wants to see it.


Here is the code in oracle...

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic