net.sf.fikin.sql
Class SQLPipe

java.lang.Object
  extended by net.sf.fikin.sql.SQLPipe

public class SQLPipe
extends java.lang.Object

This object represents a pipe of sql elements.

When constructed, such a pipe could become equivalent to applications like Oracle's SqlPlus or any other sql-processing application.

The pipe was employed as as an abstraction in order to allow a greater reusability of building elements (aka. SQLPipeElement).

By aiming at this modularity, one can construct different in its purpose applications with minimum effort.

Usage:

      SQLPipe pipe = new SQLPipe();
      
      pipe.add( new SQLElement(...) );
      ...
      
      pipe.execute( sqlCmd );
 

created on Dec 15, 2006

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

Constructor Summary
SQLPipe()
           
 
Method Summary
 void add(SQLPipeElement elem)
          add given sql pipe element to the end of the pipe
 void execute(java.lang.String cmd)
          execute given sql command by deligating it to the first pipe element
 SQLPipeElement get(java.lang.Class provider)
          lookup a pipe element represented by given class name look at SQLPipeElement.getId() for explanations on ids
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLPipe

public SQLPipe()
Method Detail

get

public SQLPipeElement get(java.lang.Class provider)
lookup a pipe element represented by given class name look at SQLPipeElement.getId() for explanations on ids

Parameters:
provider -
Returns:
founded element or null if no such found

add

public void add(SQLPipeElement elem)
add given sql pipe element to the end of the pipe

Parameters:
elem - to add as last

execute

public void execute(java.lang.String cmd)
             throws java.sql.SQLException
execute given sql command by deligating it to the first pipe element

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


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