The following is an example of starting a hypertable database by executing shell commands in Java.
/** <Br/> * Start the Database Service <br/> * @ return <br/> */<br/> Public String startup () {</P> <p> // The command is dead. <br/> string commands = "HT start all-servers local "; <br/> // string commands = "Ping 192.168.1.100"; <br/> PROCESS p; <br/> try {<br/> P = runtime.getruntime(cmd.exe C (commands ); <br/> If (P. waitfor () = 0) <br/>{< br/> MSG = "the service is started successfully! "; <Br/>}< br/> else <br/>{< br/> MSG =" service startup failed! "; <Br/>}< br/>} catch (ioexception e) {<br/> MSG =" service startup failed! "; <Br/> E. printstacktrace (); <br/>} catch (interruptedexception e) {<br/> MSG =" service startup failed! "; <Br/> E. printstacktrace (); <br/>} catch (exception e) {<br/> MSG =" service startup failed! "; <Br/> E. printstacktrace (); <br/>}< br/> return" OK "; <br/>}