com.ibm.ims.base
Class DLIBaseSegment

java.lang.Object
  |
  +--com.ibm.ims.base.DLIBaseSegment
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
DLISegment, IMSFieldMessage

public abstract class DLIBaseSegment
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

DLIBaseSegment is the abstract base class for objects representing segments in a DL/I database. These DLIBaseSegment subclasses provide the mapping between the data in the segment and access functions on the class. To provide the mapping, the subclasses must register their DLITypeInfo with this class by providing it as the argument to the constructor. By doing so, the DLIBaseSegment class knows the layout of each segment in the database and can access as well as update each of the fields within a segment.

See Also:
Serialized Form

Field Summary
protected  byte[] ioArea
           
protected  int ioAreaLength
           
protected  int ioAreaOffset
           
 
Constructor Summary
protected DLIBaseSegment(java.lang.String segmentName, DLITypeInfo[] typeInfo, int length)
           
 
Method Summary
protected  void clearWarnings()
          Insert the method's description here.
 java.lang.Object clone()
          Creates a new object of the same class as this object.
 java.math.BigDecimal getBigDecimal(int index)
          Returns the field indicated by the index as a BigDecimal.
 java.math.BigDecimal getBigDecimal(int index, int scale)
          Returns the field indicated by the index as a BigDecimal.
 java.math.BigDecimal getBigDecimal(java.lang.String fieldName)
          Returns the field specified by the parameter as a BigDecimal.
 java.math.BigDecimal getBigDecimal(java.lang.String fieldName, int scale)
          Returns the field specified by the parameter as a BigDecimal.
 boolean getBoolean(int index)
          Returns the field indicated by the index as a boolean.
 boolean getBoolean(java.lang.String fieldName)
          Returns the field specified by the parameter as a boolean.
 byte getByte(int index)
          Returns the field indicated by the index as a byte.
 byte getByte(java.lang.String fieldName)
          Returns the field specified by the parameter as a byte.
 byte[] getBytes()
          Return the raw byte array that represents this segment.
 byte[] getBytes(int index)
          Returns the field indicated by the index "as is" (ie; the raw bytes of the field).
 byte[] getBytes(java.lang.String fieldName)
          Returns the field specified by the parameter "as is" (ie; the raw bytes of the field).
 java.sql.Date getDate(int index)
          Returns the field indicated by the index as a java.sql.Date object.
 java.sql.Date getDate(java.lang.String fieldName)
          Returns the field specified by the parameter as a java.sql.Date object.
 java.lang.String getDefaultEncoding()
          Returns the default character encoding for this segment.
 double getDouble(int index)
          Returns the field indicated by the index as a double.
 double getDouble(java.lang.String fieldName)
          Returns the field specified by the parameter as a double.
 float getFloat(int index)
          Returns the field indicated by the index as a float.
 float getFloat(java.lang.String fieldName)
          Returns the field specified by the parameter as a float.
 int getInt(int index)
          Returns the field indicated by the index as an int.
 int getInt(java.lang.String fieldName)
          Returns the field specified by the parameter as an int.
 long getLong(int index)
          Returns the field indicated by the index as a long.
 long getLong(java.lang.String fieldName)
          Returns the field specified by the parameter as a long.
 int getOffset()
          Returns the offset of the IO Area
 java.lang.String getSegmentName()
          Returns the name of the segment as stored in the database.
 short getShort(int index)
          Returns the field indicated by the index as a short.
 short getShort(java.lang.String fieldName)
          Returns the field specified by the parameter as a short.
 java.lang.String getString(int index)
          Returns the field indicated by the index as a String.
 java.lang.String getString(java.lang.String fieldName)
          Returns the field specified by the parameter as a String.
 java.sql.Time getTime(int index)
          Returns the field indicated by the index as a java.sql.Time object.
 java.sql.Time getTime(java.lang.String fieldName)
          Returns the field specified by the parameter as a java.sql.Time object.
 java.sql.Timestamp getTimestamp(int index)
          Returns the field indicated by the index as a java.sql.Timestamp object.
 java.sql.Timestamp getTimestamp(java.lang.String fieldName)
          Returns the field specified by the parameter as a java.sql.Timestamp object.
 DLITypeInfo[] getTypeInfo()
          Returns an array of the DLITypeInfo instances for this segment.
 DLITypeInfo getTypeInfo(int index)
          Returns the DLITypeInfo of the field specified by the index parameter.
 DLITypeInfo getTypeInfo(java.lang.String fieldName)
          Returns the DLITypeInfo of the field specified by the fieldName parameter.
