net.sf.fikin.sql.core
Class ContinueOnError

java.lang.Object
  extended by net.sf.fikin.sql.SQLPipeElement
      extended by net.sf.fikin.sql.core.ContinueOnError

public class ContinueOnError
extends SQLPipeElement

A pipe element governing whether to continue execution on SQLException or abort.

All elements before this one in the pipe, will not receive any exeception (if getContinueOnError() is set to true.

created on Dec 16, 2006

Since:
Version:
$Revision: 1.5 $
Author:
fiykov

Constructor Summary
ContinueOnError()
          create an element catching all exceptions and ignoring them
ContinueOnError(boolean catchErrors)
          create an element whit defualt exceptions handling based on catchErrors
 
Method Summary
 void execute(java.lang.String cmd)
          catch the exception (if any) raised by next in the pipe elements and ignored it if getContinueOnError() is set to true
 boolean getContinueOnError()
          get current flag, if true all exceptions are ignored, otherwise false
 void setContinueOnError(boolean flg)
           
 
Methods inherited from class net.sf.fikin.sql.SQLPipeElement
getBaseClassName, getId, getNext, getPipe, setNext, setPipe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContinueOnError

public ContinueOnError()
create an element catching all exceptions and ignoring them


ContinueOnError

public ContinueOnError(boolean catchErrors)
create an element whit defualt exceptions handling based on catchErrors

Parameters:
catchErrors - if true all exceptions will be silenced, if false they will be passed alog the calling pipe elements
Method Detail

getContinueOnError

public boolean getContinueOnError()
get current flag, if true all exceptions are ignored, otherwise false

Returns:
true or false

setContinueOnError

public void setContinueOnError(boolean flg)

execute

public void execute(java.lang.String cmd)
             throws java.sql.SQLException
catch the exception (if any) raised by next in the pipe elements and ignored it if getContinueOnError() is set to true

Specified by:
execute in class SQLPipeElement
Parameters:
cmd - to execute
Throws:
java.sql.SQLException - in case of error


Copyright © 2003-2007 Nikolay Fiykov. All Rights Reserved.