Similar to C#'s Process.Close event in Java? -


if start process using processbuilder in java, there way listen if process has been closed? start process, insert record mysql table, , when process killed or user exited, execute delete statement in mysql table. i've done in c#, users requested application able run on linux , mac too, , stuck @ part.

try friend.

public class yourclass {      public static void main(string[] args) throws ioexception {          processbuilder  yourprocess = new processbuilder();          process process = yourprocess.start();//creates new object containing process         //your insert sql stuff...         try {             process.waitfor();//waits until process finish             //your delete sql stuff...         } catch (interruptedexception ex) {             system.out.println("the process finished unexpectly");;         }                 } } 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -