Procesos Externos

katy
10 de Enero del 2006
Necesito hacer un dum de mi BD. Estoy utilizando el siguiente codigo.
String accion = "pg_dump -i -h localhost -p 5432 -U postgres -W -F p -C -v -f "Respal" "BD_MJX"";
String password = "masterkey";
Process p = Runtime.getRuntime().exec(accion);
OutputStream out = p.getOutputStream();
PrintStream stream = new PrintStream(out);
stream.println(password);

alguien me podria ayudar, no funciona.