com.flexive.shared
Class FxSharedUtils.SQLExecutor

java.lang.Object
  extended by com.flexive.shared.FxSharedUtils.SQLExecutor
Enclosing class:
FxSharedUtils

public static class FxSharedUtils.SQLExecutor
extends java.lang.Object

An SQL executor, similar to ant's sql task An important addition are raw blocks: lines starting with '-- @START@' indicate the start of a raw block and lines starting with '-- @END@' indicate the end of a raw block. Raw blocks are passed "as is" to the database as one string


Constructor Summary
FxSharedUtils.SQLExecutor(java.sql.Connection con, java.lang.String code, java.lang.String delimiter, boolean rowDelimiter, boolean keepformat, java.io.PrintStream out)
          Ctor
 
Method Summary
 int execute()
          Main execute method, returns number of updates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FxSharedUtils.SQLExecutor

public FxSharedUtils.SQLExecutor(java.sql.Connection con,
                                 java.lang.String code,
                                 java.lang.String delimiter,
                                 boolean rowDelimiter,
                                 boolean keepformat,
                                 java.io.PrintStream out)
Ctor

Parameters:
con - an open and valid connection
code - the source sql code
delimiter - delimiter to use
rowDelimiter - is the delimiter or row delimiter?
keepformat - keep original format?
out - stream for messages
Method Detail

execute

public int execute()
            throws java.sql.SQLException,
                   java.io.IOException
Main execute method, returns number of updates

Returns:
number of updates
Throws:
java.sql.SQLException - on errors
java.io.IOException - on errors