Class CurrentDatetime
java.lang.Object
org.apache.derby.impl.sql.execute.CurrentDatetime
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
FieldsModifier and TypeFieldDescriptionprivate Date
Holds the SQL DATE version of the current datetime.private Date
Holds the current datetime on the first evaluation of a current function in a statement, which contains all available fields.private Time
Holds the SQL TIME version of the current datetime.private Timestamp
Holds the SQL TIMESTAMP version of the current datetime. -
Constructor Summary
ConstructorsConstructorDescriptionThe constructor is public; note we wait until evaluation to put any values into the fields. -
Method Summary
Modifier and TypeMethodDescriptionvoid
forget()
This is called prior to each execution of the statement, to ensure that it starts over with a new current datetime value.private final void
-
Field Details
-
currentDatetime
Holds the current datetime on the first evaluation of a current function in a statement, which contains all available fields. -
currentDate
Holds the SQL DATE version of the current datetime. -
currentTime
Holds the SQL TIME version of the current datetime. -
currentTimestamp
Holds the SQL TIMESTAMP version of the current datetime.
-
-
Constructor Details
-
CurrentDatetime
public CurrentDatetime()The constructor is public; note we wait until evaluation to put any values into the fields.
-
-
Method Details
-
setCurrentDatetime
private final void setCurrentDatetime() -
getCurrentDate
-
getCurrentTime
-
getCurrentTimestamp
-
forget
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.
-