org.dbmaintain.script.runner.impl
Class JdbcScriptRunner
java.lang.Object
org.dbmaintain.script.runner.impl.JdbcScriptRunner
- All Implemented Interfaces:
- ScriptRunner
public class JdbcScriptRunner
- extends Object
- implements ScriptRunner
Default implementation of a script runner that uses JDBC to execute the script.
- Author:
- Filip Neven, Tim Ducheyne
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
databases
protected Databases databases
sqlHandler
protected SQLHandler sqlHandler
databaseDialectScriptParserFactoryMap
protected Map<String,ScriptParserFactory> databaseDialectScriptParserFactoryMap
JdbcScriptRunner
public JdbcScriptRunner(Map<String,ScriptParserFactory> databaseDialectScriptParserFactoryMap,
Databases databases,
SQLHandler sqlHandler)
execute
public void execute(Script script)
- Executes the given script.
All statements should be separated with a semicolon (;). The last statement will be
added even if it does not end with a semicolon.
- Specified by:
execute
in interface ScriptRunner
- Parameters:
script
- The script, not null
initialize
public void initialize()
- Description copied from interface:
ScriptRunner
- Initializes the script runner.
- Specified by:
initialize
in interface ScriptRunner
close
public void close()
- Description copied from interface:
ScriptRunner
- Stops the script runner, closing and cleaning up all open resources.
- Specified by:
close
in interface ScriptRunner
getTargetDatabaseDatabase
protected Database getTargetDatabaseDatabase(Script script)
- Parameters:
script
- The script, not null
- Returns:
- The db support to use for the script, not null
Copyright © 2011. All Rights Reserved.