java exec() run a db2 import command, waitfor() never return
问题 I used java process run a external command. This command is .bat file with some db2 commands. When I want use the process waiffor() return a result, I can't get anything. The program must be block. java code: ..... Runtime rt = Runtime.getRuntime(); Process p = null; String command = "db2cmd -c -w -i C:/import1.bat"; p = rt.exec(command); p.waitFor(); ..... import1.bat: @echo off db2 connect to text_DB user text using tesxt0114 db2 IMPORT FROM "C:\MVCMSInputFiles\IIS20121224180129.csv" OF DEL