Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Execute sqlldr command from java code.

 
Ritu Kapoor
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am not able to transfer the data from txt to oracle table using sqlldr. If I execute the same command from cmd, it executes fine but does not work if I execute from java code.

Please find the code below






Please help to resolve it.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Process proc = rt.exec(cmd);

Executes one command line. You appear to have multiple commands you want to run. In that case, I would write a .bat file containing all of those commands and exec() the batch file.

You must also provide for consuming the stdOut and stdErr streams created by the process - see the Process JavaDocs.

Bill
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic