I am having multiple mysql databases running on multiple servers.In hsql database we can start the server or stop the server using java programming.I am going to use any dat
Try this in windows machine:
START
Process process = Runtime.getRuntime().exec("net START MySQL");
STOP
Process process = Runtime.getRuntime().exec("net STOP MySQL");
If you are using a linux system, you can invoke the database init script using java. They are usually located in /etc/init.d/mysql[d]
ond BSD variants it is found in /usr/local/etc/rc.d/
. I am not sure how this work in Windows environments.
You have to ensure that your user which is running the process is allowed to execute this scripts.