org.bitrepository.service.database
Class SqlScriptRunner
java.lang.Object
org.bitrepository.service.database.SqlScriptRunner
public class SqlScriptRunner
- extends Object
Runs a sql script as a sequence of JDBC statements.
Slightly modified version of the com.ibatis.common.jdbc.SqlScriptRunner class
from the iBATIS Apache project. Only removed dependency on Resource class
and a constructor
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SqlScriptRunner
public SqlScriptRunner(Connection connection,
boolean autoCommit,
boolean stopOnError)
- Parameters:
connection
- The connection to useautoCommit
- Enable autocommitstopOnError
- Stop running the script, if a statement fails.
setDelimiter
public void setDelimiter(String delimiter,
boolean fullLineDelimiter)
- Parameters:
delimiter
- The statement delimiter, eg. ';' for mysql.fullLineDelimiter
- true
if the delimiter used to distinguise between lines.
runScript
public void runScript(Reader reader)
throws IOException,
SQLException
- Runs an SQL script (read in using the Reader parameter)
- Parameters:
reader
- - the source of the script
- Throws:
IOException
SQLException
Copyright © 2010-2013 The State and University Library, The Royal Library and The State Archives, Denmark. All Rights Reserved.