< prev index next >

src/java.sql/share/classes/java/sql/Time.java

Print this page




  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.sql;
  27 
  28 import java.time.Instant;
  29 import java.time.LocalTime;
  30 import jdk.internal.misc.SharedSecrets;
  31 import jdk.internal.misc.JavaLangAccess;
  32 
  33 /**
  34  * <P>A thin wrapper around the <code>java.util.Date</code> class that allows the JDBC
  35  * API to identify this as an SQL <code>TIME</code> value. The <code>Time</code>
  36  * class adds formatting and
  37  * parsing operations to support the JDBC escape syntax for time
  38  * values.
  39  * <p>The date components should be set to the "zero epoch"
  40  * value of January 1, 1970 and should not be accessed.


  41  */
  42 public class Time extends java.util.Date {
  43 
  44     private static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
  45 
  46     /**
  47      * Constructs a <code>Time</code> object initialized with the
  48      * given values for the hour, minute, and second.
  49      * The driver sets the date components to January 1, 1970.
  50      * Any method that attempts to access the date components of a
  51      * <code>Time</code> object will throw a
  52      * <code>java.lang.IllegalArgumentException</code>.
  53      * <P>
  54      * The result is undefined if a given argument is out of bounds.
  55      *
  56      * @param hour 0 to 23
  57      * @param minute 0 to 59
  58      * @param second 0 to 59
  59      *
  60      * @deprecated Use the constructor that takes a milliseconds value




  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.sql;
  27 
  28 import java.time.Instant;
  29 import java.time.LocalTime;
  30 import jdk.internal.misc.SharedSecrets;
  31 import jdk.internal.misc.JavaLangAccess;
  32 
  33 /**
  34  * <P>A thin wrapper around the <code>java.util.Date</code> class that allows the JDBC
  35  * API to identify this as an SQL <code>TIME</code> value. The <code>Time</code>
  36  * class adds formatting and
  37  * parsing operations to support the JDBC escape syntax for time
  38  * values.
  39  * <p>The date components should be set to the "zero epoch"
  40  * value of January 1, 1970 and should not be accessed.
  41  *
  42  * @since 1.1
  43  */
  44 public class Time extends java.util.Date {
  45 
  46     private static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
  47 
  48     /**
  49      * Constructs a <code>Time</code> object initialized with the
  50      * given values for the hour, minute, and second.
  51      * The driver sets the date components to January 1, 1970.
  52      * Any method that attempts to access the date components of a
  53      * <code>Time</code> object will throw a
  54      * <code>java.lang.IllegalArgumentException</code>.
  55      * <P>
  56      * The result is undefined if a given argument is out of bounds.
  57      *
  58      * @param hour 0 to 23
  59      * @param minute 0 to 59
  60      * @param second 0 to 59
  61      *
  62      * @deprecated Use the constructor that takes a milliseconds value


< prev index next >