|
|||||||||
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 jet.connect.DbDate
public class DbDate
The DbDate
class wraps a value of primitive type long
in an object. An object of the type DbDate
contains a single
field whose type is long
.
In addition, this class provides several methods for the interconversion of
a DbDate
and a String
,
as well as other constants and methods used when dealing
with a DbDate
.
Field Summary |
---|
Fields inherited from class jet.connect.DbDateTime |
---|
value |
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 | |
---|---|
DbDate()
Constructs an uninitialized DbDate . |
|
DbDate(java.sql.Date dt)
Constructs an uninitialized DbDate . |
|
DbDate(DbColDesc desc)
Constructs an uninitialized DbDate . |
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates a clone of this DbDate object. |
java.sql.Date |
getDate()
Returns a java.sql.Date object using the milliseconds
time value. |
void |
set(JRHierarchicalDataset hds,
int col)
Sets a newly allocated DbDate object that
represents the long value indicated by the
JRHierarchicalDataset parameter and an index of the column. |
void |
set(java.sql.ResultSet rs,
int col)
Sets a newly allocated DbDate object that
represents the long value indicated by the
ResultSet parameter and an index of the column. |
void |
setDate(java.sql.Date v)
Sets an existing Date object
using the given milliseconds date value. |
void |
setValue(java.lang.String v)
Sets a newly allocated DbDate object that
represents the String value indicated by the
String parameter. |
java.lang.String |
toString()
Returns a String object representing this
DbDate 's value. |
Methods inherited from class jet.connect.DbDateTime |
---|
compareTo, equals, get, set, set, toFormatString, toSqlDate, toStringValue, toUtilDate |
Methods inherited from class jet.connect.DbValue |
---|
compareTo, compareTo, equals, getColDesc, getPrecision, getScale, getSqlType, isCurrency, isNull, makeDbValue, setColDesc, setfoo, setNull, setValue |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DbDate()
DbDate
. This
DbDate
object is mutable until the value and the description of the column are set.
public DbDate(java.sql.Date dt)
DbDate
. This
DbDate
object is mutable until DbColDesc is set.
dt
- The value holding a java.sql.Date
object.public DbDate(DbColDesc desc)
DbDate
. This
DbDate
object is mutable until the value is set.
desc
- The value to be represented by the
DbColDesc
object.Method Detail |
---|
public final java.sql.Date getDate()
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 final void setDate(java.sql.Date v)
Date
object
using the given milliseconds date value.
It uses Date.getTime() to retrieve value.
v
- The valid date value.public void set(java.sql.ResultSet rs, int col) throws java.sql.SQLException
DbDate
object that
represents the long
value indicated by the
ResultSet
parameter and an index of the column.
set
in class DbValue
rs
- The ResultSet
to be fetched.col
- The index of the column.
java.sql.SQLException
- if the ResultSet
does not
contain the index.public void set(JRHierarchicalDataset hds, int col) throws java.sql.SQLException
DbDate
object that
represents the long
value indicated by the
JRHierarchicalDataset
parameter and an index of the column.
set
in class DbValue
hds
- The JRHierarchicalDataset
to be fetched.col
- The index of the column.
java.sql.SQLException
- if the ResultSet
does not
contain the index.public java.lang.String toString()
String
object representing this
DbDate
's value. The value is returned as a string.
If the value is null, it returns "NULL".
toString
in class DbValue
public java.lang.Object clone()
DbDate
object.
clone
in interface jet.util.DbValueable
clone
in class DbValue
public void setValue(java.lang.String v)
DbDate
object that
represents the String
value indicated by the
String
parameter.
setValue
in class DbValue
v
- The String
to be converted to a
DbDate
. The String
object represents a date
in the format "yyyy-[m]m-[d]d". The leading zero for mm
and dd
may also be omitted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |