I'm trying to run SQL Loader from a Java method but I'm facing a problem.
I'm creating a Runtime process to run the SQLLDR command but not all the rows in the data file are being loaded. Instead it's getting stuck at the same number of rows (5184 rows) regardless of the total number of rows in the data file.
However, when I copy the exact same command and run it directly from the command prompt, it's working perfectly and all the rows are being loaded.
Any idea what can be the cause of this problem? Is it some kind of buffer size in Java that I need to change?
Thanks!
// Run SQL Loader after creating the control file
Runtime rt = Runtime.getRuntime();
String sqlLoaderPath = "C:\\app\\product\\11.1.0\\client_1\\BIN\\";
String cmd = sqlLoaderPath + "SQLLDR.EXE userid=***************************"
+ "data=c:\\sqlldr\\sqlldr_data.dat "
+ "control=c:\\sqlldr\\sqlldr_control.ctl "
+ "log=c:\\sqlldr\\sqlldr_log.log "
+ "discard=c:\\sqlldr\\sqlldr_discard.disc "
+ "bad=c:\\sqlldr\\sqlldr_bad.bad ";
Process proc = rt.exec(cmd);
int exitVal = proc.waitFor();
proc.destroy();