Class Time

public class Time extends Date

This class extends the standard java.util.date class to represent SQL TIME types. Only hours, minutes, and seconds are handled. It supports the JDBC escape syntax for time values.

Constructors

Time

public Time(int hour, int minute, int second)

This constructs a Time object.

Parameters:

hour:

0 to 23

minute:

0 to 59

second:

0 to 59

Time

public Time(long time)

This constructs a Time object using a time value in milliseconds since January 1, 1970, 00:00:00 GMT.

Parameters:

time:

The milliseconds since January 1, 1970, 00:00:00 GMT

Methods

toString

public String toString()

This converts the time to HH:MM:SS format.

Returns: A HH:MM:SS formatted time String

valueOf

public static Time valueOf(String s)

This converts an HH:MM:SS formatted string to a Time value.

Parameters:

s:

The time in HH:MM:SS format

Returns: A Time object



JDBC 3. 0. JAVA Database Connectivity
JDBC 3: Java Database Connectivity
ISBN: 0764548751
EAN: 2147483647
Year: 2002
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net