呵呵,给你个思路:
通过Runtime.getRuntime().exec方法用于执行外部程序

解决方案 »

  1.   

    可我用以下语句
      String mysql = "mysqldump -u sunresto --password=toto42 -h 10.42.20.10 sunresto --result-file=C:/su.sql";
       Runtime.getRuntime().exec(mysql);
    会输出错误信息
      CreateProcess: mysqldump -u sunresto --password=toto42 -h 10.42.20.101 sunresto --result-file=C:/su.sql error=2
      但这语句直接在MYSQL下执行是正确的.为什么?
      

  2.   

    这只是参数,前面还有命令行(c:mysql\bin)