java.sql

Class 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.
Constructor Summary
Date(int year, int month, int day)
This method initializes a new instance of this class with the specified year, month, and day.
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
intgetHours()
This method always throws an IllegalArgumentException.
intgetMinutes()
This method always throws an IllegalArgumentException.
intgetSeconds()
This method always throws an IllegalArgumentException.
voidsetHours(int newValue)
This method always throws an IllegalArgumentException.
voidsetMinutes(int newValue)
This method always throws an IllegalArgumentException.
voidsetSeconds(int newValue)
This method always throws an IllegalArgumentException.
StringtoString()
This method returns this date in JDBC format.
static DatevalueOf(String str)
This method returns a new instance of this class by parsing a date in JDBC format into a Java date.

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()

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

getMinutes

public int getMinutes()

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

getSeconds

public int getSeconds()

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

setHours

public void setHours(int newValue)

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

setMinutes

public void setMinutes(int newValue)

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

setSeconds

public void setSeconds(int newValue)

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

toString

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

Returns: This date as a string.

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.