MySQLBackup { public static void backupAndSave(String springResourcePath){ try { initByApplication(springResourcePath); doBackUpAndSave(); } catch (ParserConfigurationException e) { logger.error("MySQL数据库进行备份，XML解析器创建失败！"); } catch (SAXException e) { logger.error("MySQL数据库进行备份，XML解析错误！"); } catch (IOException e) { logger.error("MySQL数据库进行备份，XML文件不存在！"); } }  static void backupAndSave(String springResourcePath); static void backupAndSave(String user , String password , String database , String host , String port , String charsetName , String mysqlPath , String exportPath);  }
@Test public void test(){ MySQLBackup.backupAndSave("context-dao.xml"); }