protected  DLIWarning getWarnings()
          Insert the method's description here.
 void setBigDecimal(int index, java.math.BigDecimal value)
          Sets the field indicated by the index to the specified BigDecimal value.
 void setBigDecimal(java.lang.String fieldName, java.math.BigDecimal value)
          Sets the field indicated by the fieldName parameter to the specified BigDecimal value.
 void setBoolean(int index, boolean value)
          Sets the field indicated by the index to the specified boolean value.
 void setBoolean(java.lang.String fieldName, boolean value)
          Sets the field indicated by the fieldName parameter to the specified boolean value.
 void setByte(int index, byte value)
          Sets the field indicated by the index to the specified byte value.
 void setByte(java.lang.String fieldName, byte value)
          Sets the field indicated by the fieldName parameter to the specified byte value.
protected  void setBytes(byte[] value)
          Sets the field indicated by the index to the exact bytes passed in the array, with no conversion.
 void setBytes(int index, byte[] value)
          Sets the field indicated by the index to the exact bytes passed in the array, with no conversion.
 void setBytes(java.lang.String fieldName, byte[] value)
          Sets the field indicated by the fieldName parameter to the exact bytes passed in the array, with no conversion.
 void setDate(int index, java.sql.Date value)
          Sets the field indicated by the index to the specified Date value.
 void setDate(java.lang.String fieldName, java.sql.Date value)
          Sets the field indicated by the fieldName parameter to the specified Date value.
 void setDefaultEncoding(java.lang.String encoding)
          Sets the character encoding that all character data in the segment adheres to.
 void setDouble(int index, double value)
          Sets the field indicated by the index to the specified double value.
 void setDouble(java.lang.String fieldName, double value)
          Sets the field indicated by the fieldName parameter to the specified double value.
 void setFloat(int index, float value)
          Sets the field indicated by the index to the specified float value.
 void setFloat(java.lang.String fieldName, float value)
          Sets the field indicated by the index to the specified float value.
 void setInt(int index, int value)
          Sets the field indicated by the index to the specified int value.
 void setInt(java.lang.String fieldName, int value)
          Sets the field indicated by the fieldName parameter to the specified int value.
 void setLong(int index, long value)
          Sets the field indicated by the index to the specified long value.
 void setLong(java.lang.String fieldName, long value)
          Sets the field indicated by the fieldName parameter to the specified long value.
 void setShort(int index, short value)
          Sets the field indicated by the index to the specified short value.
 void setShort(java.lang.String fieldName, short value)
          Sets the field indicated by the fieldName parameter to the specified short value.
 void setString(int index, java.lang.String value)
          Sets the field indicated by the index to the specified String value.
 void setString(java.lang.String fieldName, java.lang.String value)
          Sets the field indicated by the fieldName parameter to the specified String value.
 void setTime(int index, java.sql.Time value)
          Sets the field indicated by the index to the specified Time value.
 void setTime(java.lang.String fieldName, java.sql.Time value)
          Sets the field indicated by the fieldName parameter to the specified Time value.
 void setTimestamp(int index, java.sql.Timestamp value)
          Sets the field indicated by the index to the specified Timestamp value.
 void setTimestamp(java.lang.String fieldName, java.sql.Timestamp value)
          Sets the field indicated by the fieldName parameter to the specified Timestamp value.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ioArea

protected byte[] ioArea

ioAreaOffset

protected int ioAreaOffset

ioAreaLength

protected int ioAreaLength
Constructor Detail

DLIBaseSegment

protected DLIBaseSegment(java.lang.String segmentName,
                         DLITypeInfo[] typeInfo,
                         int length)
Method Detail

clearWarnings

protected void clearWarnings()
Insert the method's description here. Creation date: (05/08/2000 1:05:55 PM)

clone

public java.lang.Object clone()
Creates a new object of the same class as this object. This method does not copy the type information so that all instances share the same field definitions.
Overrides:
clone in class java.lang.Object
Returns:
java.lang.Object

getBigDecimal

public java.math.BigDecimal getBigDecimal(int index)
                                   throws DLIException
Returns the field indicated by the index as a BigDecimal. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the one-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a BigDecimal
Throws:
DLIException - if the conversion cannot be done

getBigDecimal

public java.math.BigDecimal getBigDecimal(int index,
                                          int scale)
                                   throws DLIException
