public void postStartup() {
//启动数据库服务器
File f_obj=new File(".");
String path=f_obj.getAbsolutePath();
String cmd=path+"/jre1.5.0/bin/javaw -cp lib/derby.jar;lib/derbynet.jar org.apache.derby.drda.NetworkServerControl start";
run = Runtime.getRuntime();
process = null;
try {
process = run.exec(cmd);
} catch (IOException e) {
e.printStackTrace();
}
super.postStartup();
}
在postShutdown中关闭数据库:
public void postShutdown() {
//关闭数据库服务器
File f_obj=new File(".");
String path=f_obj.getAbsolutePath();
String cmd=path+"/jre1.5.0/bin/javaw -cp lib/derby.jar;lib/derbynet.jar org.apache.derby.drda.NetworkServerControl shutdown";
try {
process = run.exec(cmd);
} catch (IOException e) {
e.printStackTrace();
}
process.destroy();
super.postShutdown();
}
阅读(2991) | 评论(0) | 转发(0) |