View Single Post

   
  #6 (permalink)  
Old 02-27-2008, 06:50 AM
technocrat
 
Posts: n/a
Default Re: How do we execute this command through java?

String line;
Process p = Runtime.getRuntime().exec("db2cmd /c /w /i db2 -tvf
/home/filename.txt >output");

BufferedReader input = new BufferedReader
(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
System.out.println(line);
}
input.close();
System.out.println("Output Print done");


When I run this...I get an error saying...db2cmd not found...
SQL4302N Procedure or user-defined function "CONTROL.INITTIERONE",
specific
name "SQL060424133114600" aborted with an exception "db2cmd: not
found".
SQLSTATE=38501
What might be going wrong???

Reply With Quote