title: mysqldump file creates an empty sql file
body: <p>i apply comment 1 and 2 alternatively.But i didn't get myqldump file using java.mysqldump working in cmd. i think in cmd it ask password  after typing mysqldump comment. please help me fast.thanks in advance.</p>
  
  <pre><code>   String dumpCommand = "C:\\Program Files\\MySQL\\MySQL Server 5.0\\bin\\mysqldump" + " -u " + user + " -p" + " " + database + " &gt; " + path;
      **//command 1**
      Runtime rt = Runtime.getRuntime();
      File test = new File(path);
      PrintStream ps;
  
      try {
      //    Process child = rt.exec("Cmd /c \"C:/Program Files/MySQL/MySQL Server 5.0/bin/mysqldump\" -u root -p saxco &gt; "+path);//command 2
  
          Process child = rt.exec(dumpCommand);
          ps = new PrintStream(test);
           InputStream in = child.getInputStream();
          int ch;
          while ((ch = in.read()) != -1) {
             ps.write(ch);
              System.out.write(ch);
          }
  </code></pre>