net.sf.fikin.sql
Class SQLPipeElement

java.lang.Object
  extended by net.sf.fikin.sql.SQLPipeElement
Direct Known Subclasses:
AbstractOutput, ContinueOnError, ExecuteSql, ExecutionTiming, JdbcConnection, JdbcStatement, PipeCanceler, SetAutocommit, SetServerOut, SimpleXmlFile, SqlsCounter

public abstract class SQLPipeElement
extends java.lang.Object

Represent a base for all SQL Pipe Elements.

These objects are highly modular, very precise in its purpose elements, providing some sql command processing. Such as taking timing of statement exection, prpviding of actual statment execution, various error handling (continue on error) and many more.

Developers must subclass this one in order to create a new pipe element.

This class provide with default implementation of all basic methods leaving for subclasses onty execute().

created on Dec 15, 2006

Since:
Version:
$Revision: 1.6 $
Author:
fiykov

Constructor Summary
SQLPipeElement()
          create an sql pipe element
 
Method Summary
abstract  void execute(java.lang.String cmd)
          execute given sql command
protected  java.lang.String getBaseClassName()
          set the base classname to this one
 java.lang.Class getId()
          what is the elements id i.e.
 SQLPipeElement getNext()
          get next element
 SQLPipe getPipe()
          get the pipe this object is created in
 void setNext(SQLPipeElement next)
          assign next in the pipe element called by SQLPipe
 void setPipe(SQLPipe pipe)
          assign the pipe this object will operate in called by SQLPipe itself
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLPipeElement

public SQLPipeElement()
create an sql pipe element

Method Detail

setNext

public void setNext(SQLPipeElement next)
assign next in the pipe element called by SQLPipe

Parameters:
next -

getNext

public SQLPipeElement getNext()
get next element

Returns:
next element is assigned, otherwise null

getId

public java.lang.Class getId()
what is the elements id i.e. represents the base class implementing a certain service. all inherited classes would still identify themself with the base class name Typically one subclasses this one and thus create a new type of sql processing. consequent subclassing only modify this behavior in some other way but does not alter its purpose. Thus id still remains of the first subclass. When some of the distant subclasses represent a completily new type of sql processing, it can overwrite this method in order to indicate a new class as id. by default this class provide class-inheritance introspection and chooses as base class name the direct subclass of this one. in case this is not correct behaviour, subclasses are expected to overwrite it.

Returns:
the class representing the

getPipe

public SQLPipe getPipe()
get the pipe this object is created in

Returns:
pipe

setPipe

public void setPipe(SQLPipe pipe)
assign the pipe this object will operate in called by SQLPipe itself

Parameters:
pipe -

execute

public abstract void execute(java.lang.String cmd)
                      throws java.sql.SQLException
execute given sql command

Parameters:
cmd - to execute
Throws:
java.sql.SQLException - in case of error

getBaseClassName

protected java.lang.String getBaseClassName()
set the base classname to this one

Returns:
this class name


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