Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes Trouble in executing sqlldr through java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Trouble in executing sqlldr through java" Watch "Trouble in executing sqlldr through java" New topic
Author

Trouble in executing sqlldr through java

chetan phanse
Greenhorn

Joined: Jun 13, 2011
Posts: 1
I am executing sqlldr shell command through my java application using Process and Runtime.
The command runs successfully when the file to be loaded in Oracle is small. However when I have a large file (about 4 million records) the sqlldr process just hangs
However if I run the same sqlldr command through my command prompt on shell it works fine

The process is not killed, but but just stuck and I get njo response in java

Has anybody faced similar problems with executing a shell command process through java.
Any help is appreciated
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

chetan phanse wrote:Has anybody faced similar problems with executing a shell command process through java.


Absolutely. Even 10 years ago that was a common enough problem that somebody wrote a comprehensive article in JavaWorld explaining how to make that work properly. You should read it: When Runtime.exec() won't.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37877
    
  22
Welcome to the Ranch

We quote that article by Michael Daconta at least once a week.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trouble in executing sqlldr through java
 
Similar Threads
URGENT - runtime.exec command doesn't execute on unix
handling Java child process execution
process execution in linux
Shell script to run sqlldr
Passing runtime environment to child process on Solaris and citrix from java program