Package com.nt.udc.db
Class SqlCmdSet
java.lang.Object
com.nt.udc.db.SqlCmdSet
- All Implemented Interfaces:
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
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method allows you to add a single command to the command set.String[]
This method will return the complete command set as an array of strings.int
Method will give the actual number of commands in the command set.void
This method allows you to set the entire command set at once as an array of individual SQL commands.int
size()
Method will give the size of the command set (not necessarily the number of commands included in it).
-
Constructor Details
-
SqlCmdSet
public SqlCmdSet()Empty constructor, will initialize a zero length set of commands. -
SqlCmdSet
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 Details
-
add
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
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
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.- Returns:
- The number of commands in the command set.
-