コード例 #1
0
 @Override
 public void importSchema(String user, String password, String schema, File dumpFile)
     throws MojoExecutionException {
   try {
     ProcessUtil.execWithInput(dumpFile, "mysql", "-u", user, "--password="******"スキーマインポート実行中にエラー", e);
   }
 }
コード例 #2
0
 @Override
 public void dropAll(
     String user, String password, String adminUser, String adminPassword, String schema)
     throws MojoExecutionException {
   if (adminPassword == null) adminPassword = "";
   try {
     ProcessUtil.exec(
         "mysqladmin",
         "-f", // force
         "-u",
         adminUser,
         "--password="******"drop",
         schema);
     ProcessUtil.exec(
         "mysqladmin", "-u", adminUser, "--password="******"create", schema);
   } catch (IOException e) {
     throw new MojoExecutionException("mysqldump", e);
   }
 }