** The following command works fine when run directly on terminal
mysqldump -uabc -pabc1234 --compact --no-create-info -w \"fieldname != 'A'\" dbname tablename -hhostaddress --result-file=/tmp/myfile.txt
** But when it is executed using Runtime() method then it does not produce the output in the destination file.
String s="mysqldump -uabc -pabc1234 --compact --no-create-info -w \"fieldname != 'A'\" dbname tablename -hhostaddress --result-file=/tmp/myfile.txt";
Runtime.getRuntime().exec(s);
(** say abc is the username and abc1234 the password)
The same problem occurs if redirection to the destination file ( > ) is usedinstead of --result-file option. What shall i do to execute it from within a java program ?