Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

mysqldump command execution in java

807605Jun 19 2007 — edited Jun 23 2007
public class SqlDum
{
public static void main(String args[])
{
try
{
String str="mysqldump -u root -p threadpool > test.sql";
Process p=Runtime.getRuntime().exec(str);
p.waitFor();
}
catch(Exception e)
{
System.out.println(e);
}
}
}
The above code executed sucessfully but there is no generation of sql file.If iam run the command mysqldump -u root -p threadpool > test.sql its executes sucessfully and backup file created.... Command execution takes place in linux platform...?how can i execute in java?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 21 2007
Added on Jun 19 2007
7 comments
284 views