All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.avaje.dbmigration.runner.MigrationScriptRunner Maven / Gradle / Ivy

There is a newer version: 1.3.2
Show newest version
package org.avaje.dbmigration.runner;

import org.avaje.dbmigration.ddl.DdlRunner;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * Runs the DDL migration scripts.
 */
public class MigrationScriptRunner {

  private final Connection connection;

  /**
   * Construct with a given connection.
   */
  public MigrationScriptRunner(Connection connection) {
    this.connection = connection;
  }

  /**
   * Execute all the DDL statements in the script.
   */
  int runScript(boolean expectErrors, String content, String scriptName) throws SQLException {

    DdlRunner runner = new DdlRunner(expectErrors, scriptName);
    return runner.runAll(content, connection);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy