Bonjour tout le monde
je dois éxécuter un job talend depuis un programme java avec DOS
commande suivante :
Code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| try {
Runtime runtime = Runtime.getRuntime();
String[] args = {"cmd.exe", "/C", "cd " + jobsDirectory + job + "\\" + job.substring(0, job.length() - 4) + " & java -Xms256M -Xmx1024M -cp classpath.jar; importationsql." + job.toLowerCase().REPLACE(".", "_") + "." + job.substring(0, job.length() - 4) + " --context_param RemoteSQL_Server=TEST2 --context_param RemoteSQL_Port=1433 --context_param RemoteSQL_Database=UNITEST_" + SelectionClient.nomClientChoisi + " --context_param RemoteSQL_Login=sa --context_param RemoteSQL_Password=sql --context_param cheminDuFichier=" +"\""+ path+"\""};
System.out.println(args[2]);
final Process process = runtime.exec(args);
// TODO ADD your handling code here:
} catch (IOException ex) {
// Logger.getLogger(UNIDBView.class.getName()).log(Level.SEVERE, NULL, ex);
System.out.println(ex.getStackTrace());
} |
je veux pouvoir récupérer les erreurs java pour traiter les erreurs comment faire ?