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

Print this page




  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  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 sun.misc.SharedSecrets;
  31 import sun.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




  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  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