Running mysqldump query from java code
807589Aug 8 2008 — edited Aug 8 2008Hello,
I m making a program I want to take a backup of database on a click of a button for which i want to execute this query :
"mysqldump --user=root --password=root --opt dbname>c:\backup.sql"
and my code is :
String command = "cmd /c start";
String[] env = new String[]{"mysqldump","--user=root", "--password=root",
"--opt", "njitsurvey", "<", "c:\\backup_db.sql" };
File dir = new File("C:/Program Files/MySQL/MySQL Server 5.0/bin/");
Process p1 = Runtime.getRuntime().exec(command, env, dir);
My problem is my command is running and going in to the directory also but not running my query and i m not getting and error also
Edited by: purva on Aug 7, 2008 11:56 PM