net.sourceforge.sqlunit.handlers
Class SubHandler

java.lang.Object
  extended by net.sourceforge.sqlunit.handlers.SubHandler
All Implemented Interfaces:
IHandler

public class SubHandler
extends java.lang.Object
implements IHandler

The SubHandler is called from within the sub tag. It looks up the named subdef tag and overrides parameter values that are supplied in the sub tag. SQLUnit will rebuild the resolved Sub Element into either an Sql or Call Element and then delegate to the SqlHandler or CallHandler to build a DatabaseResult object.

Version:
$Revision: 1.2 $
Author:
Victor Alekseev (krocodl@users.sourceforge.net)

Constructor Summary
SubHandler()
           
 
Method Summary
 java.lang.Object process(org.jdom.Element elSub)
          Looks up the SQL string for the corresponding SubDef, replaces with parameters if defined, runs it, and returns a single result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubHandler

public SubHandler()
Method Detail

process

public final java.lang.Object process(org.jdom.Element elSub)
                               throws java.lang.Exception
Looks up the SQL string for the corresponding SubDef, replaces with parameters if defined, runs it, and returns a single result.

Specified by:
process in interface IHandler
Parameters:
elSub - the JDOM Element representing the func element.
Returns:
the value of the result of the SQL execution as a String.
Throws:
java.lang.Exception - if something went wrong with the func operation.