jdk/src/share/classes/java/sql/Date.java
author lancea
Tue, 09 Oct 2012 08:58:27 -0400
changeset 14171 94eb36844bd7
parent 11129 f9ad1aadf3fa
child 14342 8435a30053c1
permissions -rw-r--r--
7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC Reviewed-by: alanb, smarks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 6298
diff changeset
     2
 * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.sql;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * <P>A thin wrapper around a millisecond value that allows
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * JDBC to identify this as an SQL <code>DATE</code> value.  A
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * milliseconds value represents the number of milliseconds that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * have passed since January 1, 1970 00:00:00.000 GMT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * To conform with the definition of SQL <code>DATE</code>, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * millisecond values wrapped by a <code>java.sql.Date</code> instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * must be 'normalized' by setting the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * hours, minutes, seconds, and milliseconds to zero in the particular
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * time zone with which the instance is associated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
public class Date extends java.util.Date {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
     * Constructs a <code>Date</code> object initialized with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     * year, month, and day.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * The result is undefined if a given argument is out of bounds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     * @param year the year minus 1900; must be 0 to 8099. (Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     *        8099 is 9999 minus 1900.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     * @param month 0 to 11
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * @param day 1 to 31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * @deprecated instead use the constructor <code>Date(long date)</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     */
14171
94eb36844bd7 7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC
lancea
parents: 11129
diff changeset
    54
    @Deprecated
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    public Date(int year, int month, int day) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        super(year, month, day);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * Constructs a <code>Date</code> object using the given milliseconds
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * time value.  If the given milliseconds value contains time
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * information, the driver will set the time components to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * time in the default time zone (the time zone of the Java virtual
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * machine running the application) that corresponds to zero GMT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * @param date milliseconds since January 1, 1970, 00:00:00 GMT not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     *        to exceed the milliseconds representation for the year 8099.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     *        A negative number indicates the number of milliseconds
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     *        before January 1, 1970, 00:00:00 GMT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    public Date(long date) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        // If the millisecond date value contains time info, mask it out.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        super(date);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * Sets an existing <code>Date</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * using the given milliseconds time value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * If the given milliseconds value contains time information,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * the driver will set the time components to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * time in the default time zone (the time zone of the Java virtual
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * machine running the application) that corresponds to zero GMT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * @param date milliseconds since January 1, 1970, 00:00:00 GMT not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     *        to exceed the milliseconds representation for the year 8099.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     *        A negative number indicates the number of milliseconds
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     *        before January 1, 1970, 00:00:00 GMT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    public void setTime(long date) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        // If the millisecond date value contains time info, mask it out.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        super.setTime(date);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * Converts a string in JDBC date escape format to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * a <code>Date</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @param s a <code>String</code> object representing a date in
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 6298
diff changeset
   100
     *        in the format "yyyy-[m]m-[d]d". The leading zero for <code>mm</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 6298
diff changeset
   101
     * and <code>dd</code> may also be omitted.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * @return a <code>java.sql.Date</code> object representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     *         given date
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * @throws IllegalArgumentException if the date given is not in the
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 6298
diff changeset
   105
     *         JDBC date escape format (yyyy-[m]m-[d]d)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    public static Date valueOf(String s) {
6298
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   108
        final int YEAR_LENGTH = 4;
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   109
        final int MONTH_LENGTH = 2;
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   110
        final int DAY_LENGTH = 2;
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   111
        final int MAX_MONTH = 12;
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   112
        final int MAX_DAY = 31;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        int firstDash;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        int secondDash;
6298
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   115
        Date d = null;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
6298
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   117
        if (s == null) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            throw new java.lang.IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
6298
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   121
        firstDash = s.indexOf('-');
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   122
        secondDash = s.indexOf('-', firstDash + 1);
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   123
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   124
        if ((firstDash > 0) && (secondDash > 0) && (secondDash < s.length() - 1)) {
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   125
            String yyyy = s.substring(0, firstDash);
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   126
            String mm = s.substring(firstDash + 1, secondDash);
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   127
            String dd = s.substring(secondDash + 1);
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 6298
diff changeset
   128
            if (yyyy.length() == YEAR_LENGTH &&
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 6298
diff changeset
   129
                    (mm.length() >= 1 && mm.length() <= MONTH_LENGTH) &&
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 6298
diff changeset
   130
                    (dd.length() >= 1 && dd.length() <= DAY_LENGTH)) {
6298
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   131
                int year = Integer.parseInt(yyyy);
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   132
                int month = Integer.parseInt(mm);
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   133
                int day = Integer.parseInt(dd);
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   134
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   135
                if ((month >= 1 && month <= MAX_MONTH) && (day >= 1 && day <= MAX_DAY)) {
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   136
                    d = new Date(year - 1900, month - 1, day);
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   137
                }
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   138
            }
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   139
        }
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   140
        if (d == null) {
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   141
            throw new java.lang.IllegalArgumentException();
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   142
        }
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   143
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   144
        return d;
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   145
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
6298
470b6c49fe5c 6898593: java.sql.Date.valueOf no exception if date given is not in the JDBC date escape syntax
lancea
parents: 5506
diff changeset
   148
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * Formats a date in the date escape format yyyy-mm-dd.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * @return a String in yyyy-mm-dd format
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6540
diff changeset
   154
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    public String toString () {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        int year = super.getYear() + 1900;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        int month = super.getMonth() + 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        int day = super.getDate();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        char buf[] = "2000-00-00".toCharArray();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        buf[0] = Character.forDigit(year/1000,10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        buf[1] = Character.forDigit((year/100)%10,10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        buf[2] = Character.forDigit((year/10)%10,10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        buf[3] = Character.forDigit(year%10,10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        buf[5] = Character.forDigit(month/10,10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        buf[6] = Character.forDigit(month%10,10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        buf[8] = Character.forDigit(day/10,10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        buf[9] = Character.forDigit(day%10,10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        return new String(buf);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    // Override all the time operations inherited from java.util.Date;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    * This method is deprecated and should not be used because SQL Date
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    * values do not have a time component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    * @deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    * @exception java.lang.IllegalArgumentException if this method is invoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    * @see #setHours
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    */
14171
94eb36844bd7 7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC
lancea
parents: 11129
diff changeset
   183
    @Deprecated
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    public int getHours() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        throw new java.lang.IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    * This method is deprecated and should not be used because SQL Date
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    * values do not have a time component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    * @deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    * @exception java.lang.IllegalArgumentException if this method is invoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    * @see #setMinutes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    */
14171
94eb36844bd7 7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC
lancea
parents: 11129
diff changeset
   196
    @Deprecated
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    public int getMinutes() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        throw new java.lang.IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    * This method is deprecated and should not be used because SQL Date
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    * values do not have a time component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    * @deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    * @exception java.lang.IllegalArgumentException if this method is invoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    * @see #setSeconds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    */
14171
94eb36844bd7 7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC
lancea
parents: 11129
diff changeset
   209
    @Deprecated
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    public int getSeconds() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        throw new java.lang.IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    * This method is deprecated and should not be used because SQL Date
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    * values do not have a time component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    * @deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    * @exception java.lang.IllegalArgumentException if this method is invoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    * @see #getHours
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    */
14171
94eb36844bd7 7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC
lancea
parents: 11129
diff changeset
   222
    @Deprecated
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    public void setHours(int i) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        throw new java.lang.IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    * This method is deprecated and should not be used because SQL Date
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    * values do not have a time component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    * @deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    * @exception java.lang.IllegalArgumentException if this method is invoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    * @see #getMinutes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    */
14171
94eb36844bd7 7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC
lancea
parents: 11129
diff changeset
   235
    @Deprecated
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    public void setMinutes(int i) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        throw new java.lang.IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    * This method is deprecated and should not be used because SQL Date
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    * values do not have a time component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    * @deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    * @exception java.lang.IllegalArgumentException if this method is invoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    * @see #getSeconds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    */
14171
94eb36844bd7 7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC
lancea
parents: 11129
diff changeset
   248
    @Deprecated
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    public void setSeconds(int i) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        throw new java.lang.IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    * Private serial version unique ID to ensure serialization
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    * compatibility.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    static final long serialVersionUID = 1511598038487230103L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
}