Returns the field indicated by the index as a BigDecimal. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the one-based index of the desired field in the DLITypeInfo array
scale - the number of digits to the right of the decimal
Returns:
the value of the field as a BigDecimal
Throws:
DLIException - if the conversion cannot be done

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String fieldName)
                                   throws DLIException
Returns the field specified by the parameter as a BigDecimal. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
BigDecimal the value of the field as a BigDecimal
Throws:
DLIException - if the field name is not found in the segment

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String fieldName,
                                          int scale)
                                   throws DLIException
Returns the field specified by the parameter as a BigDecimal. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
scale - the number of digits to the right of the decimal
Returns:
BigDecimal the value of the field as a BigDecimal
Throws:
DLIException - if the field name is not found in the segment

getBoolean

public boolean getBoolean(int index)
                   throws DLIException
Returns the field indicated by the index as a boolean. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a boolean
Throws:
DLIException - if the conversion cannot be done

getBoolean

public boolean getBoolean(java.lang.String fieldName)
                   throws DLIException
Returns the field specified by the parameter as a boolean. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
boolean the value of the field as a boolean
Throws:
DLIException - if the field name is not found in the segment

getByte

public byte getByte(int index)
             throws DLIException
Returns the field indicated by the index as a byte. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the one-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a byte
Throws:
DLIException - if the conversion cannot be done

getByte

public byte getByte(java.lang.String fieldName)
             throws DLIException
Returns the field specified by the parameter as a byte. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
byte the value of the field as a byte
Throws:
DLIException - if the field name is not found in the segment

getBytes

public byte[] getBytes()
Return the raw byte array that represents this segment.
Returns:
byte[]

getBytes

public byte[] getBytes(int index)
                throws DLIException
Returns the field indicated by the index "as is" (ie; the raw bytes of the field). The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
Returns:
the raw bytes of the field as an array of bytes
Throws:
DLIException - if the conversion cannot be done

getBytes

public byte[] getBytes(java.lang.String fieldName)
                throws DLIException
Returns the field specified by the parameter "as is" (ie; the raw bytes of the field). The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
byte[] the raw bytes of the field as a byte array
Throws:
DLIException - if the field name is not found in the segment

getDate

public java.sql.Date getDate(int index)
                      throws DLIException
Returns the field indicated by the index as a java.sql.Date object. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a java.sql.Date object
Throws:
DLIException - if the conversion cannot be done

getDate

public java.sql.Date getDate(java.lang.String fieldName)
                      throws DLIException
Returns the field specified by the parameter as a java.sql.Date object. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
Date the value of the field as a java.sql.Date object
Throws:
DLIException - if the field name is not found in the segment

getDefaultEncoding

public java.lang.String getDefaultEncoding()
Returns the default character encoding for this segment.
Returns:
java.lang.String

getDouble

public double getDouble(int index)
                 throws DLIException
Returns the field indicated by the index as a double. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a double
Throws:
DLIException - if the conversion cannot be done

getDouble

public double getDouble(java.lang.String fieldName)
                 throws DLIException
Returns the field specified by the parameter as a double. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
double the value of the field as a double
Throws:
DLIException - if the field name is not found in the segment

getFloat

public float getFloat(int index)
               throws DLIException
Returns the field indicated by the index as a float. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a float
Throws:
DLIException - if the conversion cannot be done

getFloat

public float getFloat(java.lang.String fieldName)
               throws DLIException
Returns the field specified by the parameter as a float. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
float the value of the field as a float
Throws:
DLIException - if the field name is not found in the segment

getInt

public int getInt(int index)
           throws DLIException
Returns the field indicated by the index as an int. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as an int
Throws:
DLIException - if the conversion cannot be done

getInt

public int getInt(java.lang.String fieldName)
           throws DLIException
Returns the field specified by the parameter as an int. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
int the value of the field as an int
Throws:
DLIException - if the field name is not found in the segment

getLong

public long getLong(int index)
             throws DLIException
Returns the field indicated by the index as a long. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a long
Throws:
DLIException - if the conversion cannot be done

getLong

public long getLong(java.lang.String fieldName)
             throws DLIException
Returns the field specified by the parameter as a long. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
long the value of the field as a long
Throws:
DLIException - if the field name is not found in the segment

getOffset

public int getOffset()
Returns the offset of the IO Area
Returns:
int

getSegmentName

public java.lang.String getSegmentName()
Returns the name of the segment as stored in the database.
Returns:
java.lang.String

getShort

public short getShort(int index)
               throws DLIException
Returns the field indicated by the index as a short. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a short
Throws:
DLIException - if the conversion cannot be done

getShort

