I have a java code through which I call the bat file. This bat file contains call to sqlldr which loads data from a txt file into a table(in oracle). This is the java code to call the bat file
ProcessBuilder pb = new ProcessBuilder(new File(".").getAbsolutePath()
+ File.separator + "ld.bat");
System.out.println("Before start");
Process start;
try {
start = pb.start();
} catch (IOException e) {
e.printStackTrace();
}
Below this code I am creating new threads and doing my other tasks. The loading of data takes place in the background. I want to do some task (e.g moving the txt data file to another location) once loading is done. Is there a way to get notified once the loading of data is done by sqlldr.
I have come across a work around - I can keep checking the number of rows in d table and compare it with the number of rows in the raw txt file. But I would like to know if there is some another solution for this.
Also I dont want to use start.waitFor()
as this will keep my other activities on hold.