java.sql
Class Date

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

public class Date
extends Date

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

See Also:
Serialized Form

Constructor Summary
Date(int year, int month, int day)
          Deprecated.  
Date(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 getHours()
          Deprecated.  
 int getMinutes()
          Deprecated.  
 int getSeconds()
          Deprecated.  
 void setHours(int newValue)
          Deprecated.  
 void setMinutes(int newValue)
          Deprecated.  
 void setSeconds(int newValue)
          Deprecated.  
 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 into a Java date.
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, equals, getDate, getDay, getMonth, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setMonth, setTime, setYear, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Date

public Date(int year,
            int month,
            int day)
Deprecated. 

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

Parameters:
year - The year of this date minue 1900.
month - The month of this date (0-11).
day - The day of this date (1-31).

Date

public Date(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 date to.
Method Detail

getHours

public int getHours()
             throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
getHours in class Date
Returns:
the hours represented by this date object.
Throws:
IllegalArgumentException - when it's called.
See Also:
Calendar, Date.setHours(int)

getMinutes

public int getMinutes()
               throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
getMinutes in class Date
Returns:
the minutes represented by this date object.
Throws:
IllegalArgumentException - when it's called.
See Also:
Calendar, Date.setMinutes(int)

getSeconds

public int getSeconds()
               throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
getSeconds in class Date
Returns:
the seconds represented by this date object.
Throws:
IllegalArgumentException - when it's called.
See Also:
Calendar, Date.setSeconds(int)

setHours

public void setHours(int newValue)
              throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
setHours in class Date
Parameters:
newValue - the hours.
Throws:
IllegalArgumentException - when it's called.
See Also:
Calendar, Date.getHours()

setMinutes

public void setMinutes(int newValue)
                throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
setMinutes in class Date
Parameters:
newValue - the minutes.
Throws:
IllegalArgumentException - when it's called.
See Also:
Calendar, Date.getMinutes()

setSeconds

public void setSeconds(int newValue)
                throws IllegalArgumentException
Deprecated. 

This method always throws an IllegalArgumentException.

Overrides:
setSeconds in class Date
Parameters:
newValue - the seconds.
Throws:
IllegalArgumentException - when it's called.
See Also:
Calendar, Date.getSeconds()

valueOf

public static Date 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.Date 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