String[] executeCmd = new String[] { "mysql", "-u",DB_USER,"-p"+DB_PASSWORD,DB_NAME, " < ", "\""+FileName+"\"" };
Process runtimeProcess = Runtime.getRuntime().exec(executeCmd);
int processComplete = runtimeProcess.waitFor();
System.out.println("processComplete: " + processComplete);
这是我使用过的代码。当调用“waitFor()”方法时程序挂起。
如何解决这个问题?