Top Fields Methods
org.apache.derby.iapi.types

public Interface DateTimeDataValue

extends DataValueDescriptor
Known Direct Implementers
org.apache.derby.iapi.types.SQLDate, org.apache.derby.iapi.types.SQLTime, org.apache.derby.iapi.types.SQLTimestamp
Imports
org.apache.derby.shared.common.error.StandardException

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
Inherited from org.apache.derby.iapi.types.DataValueDescriptor:
UNKNOWN_LOGICAL_LENGTH

Method Summary

Modifier and TypeMethod and Description
public NumberDataValue

Returns:

A NumberDataValue containing the day of the month.
getDate
(NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

Get the day of the month.

public NumberDataValue

Returns:

A NumberDataValue containing the hour of the day.
getHours
(NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

Get the hour of the day out of a time or timestamp.

public NumberDataValue

Returns:

A NumberDataValue containing the minute of the hour.
getMinutes
(NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

Get the minute of the hour out of a time or timestamp.

public NumberDataValue

Returns:

A NumberDataValue containing the month number.
getMonth
(NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

Get the month number out of a date.

public NumberDataValue

Returns:

A NumberDataValue containing the second of the minute.
getSeconds
(NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

Get the second of the minute out of a time or timestamp.

public NumberDataValue

Returns:

A NumberDataValue containing the year number.
getYear
(NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

Get the year number out of a date.

public DateTimeDataValue

Returns:

startTime + intervalCount intervals, as a timestamp
timestampAdd
(int
One of FRAC_SECOND_INTERVAL, SECOND_INTERVAL, MINUTE_INTERVAL, HOUR_INTERVAL, DAY_INTERVAL, WEEK_INTERVAL, MONTH_INTERVAL, QUARTER_INTERVAL, or YEAR_INTERVAL
intervalType
,
NumberDataValue
The number of intervals to add
intervalCount
,
Date
Used to convert time to timestamp
currentDate
,
DateTimeDataValue
If non-null a DateTimeDataValue that can be used to hold the result. If null then generate a new holder
resultHolder
)

Add a number of intervals to a datetime value.

public NumberDataValue

Returns:

the number of intervals by which this datetime is greater than time1
timestampDiff
(int
One of FRAC_SECOND_INTERVAL, SECOND_INTERVAL, MINUTE_INTERVAL, HOUR_INTERVAL, DAY_INTERVAL, WEEK_INTERVAL, MONTH_INTERVAL, QUARTER_INTERVAL, or YEAR_INTERVAL
intervalType
,
DateTimeDataValue time1, Date
Used to convert time to timestamp
currentDate
,
NumberDataValue
If non-null a DateTimeDataValue that can be used to hold the result. If null then generate a new holder
resultHolder
)

Finds the difference between two datetime values as a number of intervals.

Inherited from org.apache.derby.iapi.types.DataValueDescriptor:
checkHostVariablecloneHoldercloneValuecoalescecomparecomparecomparecompareequalsestimateMemoryUsagegetBooleangetBytegetBytesgetDategetDoublegetFloatgetIntgetLengthgetLonggetNewNullgetObjectgetShortgetStreamgetStringgetTimegetTimestampgetTraceStringgetTypeNamegreaterOrEqualsgreaterThanhasStreaminisNotNullisNullOplessOrEqualslessThannormalizenotEqualsreadExternalFromArrayrecyclesetBigDecimalsetIntosetIntosetObjectForCastsetToNullsetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValueFromResultSettypePrecedencetypeToBigDecimal

Field Detail

DAY_FIELDback to summary
public static final int DAY_FIELD
DAY_INTERVALback to summary
public static final int DAY_INTERVAL
FRAC_SECOND_INTERVALback to summary
public static final int FRAC_SECOND_INTERVAL
HOUR_FIELDback to summary
public static final int HOUR_FIELD
HOUR_INTERVALback to summary
public static final int HOUR_INTERVAL
MINUTE_FIELDback to summary
public static final int MINUTE_FIELD
MINUTE_INTERVALback to summary
public static final int MINUTE_INTERVAL
MONTH_FIELDback to summary
public static final int MONTH_FIELD
MONTH_INTERVALback to summary
public static final int MONTH_INTERVAL
QUARTER_INTERVALback to summary
public static final int QUARTER_INTERVAL
SECOND_FIELDback to summary
public static final int SECOND_FIELD
SECOND_INTERVALback to summary
public static final int SECOND_INTERVAL
WEEK_INTERVALback to summary
public static final int WEEK_INTERVAL
YEAR_FIELDback to summary
public static final int YEAR_FIELD
YEAR_INTERVALback to summary
public static final int YEAR_INTERVAL

Method Detail

getDateback to summary
public NumberDataValue getDate(NumberDataValue result) throws StandardException

Get the day of the month.

Parameters
result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

A NumberDataValue containing the day of the month.

Exceptions
StandardException:
Thrown on error
getHoursback to summary
public NumberDataValue getHours(NumberDataValue result) throws StandardException

Get the hour of the day out of a time or timestamp.

Parameters
result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

A NumberDataValue containing the hour of the day.

Exceptions
StandardException:
Thrown on error
getMinutesback to summary
public NumberDataValue getMinutes(NumberDataValue result) throws StandardException

Get the minute of the hour out of a time or timestamp.

Parameters
result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

A NumberDataValue containing the minute of the hour.

Exceptions
StandardException:
Thrown on error
getMonthback to summary
public NumberDataValue getMonth(NumberDataValue result) throws StandardException

Get the month number out of a date.

Parameters
result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

A NumberDataValue containing the month number.

Exceptions
StandardException:
Thrown on error
getSecondsback to summary
public NumberDataValue getSeconds(NumberDataValue result) throws StandardException

Get the second of the minute out of a time or timestamp.

Parameters
result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

A NumberDataValue containing the second of the minute.

Exceptions
StandardException:
Thrown on error
getYearback to summary
public NumberDataValue getYear(NumberDataValue result) throws StandardException

Get the year number out of a date.

Parameters
result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

A NumberDataValue containing the year number.

Exceptions
StandardException:
Thrown on error
timestampAddback to summary
public 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:int

One of FRAC_SECOND_INTERVAL, SECOND_INTERVAL, MINUTE_INTERVAL, HOUR_INTERVAL, DAY_INTERVAL, WEEK_INTERVAL, MONTH_INTERVAL, QUARTER_INTERVAL, or YEAR_INTERVAL

intervalCount:NumberDataValue

The number of intervals to add

currentDate:Date

Used to convert time to timestamp

resultHolder:DateTimeDataValue

If non-null a DateTimeDataValue that can be used to hold the result. If null then generate a new holder

Returns:DateTimeDataValue

startTime + intervalCount intervals, as a timestamp

timestampDiffback to summary
public 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:int

One of FRAC_SECOND_INTERVAL, SECOND_INTERVAL, MINUTE_INTERVAL, HOUR_INTERVAL, DAY_INTERVAL, WEEK_INTERVAL, MONTH_INTERVAL, QUARTER_INTERVAL, or YEAR_INTERVAL

currentDate:Date

Used to convert time to timestamp

resultHolder:NumberDataValue

If non-null a DateTimeDataValue that can be used to hold the result. If null then generate a new holder

Returns:NumberDataValue

the number of intervals by which this datetime is greater than time1