I have a java program which uses Mysql database(using mysql which comes with Xaamp). I ve written batch script to start xaamp and run java program. How can i make sure that my java program is executed only after xaamp is up and running after startup? Or is there any alternatives, my constraint is that I can only use Mysql which comes with xaamp and i want a database entry at windows startup?
3 Answers
Start both applications as windows services and configure the java app service to depend on the mysql service.
C:\Users\user>sc showsid "MySQL"
NAME: MySQL
SERVICE SID: S-1-5-80-3683700405-516785638-1234977990-1036077020-2941583457
STATUS: Inactive
C:\Users\user>sc showsid "MySQL" | FIND "STATUS:"
STATUS: Inactive