com.ibm.as400.access

Class DateFieldDescription

  • All Implemented Interfaces:
    Serializable


    public class DateFieldDescription
    extends FieldDescription
    implements Serializable
    Represents the description of the data in a date field. It allows:
    • The user to describe a date field to the RecordFormat object.
    • The RecordFormat object to describe a date field to the user.
    Click hereto see an example.
    See Also:
    Serialized Form
    • Constructor Detail

      • DateFieldDescription

        public DateFieldDescription()
        Constructs a DateFieldDescription object.
      • DateFieldDescription

        public DateFieldDescription(AS400Text dataType,
                            String name)
        Constructs a DateFieldDescription object. It uses the specified data type and name of the field. The length of the field will be the length specified on the AS400Text object.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
      • DateFieldDescription

        public DateFieldDescription(AS400Text dataType,
                            String name,
                            String ddsName)
        Constructs a DateFieldDescription object. It uses the specified data type, name, and DDS name of the field.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
        ddsName - The DDS name of this field. This is the name of the field as it would appear in a DDS description of the field. The length of ddsName must be 10 characters or less.
      • DateFieldDescription

        public DateFieldDescription(AS400Date dataType,
                            String name)
        Constructs a DateFieldDescription object. It uses the specified data type and name of the field. The length of the field will be the length reported by the AS400Date object.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
      • DateFieldDescription

        public DateFieldDescription(AS400Date dataType,
                            String name,
                            String ddsName)
        Constructs a DateFieldDescription object. It uses the specified data type, name, and DDS name of the field.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
        ddsName - The DDS name of this field. This is the name of the field as it would appear in a DDS description of the field. The length of ddsName must be 10 characters or less.

    • Method Detail

      • getDATFMT

        public String getDATFMT()
        Returns the value specified for the DATFMT keyword for this field.
        Returns:
        The value specified for DATFMT for this field. If DATFMT was not specified for this field, an empty string is returned.
      • getDATSEP

        public String getDATSEP()
        Returns the value specified for the DATSEP keyword for this field.
        Returns:
        The value specified for DATSEP for this field. If DATSEP was not specified for this field, an empty string is returned.
      • setDataType

        public void setDataType(AS400Text dataType)
        Sets the AS400DataType object describing this field.
        Parameters:
        dataType - The AS400DataType that describes this field. The dataType cannot be null.
      • setDataType

        public void setDataType(AS400Date dataType)
        Sets the AS400DataType object describing this field.
        Parameters:
        dataType - The AS400DataType that describes this field. The dataType cannot be null.
      • setDATFMT

        public void setDATFMT(String dateFormat)
        Sets the value to specify for the DATFMT keyword for this field.
        Parameters:
        dateFormat - The value to specify for DATFMT for this field. The dateFormat cannot be null.
      • setDATSEP

        public void setDATSEP(String separator)
        Sets the value to specify for the DATSEP keyword for this field.
        Parameters:
        separator - The value to specify for DATSEP for this field. A null value indicates "no separator".
      • setDFT

        public void setDFT(String defaultValue)
        Sets the value for the DFT keyword for this field.
        Parameters:
        defaultValue - The default value for this field. The defaultValuecannot be null. To set a default value of *NULL, use the setDFTNull() method.
      • setDFTCurrent

        public void setDFTCurrent()
        Sets the default value for this field to be the current date. Calling this method will replace the DFT keyword that was previously set on a call to setDFT(String) or setDFTNull().
      • setDFTNull

        public void setDFTNull()
        Sets the value for the DFT keyword to be *NULL for this field. Calling this method will replace the DFT keyword that was previously set on a call to setDFT(String) or setDFTCurrent(). Note: This field must also have its ALWNULL keyword set to true to prevent DDS errors.