java.sql

Class Time

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.
Constructor Summary
Time(int hour, int minute, int second)
This method initializes a new instance of this class with the specified year, month, and day.
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
intgetDate()
This method always throws an IllegalArgumentException.
intgetDay()
This method always throws an IllegalArgumentException.
intgetMonth()
This method always throws an IllegalArgumentException.
intgetYear()
This method always throws an IllegalArgumentException.
voidsetDate(int newValue)
This method always throws an IllegalArgumentException.
voidsetMonth(int newValue)
This method always throws an IllegalArgumentException.
voidsetYear(int newValue)
This method always throws an IllegalArgumentException.
StringtoString()
This method returns this date in JDBC format.
static TimevalueOf(String str)
This method returns a new instance of this class by parsing a date in JDBC format into a Java date.

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

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

getDay

public int getDay()

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

getMonth

public int getMonth()

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

getYear

public int getYear()

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

setDate

public void setDate(int newValue)

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

setMonth

public void setMonth(int newValue)

Deprecated:

This method always throws an IllegalArgumentException.

Throws: IllegalArgumentException when it's called.

setYear

public void setYear(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 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.