Interface DateTimeDataValue

All Superinterfaces:
DataValueDescriptor, Externalizable, Formatable, Orderable, Serializable, Storable, TypedFormat
All Known Implementing Classes:
SQLDate, SQLTime, SQLTimestamp

public interface DateTimeDataValue extends DataValueDescriptor
  • Field Details

  • Method Details

    • getYear

      Get the year number out of a date.
      Parameters:
      result - The result of the previous call to this method, null if not called yet.
      Returns:
      A NumberDataValue containing the year number.
      Throws:
      StandardException - Thrown on error
    • getMonth

      Get the month number out of a date.
      Parameters:
      result - The result of the previous call to this method, null if not called yet.
      Returns:
      A NumberDataValue containing the month number.
      Throws:
      StandardException - Thrown on error
    • getDate

      Get the day of the month.
      Parameters:
      result - The result of the previous call to this method, null if not called yet.
      Returns:
      A NumberDataValue containing the day of the month.
      Throws:
      StandardException - Thrown on error
    • getHours

      Get the hour of the day out of a time or timestamp.
      Parameters:
      result - The result of the previous call to this method, null if not called yet.
      Returns:
      A NumberDataValue containing the hour of the day.
      Throws:
      StandardException - Thrown on error
    • getMinutes

      Get the minute of the hour out of a time or timestamp.
      Parameters:
      result - The result of the previous call to this method, null if not called yet.
      Returns:
      A NumberDataValue containing the minute of the hour.
      Throws:
      StandardException - Thrown on error
    • getSeconds

      Get the second of the minute out of a time or timestamp.
      Parameters:
      result - The result of the previous call to this method, null if not called yet.
      Returns:
      A NumberDataValue containing the second of the minute.
      Throws:
      StandardException - Thrown on error
    • timestampAdd

      DateTimeDataValue timestampAdd(int intervalType, NumberDataValue intervalCount, Date currentDate, DateTimeDataValue resultHolder) throws StandardException
      Add a number of intervals to a datetime value. Implements the JDBC escape TIMESTAMPADD function.
      Parameters:
      intervalType - One of FRAC_SECOND_INTERVAL, SECOND_INTERVAL, MINUTE_INTERVAL, HOUR_INTERVAL, DAY_INTERVAL, WEEK_INTERVAL, MONTH_INTERVAL, QUARTER_INTERVAL, or YEAR_INTERVAL
      intervalCount - The number of intervals to add
      currentDate - Used to convert time to timestamp
      resultHolder - If non-null a DateTimeDataValue that can be used to hold the result. If null then generate a new holder
      Returns:
      startTime + intervalCount intervals, as a timestamp
      Throws:
      StandardException
    • timestampDiff

      NumberDataValue timestampDiff(int intervalType, DateTimeDataValue time1, Date currentDate, NumberDataValue resultHolder) throws StandardException
      Finds the difference between two datetime values as a number of intervals. Implements the JDBC TIMESTAMPDIFF escape function.
      Parameters:
      intervalType - One of FRAC_SECOND_INTERVAL, SECOND_INTERVAL, MINUTE_INTERVAL, HOUR_INTERVAL, DAY_INTERVAL, WEEK_INTERVAL, MONTH_INTERVAL, QUARTER_INTERVAL, or YEAR_INTERVAL
      time1 -
      currentDate - Used to convert time to timestamp
      resultHolder - If non-null a DateTimeDataValue that can be used to hold the result. If null then generate a new holder
      Returns:
      the number of intervals by which this datetime is greater than time1
      Throws:
      StandardException