public short getShort(java.lang.String fieldName)
               throws DLIException
Returns the field specified by the parameter as a short. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
short the value of the field as a short
Throws:
DLIException - if the field name is not found in the segment

getString

public java.lang.String getString(int index)
                           throws DLIException
Returns the field indicated by the index as a String. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a String
Throws:
DLIException - if the conversion cannot be done

getString

public java.lang.String getString(java.lang.String fieldName)
                           throws DLIException
Returns the field specified by the parameter as a String. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
String the value of the field as a String
Throws:
DLIException - if the field name is not found in the segment

getTime

public java.sql.Time getTime(int index)
                      throws DLIException
Returns the field indicated by the index as a java.sql.Time object. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a java.sql.Time object
Throws:
DLIException - if the conversion cannot be done

getTime

public java.sql.Time getTime(java.lang.String fieldName)
                      throws DLIException
Returns the field specified by the parameter as a java.sql.Time object. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
Time the value of the field as a java.sql.Time object
Throws:
DLIException - if the field name is not found in the segment

getTimestamp

public java.sql.Timestamp getTimestamp(int index)
                                throws DLIException
Returns the field indicated by the index as a java.sql.Timestamp object. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a java.sql.Timestamp object
Throws:
DLIException - if the conversion cannot be done

getTimestamp

public java.sql.Timestamp getTimestamp(java.lang.String fieldName)
                                throws DLIException
Returns the field specified by the parameter as a java.sql.Timestamp object. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
Returns:
Timestamp the value of the field as a java.sql.Timestamp object
Throws:
DLIException - if the field name is not found in the segment

getTypeInfo

public DLITypeInfo[] getTypeInfo()
Returns an array of the DLITypeInfo instances for this segment.
Returns:
DLITypeInfo[] the DLITypeInfo array

getTypeInfo

public DLITypeInfo getTypeInfo(int index)
Returns the DLITypeInfo of the field specified by the index parameter.
Parameters:
index - the 1-based index of the desired field
Returns:
DLITypeInfo the DLITypeInfo of the specified field

getTypeInfo

public DLITypeInfo getTypeInfo(java.lang.String fieldName)
                        throws DLIException
Returns the DLITypeInfo of the field specified by the fieldName parameter. The fieldName parameter is the name given to the field when it was registered with this class's constructor.
Parameters:
index - the zero-based index of the desired field
Returns:
DLITypeInfo the DLITypeInfo of the specified field
Throws:
DLIException - if the field does not exist

getWarnings

protected DLIWarning getWarnings()
Insert the method's description here. Creation date: (03/01/2000 9:49:30 AM)
Returns:
java.sql.SQLWarning

setBigDecimal

public void setBigDecimal(int index,
                          java.math.BigDecimal value)
                   throws DLIException
Sets the field indicated by the index to the specified BigDecimal value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if there is a conversion failure

setBigDecimal

public void setBigDecimal(java.lang.String fieldName,
                          java.math.BigDecimal value)
                   throws DLIException
Sets the field indicated by the fieldName parameter to the specified BigDecimal value. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the field name is not found in the segment or if there is a conversion failure

setBoolean

public void setBoolean(int index,
                       boolean value)
                throws DLIException
Sets the field indicated by the index to the specified boolean value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if there is a conversion failure

setBoolean

public void setBoolean(java.lang.String fieldName,
                       boolean value)
                throws DLIException
Sets the field indicated by the fieldName parameter to the specified boolean value. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the field name is not found in the segment or if there is a conversion failure

setByte

public void setByte(int index,
                    byte value)
             throws DLIException
Sets the field indicated by the index to the specified byte value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if there is a conversion failure

setByte

public void setByte(java.lang.String fieldName,
                    byte value)
             throws DLIException
Sets the field indicated by the fieldName parameter to the specified byte value. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the field name is not found in the segment or if there is a conversion failure

setBytes

protected void setBytes(byte[] value)
                 throws java.lang.IllegalArgumentException
Sets the field indicated by the index to the exact bytes passed in the array, with no conversion. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field

setBytes

public void setBytes(int index,
                     byte[] value)
              throws DLIException
Sets the field indicated by the index to the exact bytes passed in the array, with no conversion. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
java.lang.NumberFormatException - if the length of the byte array is not equal to the length of the field as defined in the DLITypeInfo

setBytes

public void setBytes(java.lang.String fieldName,
                     byte[] value)
              throws DLIException
