Examples of ScriptRunner


Examples of com.carbonfive.db.jdbc.ScriptRunner

    {
        InputStream inputStream = null;
        try
        {
            inputStream = script.getInputStream();
            ScriptRunner scriptRunner = new ScriptRunner(dbType);
            scriptRunner.execute(connection, new InputStreamReader(inputStream, "UTF-8"));
            Validate.isTrue(!connection.isClosed(), "JDBC Connection should not be closed.");
        }
        catch (IOException e)
        {
            throw new MigrationException("Error while reading script input stream.", e);
View Full Code Here

Examples of com.cloud.utils.db.ScriptRunner

    }

    protected void runScript(Connection conn, File file) {
        try {
            FileReader reader = new FileReader(file);
            ScriptRunner runner = new ScriptRunner(conn, false, true);
            runner.runScript(reader);
        } catch (FileNotFoundException e) {
            s_logger.error("Unable to find upgrade script: " + file.getAbsolutePath(), e);
            throw new CloudRuntimeException("Unable to find upgrade script: " + file.getAbsolutePath(), e);
        } catch (IOException e) {
            s_logger.error("Unable to read upgrade script: " + file.getAbsolutePath(), e);
View Full Code Here

Examples of com.cloud.utils.db.ScriptRunner

            System.out.println("========> WARNING: Provided file does not exist: " + file);
        return f.exists();
    }

    private static void runScript(Connection conn, Reader reader, String filename, boolean verbosity) {
        ScriptRunner runner = new ScriptRunner(conn, false, true, verbosity);
        try {
            runner.runScript(reader);
        } catch (IOException e) {
            System.err.println("Unable to read " + filename + ": " + e.getMessage());
            System.exit(1);
        } catch (SQLException e) {
            System.err.println("Unable to execute " + filename + ": " + e.getMessage());
View Full Code Here

Examples of com.cloud.utils.db.ScriptRunner

    }

    protected void runScript(Connection conn, File file) {
        try {
            FileReader reader = new FileReader(file);
            ScriptRunner runner = new ScriptRunner(conn, false, true);
            runner.runScript(reader);
        } catch (FileNotFoundException e) {
            s_logger.error("Unable to find upgrade script: " + file.getAbsolutePath(), e);
            throw new CloudRuntimeException("Unable to find upgrade script: " + file.getAbsolutePath(), e);
        } catch (IOException e) {
            s_logger.error("Unable to read upgrade script: " + file.getAbsolutePath(), e);
View Full Code Here

Examples of com.cloud.utils.db.ScriptRunner

    }

    protected void runScript(Connection conn, File file) {
        try {
            FileReader reader = new FileReader(file);
            ScriptRunner runner = new ScriptRunner(conn, false, true);
            runner.runScript(reader);
        } catch (FileNotFoundException e) {
            s_logger.error("Unable to find upgrade script: " + file.getAbsolutePath(), e);
            throw new CloudRuntimeException("Unable to find upgrade script: " + file.getAbsolutePath(), e);
        } catch (IOException e) {
            s_logger.error("Unable to read upgrade script: " + file.getAbsolutePath(), e);
View Full Code Here

Examples of com.cloud.utils.db.ScriptRunner

    }

    protected void runScript(Connection conn, File file) {
        try {
            FileReader reader = new FileReader(file);
            ScriptRunner runner = new ScriptRunner(conn, false, true);
            runner.runScript(reader);
        } catch (FileNotFoundException e) {
            s_logger.error("Unable to find upgrade script: " + file.getAbsolutePath(), e);
            throw new CloudRuntimeException("Unable to find upgrade script: " + file.getAbsolutePath(), e);
        } catch (IOException e) {
            s_logger.error("Unable to read upgrade script: " + file.getAbsolutePath(), e);
View Full Code Here

Examples of com.ibatis.common.jdbc.ScriptRunner

    Connection conn = ds.getConnection();

    Reader reader = Resources.getResourceAsReader(script);

    ScriptRunner runner = new ScriptRunner(conn, false, false);
    runner.setLogWriter(null);
    runner.setErrorLogWriter(null);

    runner.runScript(reader);
    conn.commit();
    conn.close();
    reader.close();
  }
View Full Code Here

Examples of com.oltpbenchmark.util.ScriptRunner

    public final void createDatabase(DatabaseType dbType, Connection conn) throws SQLException {
        try {
            File ddl = this.getDatabaseDDL(dbType);
            assert(ddl != null) : "Failed to get DDL for " + this;
            assert(ddl.exists()) : "The file '" + ddl + "' does not exist";
            ScriptRunner runner = new ScriptRunner(conn, true, true);
            if (LOG.isDebugEnabled()) LOG.debug("Executing script '" + ddl.getName() + "'");
            runner.runScript(ddl);
        } catch (Exception ex) {
            throw new RuntimeException(String.format("Unexpected error when trying to create the %s database", this.benchmarkName), ex);
        }
    }
View Full Code Here

Examples of com.rescripter.script.ScriptRunner

  private Mockery context = new Mockery() {{ setImposteriser(ClassImposteriser.INSTANCE); }};

  @Test public void
  loads_a_file_from_the_workspace() throws IOException, CoreException {
   
    final ScriptRunner scriptRunner = context.mock(ScriptRunner.class);
    final ScriptStack scriptStack = context.mock(ScriptStack.class);
    final FileContentsReader fileReader = context.mock(FileContentsReader.class);
   
    final IFile location = context.mock(IFile.class, "location");
    final IContainer container = context.mock(IContainer.class);
View Full Code Here

Examples of games.stendhal.server.core.scripting.ScriptRunner

      StendhalRPAction.initialize(rpman);

      /* Initialize quests */
      SingletonRepository.getStendhalQuestSystem().init();

      new ScriptRunner();

      final Configuration config = Configuration.getConfiguration();
      try {
        final String[] extensionsToLoad = config.get("server_extension").split(",");
        for (final String element : extensionsToLoad) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.