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 database at any time so I want to start the mysql database server or stop it using java programming.
Is there any way to start or stop the mysql database using java programming?
解决方案
Try this in windows machine:
START
Process process = Runtime.getRuntime().exec("net START MySQL");
STOP
Process process = Runtime.getRuntime().exec("net STOP MySQL");