All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.sql.Date

java.lang.Object
    |
    +----java.util.Date
            |
            +----java.sql.Date

public class Date
extends Date

This class is a thin wrapper around java.util.Date that allows JDBC to identify this as a SQL DATE value. It adds formatting and parsing operations to support the JDBC escape syntax for date values.


Constructor Index

 o Date(int, int, int)
Construct a Date Deprecated.
 o Date(long)
Construct a Date using a milliseconds time value

Method Index

 o getHours()
Deprecated.
 o getMinutes()
Deprecated.
 o getSeconds()
Deprecated.
 o setHours(int)
Deprecated.
 o setMinutes(int)
Deprecated.
 o setSeconds(int)
Deprecated.
 o setTime(long)
Set a Date using a milliseconds time value
 o toString()
Format a date in JDBC date escape format
 o valueOf(String)
Convert a string in JDBC date escape format to a Date value

Constructors

 o Date
public Date(int year,
            int month,
            int day)
Note: Date() is deprecated.

Construct a Date

Parameters:
year - year-1900
month - 0 to 11
day - 1 to 31
 o Date
public Date(long date)
Construct a Date using a milliseconds time value

Parameters:
date - milliseconds since January 1, 1970, 00:00:00 GMT

Methods

 o setTime
public void setTime(long date)
Set a Date using a milliseconds time value

Parameters:
date - milliseconds since January 1, 1970, 00:00:00 GMT
Overrides:
setTime in class Date
 o valueOf
public static Date valueOf(String s)
Convert a string in JDBC date escape format to a Date value

Parameters:
s - date in format "yyyy-mm-dd"
Returns:
corresponding Date
 o toString
public String toString()
Format a date in JDBC date escape format

Returns:
a String in yyyy-mm-dd format
Overrides:
toString in class Date
 o getHours
public int getHours()
Note: getHours() is deprecated.

Overrides:
getHours in class Date
 o getMinutes
public int getMinutes()
Note: getMinutes() is deprecated.

Overrides:
getMinutes in class Date
 o getSeconds
public int getSeconds()
Note: getSeconds() is deprecated.

Overrides:
getSeconds in class Date
 o setHours
public void setHours(int i)
Note: setHours() is deprecated.

Overrides:
setHours in class Date
 o setMinutes
public void setMinutes(int i)
Note: setMinutes() is deprecated.

Overrides:
setMinutes in class Date
 o setSeconds
public void setSeconds(int i)
Note: setSeconds() is deprecated.

Overrides:
setSeconds in class Date

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature