appli.sqlplayer.util
Class Sqlcmd

java.lang.Object
  extended byappli.sqlplayer.util.Sqlcmd

public class Sqlcmd
extends java.lang.Object

Defines an SQL command.

Version:
1.0 June 2003 1.1 July 2003 (SJ) : ajout methode getParams()
Author:
Marc Wenger/CDS

Field Summary
(package private)  java.lang.String category
           
(package private)  java.lang.String description
           
(package private)  java.lang.String name
           
(package private)  SortedHashMap params
           
(package private)  java.lang.String sqlcommand
           
 
Constructor Summary
Sqlcmd(java.lang.String name)
           
 
Method Summary
 void addParam(java.lang.String name, java.lang.String descr)
          Add a sql parameter to the sql command object
 java.lang.String generate(java.util.Hashtable params)
          Generates an SQL command.
 java.lang.String generate(java.lang.String[] params)
          Generates an SQL command.
 java.lang.String getCategory()
           
 java.lang.String getCommand()
           
 java.lang.String getDescription()
           
 java.lang.String getName()
           
 SqlcmdParam getParam(java.lang.String name)
           
 int getParamNumber()
           
 SortedHashMap getParams()
           
 void setCategory(java.lang.String category)
           
 void setCommand(java.lang.String command)
           
 void setDescription(java.lang.String descr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

java.lang.String name

description

java.lang.String description

category

java.lang.String category

sqlcommand

java.lang.String sqlcommand

params

SortedHashMap params
Constructor Detail

Sqlcmd

public Sqlcmd(java.lang.String name)
Method Detail

setDescription

public void setDescription(java.lang.String descr)

setCategory

public void setCategory(java.lang.String category)

setCommand

public void setCommand(java.lang.String command)

getName

public java.lang.String getName()

getCategory

public java.lang.String getCategory()

getDescription

public java.lang.String getDescription()

getParamNumber

public int getParamNumber()

getCommand

public java.lang.String getCommand()

addParam

public void addParam(java.lang.String name,
                     java.lang.String descr)
Add a sql parameter to the sql command object

Parameters:
name - name of the parameter
descr - description string

getParams

public SortedHashMap getParams()

getParam

public SqlcmdParam getParam(java.lang.String name)

generate

public java.lang.String generate(java.lang.String[] params)
Generates an SQL command.

Parameters:
params - array of the parameters. Each parameter occupies two consecutive strings containing the parameter name and its value. The array size must be an even number
Returns:
the sql command

generate

public java.lang.String generate(java.util.Hashtable params)
Generates an SQL command.

Parameters:
params - Hashtable containing the parameters
Returns:
the sql command