org.jtools.jpool.shell
Class Sequence

java.lang.Object
  extended byorg.jtools.jpool.shell.Sequence

public class Sequence
extends java.lang.Object

 Sequence Class
 This shell provides an easy way to execute sql statement through the
 select and the execute method. For each request on one of those two
 methods a connection will be retrieved from the corresponding pool. After
 the excution of the statement (success or failed) the connection is returned
 to the pool for availability.
 

Version:
$Id: Sequence.java,v 1.1 2003/10/15 15:37:30 stfndln Exp $
Author:
Stefaan Delanghe (stfndln@yahoo.com)

Constructor Summary
Sequence(PoolManager _manager)
          Constructs the Sequence shell class in order to access the database pools in an easy way.
 
Method Summary
 boolean execute(java.lang.String _dbname, java.lang.String _statement, java.lang.Object[] _param)
          Execute a insert, update or delete query.
 java.util.Vector select(java.lang.String _dbname, java.lang.String _statement, java.lang.Object[] _param)
          Executes a select statement which returns a Vector with the results of the statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sequence

public Sequence(PoolManager _manager)
Constructs the Sequence shell class in order to access the database pools in an easy way.

Parameters:
_manager - Class to access the several pools functionality
Method Detail

select

public java.util.Vector select(java.lang.String _dbname,
                               java.lang.String _statement,
                               java.lang.Object[] _param)
Executes a select statement which returns a Vector with the results of the statement. The result consist out of a vector in a vector where the first vector represents the row and the vector included contains the columns.

Parameters:
_dbname - The database on which you want to execute the statement
_statement - The Select statement you want to execute
_param - The parameters that are needed in the statement Such a parameter replaces the ? in the sql statement string.
Returns:
The result of the select statement.

execute

public boolean execute(java.lang.String _dbname,
                       java.lang.String _statement,
                       java.lang.Object[] _param)
Execute a insert, update or delete query. A boolean is returned to tell you if the command has succeeded or failed.

Parameters:
_dbname - The database on which you want to execute the query
_statement - The insert, update or delete statement string
_param - The parameter that are needed in the statement. Such a parameter replaces the ? in the sql statement string.
Returns:
false is returned in case the execution of the statement failed otherwise true is returned.