com.altair.hwm.database.sql.protocol
Class DBBatchSQLReqPacket

java.lang.Object
  extended by com.altair.hwm.database.sql.protocol.DBBatchSQLReqPacket

public class DBBatchSQLReqPacket
extends java.lang.Object

Title: DBBatchSQLReqPacket

Description: This class represents the request packet sent to the server when more than one SQL cmd should be executed. This can be used to retrieve the auto id when data is inserted into a table.

Company: Altair Engineering, Inc.


Constructor Summary
DBBatchSQLReqPacket()
          Constructor
 
Method Summary
 void AddRequest(java.lang.String strQuery, java.util.Vector vectParams, int nReqType)
          Creates a DBSQLReqPacket for each request
 DBSQLReqPacket GetRequest(int nIndex)
          Get request at an index.
 int GetSize()
          Get number of request encapsulated.
 void ReadPacket(java.io.ObjectInputStream in)
          Reads this object from the input stream
 void RemoveRequest(int nIndex)
          Removes a request at an index.
 java.lang.String toString()
          Returns the string representation of this object
 void WritePacket(java.io.ObjectOutputStream out)
          Writes out this object to the output stream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DBBatchSQLReqPacket

public DBBatchSQLReqPacket()
Constructor

Method Detail

AddRequest

public void AddRequest(java.lang.String strQuery,
                       java.util.Vector vectParams,
                       int nReqType)
Creates a DBSQLReqPacket for each request

Parameters:
strQuery - The query to execute
vectParams - The vector of values for paramaters in a query
nReqType - The type of request

RemoveRequest

public void RemoveRequest(int nIndex)
Removes a request at an index.

Parameters:
nIndex - The index at which the req packet should be removed
Throws:
java.lang.Exception - If the index is out of bounds

GetRequest

public DBSQLReqPacket GetRequest(int nIndex)
                          throws java.lang.Exception
Get request at an index.

Returns:
DBSQLReqPacket The SQL request packet at the particular index
Throws:
java.lang.Exception - If the index is out of bounds

GetSize

public int GetSize()
Get number of request encapsulated.

Returns:
int The number of request in this packet

toString

public java.lang.String toString()
Returns the string representation of this object

Overrides:
toString in class java.lang.Object

WritePacket

public void WritePacket(java.io.ObjectOutputStream out)
                 throws java.io.IOException
Writes out this object to the output stream

Parameters:
out - The output stream
Throws:
java.io.IOException

ReadPacket

public void ReadPacket(java.io.ObjectInputStream in)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException
Reads this object from the input stream

Parameters:
in - The input stream
Throws:
java.io.IOException
java.lang.ClassNotFoundException