Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

public Class CurrentDatetime

extends Object
Class Inheritance
Imports
java.sql.Date, .Time, .Timestamp

CurrentDatetime provides execution support for ensuring that the current datetime is evaluated only once for a statement. The same value is returned for every CURRENT_DATE, CURRENT_TIME, and CURRENT_TIMESTAMP in the statement.

This is expected to be used by an activation and its result set, and so 'forget' must be called whenever you want to reuse the CurrentDatetime object for additional executions of the statement.

Field Summary

Modifier and TypeField and Description
private Date
currentDate

Holds the SQL DATE version of the current datetime.

private Date
currentDatetime

Holds the current datetime on the first evaluation of a current function in a statement, which contains all available fields.

private Time
currentTime

Holds the SQL TIME version of the current datetime.

private Timestamp
currentTimestamp

Holds the SQL TIMESTAMP version of the current datetime.

Constructor Summary

AccessConstructor and Description
public
CurrentDatetime()

The constructor is public; note we wait until evaluation to put any values into the fields.

Method Summary

Modifier and TypeMethod and Description
public void
forget()

This is called prior to each execution of the statement, to ensure that it starts over with a new current datetime value.

public Date
public Time
public Timestamp
private final void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentDateback to summary
private Date currentDate

Holds the SQL DATE version of the current datetime.

currentDatetimeback to summary
private Date currentDatetime

Holds the current datetime on the first evaluation of a current function in a statement, which contains all available fields.

currentTimeback to summary
private Time currentTime

Holds the SQL TIME version of the current datetime.

currentTimestampback to summary
private Timestamp currentTimestamp

Holds the SQL TIMESTAMP version of the current datetime.

Constructor Detail

CurrentDatetimeback to summary
public CurrentDatetime()

The constructor is public; note we wait until evaluation to put any values into the fields.

Method Detail

forgetback to summary
public void forget()

This is called prior to each execution of the statement, to ensure that it starts over with a new current datetime value.

getCurrentDateback to summary
public Date getCurrentDate()
getCurrentTimeback to summary
public Time getCurrentTime()
getCurrentTimestampback to summary
public Timestamp getCurrentTimestamp()
setCurrentDatetimeback to summary
private final void setCurrentDatetime()