title: how to execute a cmd line when prompts for password with java
body: <p>Hy, </p>
  
  <p>I try to dump a postgresql database from my java application.</p>
  
  <p>In cmd it goes ok: </p>
  
  <pre><code>pg_dump -U user database&gt;outfile.sql 
  </code></pre>
  
  <p>and CMD prompts for password</p>
  
  <p>To access this command line from my java: </p>
  
  <pre><code>Runtime.getRuntime().exec("pg_dump -U user database&gt;outfile.sql"); 
  </code></pre>
  
  <p>and now it waits for password.</p>
  
  <p>I tried with <code>Runtime.getRuntime().exec(String[])...</code> but nothing.</p>
  
  <p>Somehow, I must set the parameter 'password' in <code>.exec()</code> method,</p>
  
  <p>pg_dump statement does not accept password in it's command line..</p>