//用线程的方式读取DOS窗口的输出内容 class StreamDrainer implements Runnable { private InputStream ins; public StreamDrainer(InputStream ins) { this.ins = ins; } public void run(){ try { BufferedReader reader = new BufferedReader( new InputStreamReader(ins)); String line = null; while ((line = reader.readLine()) != null) { System.out.println(line); } } catch (Exception e) { e.printStackTrace(); } } }
//在dos下开始执行数据库备份与恢复 class DatabaseBR{
public DatabaseBR(){ } public int StartRun(DatabaseBuckup databaseBuckup,String state,String statevalue) { int exitvalue=-1; Runtime rt = Runtime.getRuntime(); Process processexp = null;