Class java.sql.Time
All Packages Class Hierarchy This Package Previous Next Index
Class java.sql.Time
java.lang.Object
|
+----java.util.Date
|
+----java.sql.Time
- public class Time
- extends Date
This class is a thin wrapper around java.util.Date that allows
JDBC to identify this as a SQL TIME value. It adds formatting and
parsing operations to support the JDBC escape syntax for time
values.
-
Time(int, int, int)
- Construct a Time Object
-
Time(long)
- Construct a Time using a milliseconds time value
-
getDate()
-
-
getDay()
-
-
getMonth()
-
-
getYear()
-
-
setDate(int)
-
-
setMonth(int)
-
-
setTime(long)
- Set a Time using a milliseconds time value
-
setYear(int)
-
-
toString()
- Format a time in JDBC date escape format
-
valueOf(String)
- Convert a string in JDBC time escape format to a Time value
Time
public Time(int hour,
int minute,
int second)
- Construct a Time Object
- Parameters:
- hour - 0 to 23
- minute - 0 to 59
- second - 0 to 59
Time
public Time(long time)
- Construct a Time using a milliseconds time value
- Parameters:
- time - milliseconds since January 1, 1970, 00:00:00 GMT
setTime
public void setTime(long time)
- Set a Time using a milliseconds time value
- Parameters:
- time - milliseconds since January 1, 1970, 00:00:00 GMT
- Overrides:
- setTime in class Date
valueOf
public static Time valueOf(String s)
- Convert a string in JDBC time escape format to a Time value
- Parameters:
- s - time in format "hh:mm:ss"
- Returns:
- corresponding Time
toString
public String toString()
- Format a time in JDBC date escape format
- Returns:
- a String in hh:mm:ss format
- Overrides:
- toString in class Date
getYear
public int getYear()
- Overrides:
- getYear in class Date
getMonth
public int getMonth()
- Overrides:
- getMonth in class Date
getDay
public int getDay()
- Overrides:
- getDay in class Date
getDate
public int getDate()
- Overrides:
- getDate in class Date
setYear
public void setYear(int i)
- Overrides:
- setYear in class Date
setMonth
public void setMonth(int i)
- Overrides:
- setMonth in class Date
setDate
public void setDate(int i)
- Overrides:
- setDate in class Date
All Packages Class Hierarchy This Package Previous Next Index