java.sql
Class Time

java.lang.Object
  extended by java.util.Date
      extended by java.sql.Time
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Date>

public class Time
extends Date

This class is a wrapper around java.util.Date to allow the JDBC driver to identify the value as a SQL Time.

See Also:
Serialized Form

Constructor Summary
Time(int hour, int minute, int second)
          Deprecated.  
Time(long date)
          This method initializes a new instance of this class with the specified time value representing the number of milliseconds since Jan 1, 1970 at 12:00 midnight GMT.
 
Method Summary
 int getDate()
          Deprecated.  
 int getDay()
          Deprecated.  
 int getMonth()
          Deprecated.  
 int getYear()
          Deprecated.  
 void setDate(int newValue)
          Deprecated.  
 void setMonth(int newValue)
          Deprecated.  
 void setYear(int newValue)
          Deprecated.  
 String toString()
          This method returns this date in JDBC format.
static Time valueOf(String str)
          This method returns a new instance of this class by parsing a date in JDBC format into a Java date.
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, equals, getHours, getMinutes, getSeconds, getTime, getTimezoneOffset, hashCode, parse, setHours, setMinutes, setSeconds, setTime, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Time

public Time(int hour,
            int minute,
            int second)
Deprecated. 

This method initializes a new instance of this class with the specified year, month, and day.

Parameters:
hour - The hour for this Time (0-23)
minute - The minute for this time (0-59)
second - The second for this time (0-59)

Time

public Time(long date)
This method initializes a new instance of this class with the specified time value representing the number of milliseconds since Jan 1, 1970 at 12:00 midnight GMT.

Parameters:
date - The time value to intialize this Time to.
Method Detail

getDate

public int getDate()
            throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
getDate in class Date
Returns:
the day of month represented by this date object.
Throws:
IllegalArgumentException - when it's called.
See Also:
Calendar, Date.setDate(int)

getDay

public int getDay()
           throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
getDay in class Date
Returns:
the day represented by this date object.
Throws:
IllegalArgumentException - when it's called.
See Also:
Calendar

getMonth

public int getMonth()
             throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
getMonth in class Date
Returns:
the month represented by this date object (zero based).
Throws:
IllegalArgumentException - when it's called.
See Also:
Date.setMonth(int), Calendar

getYear

public int getYear()
            throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
getYear in class Date
Returns:
the year minus 1900 represented by this date object.
Throws:
IllegalArgumentException - when it's called.
See Also:
Calendar, Date.setYear(int)

setDate

public void setDate(int newValue)
             throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
setDate in class Date
Parameters:
newValue - the date.
Throws:
IllegalArgumentException - when it's called.
See Also:
Calendar, Date.getDate()

setMonth

public void setMonth(int newValue)
              throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
setMonth in class Date
Parameters:
newValue - the month, with a zero-based index from January.
Throws:
IllegalArgumentException - when it's called.
See Also:
Date.getMonth(), Calendar

setYear

public void setYear(int newValue)
             throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
setYear in class Date
Parameters:
newValue - the year minus 1900.
Throws:
IllegalArgumentException - when it's called.
See Also:
Date.getYear(), Calendar

valueOf

public static Time valueOf(String str)
This method returns a new instance of this class by parsing a date in JDBC format into a Java date.

Parameters:
str - The string to parse.
Returns:
The resulting java.sql.Time value.

toString

public String toString()
This method returns this date in JDBC format.

Overrides:
toString in class Date
Returns:
This date as a string.
See Also:
Date.parse(String), DateFormat