superwaba.ext.xplat.sql
Class Timestamp

java.lang.Object
  |
  +--superwaba.ext.xplat.sql.Date
        |
        +--superwaba.ext.xplat.sql.Time
              |
              +--superwaba.ext.xplat.sql.Timestamp

public class Timestamp
extends Time

This class allows the driver to identify the value as a SQL Timestamp. Please note that the JDBC specifies support for a 'nano' field, and although the constructor forces you to pass in a nano field, this field is completely ignored in SW. The constructor exists as it is for compatibility with JDBC code, and that is all.


Fields inherited from class superwaba.ext.xplat.sql.Date
_date, _toString
 
Constructor Summary
  Timestamp(int year, int month, int day, int hour, int minute, int second, int nanos)
          This method initializes a new instance of this class with the specified year, month, day, hour, minute, second.
protected Timestamp(Time time)
           
 
Method Summary
 boolean after(Timestamp ts)
          This methods tests whether this object is later than the specified object.
 boolean before(Timestamp ts)
          This methods tests whether this object is earlier than the specified object.
 boolean equals(Object obj)
          This method these the specified Object for equality against this object.
 boolean equals(Timestamp ts)
          This method tests the specified timestamp for equality against this object.
 String toString()
          This method returns this date in JDBC format.
static Date valueOf(String str)
          This method returns a new instance of this class by parsing a date in JDBC format.
 
Methods inherited from class superwaba.ext.xplat.sql.Time
convertTimeToString, getHour, getMinute, getSecond, parseTime, setHour, setMinute, setSecond
 
Methods inherited from class superwaba.ext.xplat.sql.Date
convertDateToString, getDate, getMonth, getYear, setDate, setMonth, setYear
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, wait, wait
 

Constructor Detail

Timestamp

public Timestamp(int year,
                 int month,
                 int day,
                 int hour,
                 int minute,
                 int second,
                 int nanos)
This method initializes a new instance of this class with the specified year, month, day, hour, minute, second. NOTE: in SW, nanos is completely ignored. While this method is deprecated in the latest JDBC, it is the only way to do it for now in SW, as SW does not have a 'long' representation of time, and the conversion overhead is considered too great for small devices (this may change in the future).
Parameters:
year - The year for this Timestamp (year - 1900)
month - The month for this Timestamp (0-11)
day - The day for this Timestamp (1-31)
hour - The hour for this Timestamp (0-23)
minute - The minute for this Timestamp (0-59)
second - The second for this Timestamp (0-59)
nanos - The nanosecond value for this Timestamp (0 to 999,999,9999)

Timestamp

protected Timestamp(Time time)
Method Detail

toString

public String toString()
This method returns this date in JDBC format.
Overrides:
toString in class Time
Returns:
This date as a string.

before

public boolean before(Timestamp ts)
This methods tests whether this object is earlier than the specified object.
Parameters:
ts - The other Timestamp to test against.
Returns:
true if this object is earlier than the other object, false otherwise.

after

public boolean after(Timestamp ts)
This methods tests whether this object is later than the specified object.
Parameters:
ts - The other Timestamp to test against.
Returns:
true if this object is later than the other object, false otherwise.

equals

public boolean equals(Object obj)
This method these the specified Object for equality against this object. This will be true if an only if the specified object is an instance of Timestamp and has the same time value fields.
Overrides:
equals in class Object
Parameters:
obj - The object to test against for equality.
Returns:
true if the specified object is equal to this object, false otherwise.

equals

public boolean equals(Timestamp ts)
This method tests the specified timestamp for equality against this object. This will be true if and only if the specified object is not null and contains all the same time value fields as this object.
Parameters:
ts - The Timestamp to test against for equality.
Returns:
true if the specified object is equal to this object, false otherwise.

valueOf

public static Date valueOf(String str)
This method returns a new instance of this class by parsing a date in JDBC format. JDBC format is yyyy-MM-dd HH:mm:ss.
Parameters:
str - The string to parse.
Returns:
The resulting java.sql.Timestamp value.