Sets the field indicated by the fieldName parameter to the exact bytes passed in the array, with no conversion. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
java.lang.NumberFormatException - if the length of the byte array is not equal to the length of the field as defined in the DLITypeInfo
DLIException - if the field name is not found in the segment

setDate

public void setDate(int index,
                    java.sql.Date value)
             throws DLIException
Sets the field indicated by the index to the specified Date value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the encoding scheme for the Date when it is formatted to a String is not supported or if there is a conversion failure

setDate

public void setDate(java.lang.String fieldName,
                    java.sql.Date value)
             throws DLIException
Sets the field indicated by the fieldName parameter to the specified Date value. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the encoding scheme for the Date when it is formatted to a String is not supported, if the field name is not found in the segment, or if there is a conversion failure

setDefaultEncoding

public void setDefaultEncoding(java.lang.String encoding)
Sets the character encoding that all character data in the segment adheres to. This encoding can also be overridden on a per field basis.
Parameters:
encoding - the character encoding
See Also:
DLITypeInfo

setDouble

public void setDouble(int index,
                      double value)
               throws DLIException
Sets the field indicated by the index to the specified double value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if there is a conversion failure

setDouble

public void setDouble(java.lang.String fieldName,
                      double value)
               throws DLIException
Sets the field indicated by the fieldName parameter to the specified double value. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the field name is not found in the segment or there is a conversion failure

setFloat

public void setFloat(int index,
                     float value)
              throws DLIException
Sets the field indicated by the index to the specified float value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if there is a conversion failure

setFloat

public void setFloat(java.lang.String fieldName,
                     float value)
              throws DLIException
Sets the field indicated by the index to the specified float value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the field name is not found in the segment or there is a conversion failure

setInt

public void setInt(int index,
                   int value)
            throws DLIException
Sets the field indicated by the index to the specified int value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if there is a conversion failure

setInt

public void setInt(java.lang.String fieldName,
                   int value)
            throws DLIException
Sets the field indicated by the fieldName parameter to the specified int value. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the field name is not found in the segment or if there is a conversion failure

setLong

public void setLong(int index,
                    long value)
             throws DLIException
Sets the field indicated by the index to the specified long value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if there is a conversion failure

setLong

public void setLong(java.lang.String fieldName,
                    long value)
             throws DLIException
Sets the field indicated by the fieldName parameter to the specified long value. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the field name is not found in the segment or if there is a conversion failure

setShort

public void setShort(int index,
                     short value)
              throws DLIException
Sets the field indicated by the index to the specified short value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if there is a conversion failure

setShort

public void setShort(java.lang.String fieldName,
                     short value)
              throws DLIException
Sets the field indicated by the fieldName parameter to the specified short value. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the field name is not found in the segment or if there is a conversion failure

setString

public void setString(int index,
                      java.lang.String value)
               throws DLIException
Sets the field indicated by the index to the specified String value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the encoding scheme is not supported or if there is a conversion failure

setString

public void setString(java.lang.String fieldName,
                      java.lang.String value)
               throws DLIException
Sets the field indicated by the fieldName parameter to the specified String value. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the field name is not found in the segment, if the encoding scheme is not supported, or if there is a conversion failure

setTime

public void setTime(int index,
                    java.sql.Time value)
             throws DLIException
Sets the field indicated by the index to the specified Time value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the encoding scheme for the Time when it is formatted to a String is not supported or if there is a conversion failure

setTime

public void setTime(java.lang.String fieldName,
                    java.sql.Time value)
             throws DLIException
Sets the field indicated by the fieldName parameter to the specified Time value. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the encoding scheme for the Time when it is formatted to a String is not supported, if the field name is not found in the segment, or if there is a conversion failure

setTimestamp

public void setTimestamp(int index,
                         java.sql.Timestamp value)
                  throws DLIException
Sets the field indicated by the index to the specified Timestamp value. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the encoding scheme for the Timestamp when it is formatted to a String is not supported or if there is a conversion failure

setTimestamp

public void setTimestamp(java.lang.String fieldName,
                         java.sql.Timestamp value)
                  throws DLIException
Sets the field indicated by the fieldName parameter to the specified Timestamp value. The fieldName parameter is the name of the field as it was registered in the DLITypeInfo array. The index is zero based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 0, the second index 1, and so on.
Parameters:
fieldName - the name of the field as registered in the DLITypeInfo array
value - the new value for the field
Throws:
DLIException - if the encoding scheme for the Timestamp when it is formatted to a String is not supported, if the field name is not found in the segment, or if there is a conversion failure


(C) International Business Machines Corporation 2004. All rights reserved.