public class SqlCmdSet
extends java.lang.Object
implements java.io.Serializable
Title: SQL Command Set
Description: This class is for holding sets of SQL commands necessary to
complete a single SQL transaction. As an example, to completely insert a
single object into a relational database, it may actually require inserts
into multiple tables before the "transaction" is complete. The methods for
putting SQL commands into this object do no checking to verify that the
Strings contain valid SQL.
Copyright: Copyright (c) 2001
Company: Nortel Networks
Empty constructor, will initialize a zero length set of commands.
SqlCmdSet
public SqlCmdSet(java.lang.String cmd)
This constructor will create a command set with a single SQL statement.
Parameters:
cmd - A single SQL statement.
SqlCmdSet
public SqlCmdSet(int len)
This constructor will initialize the command set to be a specific size.
Parameters:
len - The length the command set should be initialized to.
Method Detail
add
public void add(java.lang.String cmd)
This method allows you to add a single command to the command set.
The method will check sequentially to see if there is already a vacancy.
If there is not, it will grow the command set by one and then append the
command.
Parameters:
cmd - A single SQL command that should be added to the set.
set
public void set(java.lang.String[] cmds)
This method allows you to set the entire command set at once as an array
of individual SQL commands. This will overwrite
anything already added to the command set.
Parameters:
cmds - A String array of commands.
getCommandSet
public java.lang.String[] getCommandSet()
This method will return the complete command set as an array of strings.
Each String should represent a single SQL command. The commands will be
ordered the same as they were entered. This should represent the order
the transaction should be.
Returns:
This represents the entire command set as an array of String
size
public int size()
Method will give the size of the command set (not necessarily the number
of commands included in it).
Returns:
The absolute size of the command set.
numberOfCommands
public int numberOfCommands()
Method will give the actual number of commands in the command set.