edu.jhu.cs.oose.group13.egtd.server.test
Class SqlExecutor

java.lang.Object
  extended by edu.jhu.cs.oose.group13.egtd.server.test.SqlExecutor

public class SqlExecutor
extends java.lang.Object

Slightly modified version of the com.ibatis.common.jdbc.ScriptRunner class from the iBATIS Apache project. Only removed dependency on Resource class and a constructor /* Copyright 2004 Clinton Begin Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Method Summary
static SqlExecutor getSqlExecutor()
           
 void runScript(java.io.Reader reader)
          Runs an SQL script (read in using the Reader parameter)
 void setDelimiter(java.lang.String delimiter, boolean fullLineDelimiter)
           
 void setErrorLogWriter(java.io.PrintWriter errorLogWriter)
          Setter for errorLogWriter property
 void setLogWriter(java.io.PrintWriter logWriter)
          Setter for logWriter property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSqlExecutor

public static SqlExecutor getSqlExecutor()
                                  throws java.sql.SQLException,
                                         java.io.IOException,
                                         java.lang.ClassNotFoundException
Throws:
java.sql.SQLException
java.io.IOException
java.lang.ClassNotFoundException

setDelimiter

public void setDelimiter(java.lang.String delimiter,
                         boolean fullLineDelimiter)

setLogWriter

public void setLogWriter(java.io.PrintWriter logWriter)
Setter for logWriter property

Parameters:
logWriter - - the new value of the logWriter property

setErrorLogWriter

public void setErrorLogWriter(java.io.PrintWriter errorLogWriter)
Setter for errorLogWriter property

Parameters:
errorLogWriter - - the new value of the errorLogWriter property

runScript

public void runScript(java.io.Reader reader)
               throws java.io.IOException,
                      java.sql.SQLException
Runs an SQL script (read in using the Reader parameter)

Parameters:
reader - - the source of the script
Throws:
java.io.IOException
java.sql.SQLException