[SQL*LOADER/JAVA] Impossible d'exécuter le programme "SQLLDR".

Hello,

I am starting with JAVA and I am developing a program that is supposed to import information from a .txt file into my table. I tried using SQL*LOADER, but it returns an error. I'm stuck and don't know how to resolve it! Here is the code I used:
try
{
String sqlldrCmd = "SQLLDR CONTROL=C:/Users/HP/Desktop/test.ctl "+
"LOG=C:/Users/HP/Desktop/test.log"+
"DATA=C:/Users/HP/Desktop/test.txt USERID=login/password"+
"BAD=C:/Users/HP/Desktop/test.bad ERRORS=999 "+
"LOAD=2000 SKIP=0";
System.out.println("SQLLDR Started");
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(sqlldrCmd);
System.out.println("SQLLDR Ended");
}
catch (Exception e)
{
e.printStackTrace();
}

This gives me the following error:

java.io.IOException: Cannot run program "SQLLDR": CreateProcess error=2, The specified file cannot be found
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at com.rgagnon.howto.Exec.main(Exec.java:43)
Caused by: java.io.IOException: CreateProcess error=2, The specified file cannot be found
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
... 5 more

--> I hope you can help me. Thank you!

Configuration: Windows 7 / Firefox 14.0.1

1 answer

  • Votes
  • Date
  • Descending date
  1. String sqlldrCmd = "c:\program files\blablal\sqlloader\SQLLDR CONTROL=C:/Users/HP/Desktop/test.ctl "+
    1. Thank you, Joe, for your intervention. I can't find sqlldr anywhere. I have Oracle client 11g located at "Z:\app\HP\product\11.1.0\client_1", but I can't find it there either.
    2. Are you sure you installed it? It seems to me that it is not installed by default. You need to select it specifically. Try restarting the Oracle installer. The installed components will appear grayed out.
    3. Yes, I am sure I installed it. "Try restarting the Oracle installation program" are you talking about Oracle Database? Because Oracle Client only has one program!