Can't restore from mysql dump file I used mysqldump command to export/dump .sql file with rows like:

String cmd1 = mysqldump + " -h" + host + " -u" + username + " -p" + password + " " + "--compact --no-create-info " + "--where=ID=" + "'5b4ed36d-6152-4bfd-ad06-666f781e8bdc'" + " " + database + " " + "EMPLOYEE" + " " + "--result-file=" + "C:\\employee.sql";


This is the result of above command in a employee.sql file:

INSERT INTO `employee` VALUES ('Anette','Busch','2014-08-12','admin',' ','FALSE');


Now, I want to import the values from empolyee.sql file using command: 

String cmd =  mysql + " --user=" + username + " --password=" + password +  " -e" + " source " + restoreFile; 


The problem is I can't execute import command. I'm using the same import command for whole database, that works fine, but not in this case.

Thanks a lot for your guidance.
The problem is that you forgot to put double quotes around the -e parameter

String cmd =  mysql + " --user=" + username + " --password=" + password +  " -e\"" + "source " + restoreFile + "\""; 


An alternative would be to redirect the file into the  mysql client

String cmd =  mysql + " --user=" + username + " --password=" + password +  " &lt; " + restoreFile; 


I also just noticed that you forgot to set the target database

String cmd =  mysql + " --user=" + username + " --password=" + password +  " -D" + mydb + "-e\"" + "source " + restoreFile + "\""; 

String cmd =  mysql + " --user=" + username + " --password=" + password +  " -D" + mydb + "  &lt; " + restoreFile; 


Give it a Try !!!