|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jet.connect.DbValue jet.connect.DbDateTime
public abstract class DbDateTime
The super class of DbDate, DbTime, and DbTimestamp.
A thin wrapper around a millisecond value allows
JDBC to identify it as an SQL DATE
value. A
milliseconds value represents the number of that milliseconds that
have passed since January 1, 1970 00:00:00.000 GMT.
Note that this class should not be initialized directly.
Field Summary | |
---|---|
long |
value
Deprecated. |
Fields inherited from class jet.connect.DbValue |
---|
bNull, CHAR_DESC, CURRENCY_DESC, DATE_DESC, desc, DOUBLE_DESC, INTEGER_DESC, TIME_DESC |
Fields inherited from interface jet.util.DbValueable |
---|
EQUAL, GREATER, LESS |
Constructor Summary | |
---|---|
DbDateTime()
Constructs an uninitialized DbDateTime . |
|
DbDateTime(DbColDesc desc)
Constructs an uninitialized DbDateTime . |
Method Summary | |
---|---|
int |
compareTo(DbValue v)
Compares this DbDateTime object with the DbValue object. |
boolean |
equals(DbValue v)
Compares this object to the specified object. |
long |
get()
Returns the value of this DbDateTime as a
long value. |
void |
set(DbValue v)
Sets a newly allocated DbDateTime object that
represents the long value indicated by the
DbValue parameter. |
void |
set(long v)
Sets a newly allocated DbDateTime object that
represents the specified long argument. |
java.lang.String |
toFormatString(java.lang.String pattern)
Uses java.text.SimpleDateFormat for formatting
dates in a locale-sensitive manner. |
java.util.Date |
toSqlDate()
Returns a java.sql.Date object using the milliseconds
time value. |
java.lang.String |
toStringValue()
|
java.util.Date |
toUtilDate()
Returns a java.util.Date object and initializes it to
represent the specified number of milliseconds since the
standard base time known as "the epoch", namely January 1,
1970, 00:00:00 GMT. |
Methods inherited from class jet.connect.DbValue |
---|
clone, compareTo, compareTo, equals, getColDesc, getPrecision, getScale, getSqlType, isCurrency, isNull, makeDbValue, set, set, setColDesc, setfoo, setNull, setValue, setValue, toString |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public long value
get
and set
to access it instead of accessing it directly.
Constructor Detail |
---|
public DbDateTime()
DbDateTime
. This
DbDateTime object is mutable until the value and the description of the column are set.
public DbDateTime(DbColDesc desc)
DbDateTime
. This
DbDateTime
object is mutable until the value is set.
desc
- The value to be represented by the
DbColDesc
object.Method Detail |
---|
public long get()
DbDateTime
as a
long
value.
public void set(long v)
DbDateTime
object that
represents the specified long
argument.
v
- Milliseconds since January 1, 1970, 00:00:00 GMT, not
exceeding the milliseconds representation for the year 8099.
A negative number indicates the number of milliseconds
before January 1, 1970, 00:00:00 GMT.public java.util.Date toUtilDate()
java.util.Date
object and initializes it to
represent the specified number of milliseconds since the
standard base time known as "the epoch", namely January 1,
1970, 00:00:00 GMT.
public java.util.Date toSqlDate()
java.sql.Date
object using the milliseconds
time value. If the milliseconds value contains time
information, this method will return the time component to the
time in the default time zone (the time zone of the Java virtual
machine running the application) that corresponds to zero GMT.
public java.lang.String toFormatString(java.lang.String pattern)
java.text.SimpleDateFormat
for formatting
dates in a locale-sensitive manner.
pattern
- The string is defined in java.text.SimpleDateFormat.
Date and Time Pattern Result "yyyy.MM.dd G 'at' HH:mm:ss z"
2001.07.04 AD at 12:08:56 PDT
"EEE, MMM d, ''yy"
Wed, Jul 4, '01
"h:mm a"
12:08 PM
"hh 'o''clock' a, zzzz"
12 o'clock PM, Pacific Daylight Time
"K:mm a, z"
0:08 PM, PDT
"yyyyy.MMMMM.dd GGG hh:mm aaa"
02001.July.04 AD 12:08 PM
"EEE, d MMM yyyy HH:mm:ss Z"
Wed, 4 Jul 2001 12:08:56 -0700
"yyMMddHHmmssZ"
010704120856-0700
"yyyy-MM-dd'T'HH:mm:ss.SSSZ"
2001-07-04T12:08:56.235-0700
"yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
2001-07-04T12:08:56.235-07:00
"YYYY-'W'ww-u"
2001-W27-3
SimpleDateFormat
public boolean equals(DbValue v)
true
if and only if the argument is not
null
but a DbDateTime
object that
contains the same long
value as this object.
equals
in class DbValue
v
- The DbValue object to be compared with.
true
if the objects are the same;
false
otherwise.public int compareTo(DbValue v)
DbDateTime
object with the DbValue object.
compareTo
in class DbValue
DbValueable
public void set(DbValue v)
DbDateTime
object that
represents the long
value indicated by the
DbValue
parameter. The DbValue object will be checked to see if it is null.
set
in class DbValue
v
- The DbValue
to be converted to a
DbChar
. If it is null, the value will not be set.public java.lang.String toStringValue()
toStringValue
in class DbValue
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |