src/java.sql/share/classes/java/sql/ParameterMetaData.java
author psadhukhan
Fri, 09 Nov 2018 09:29:43 +0530
changeset 52543 3853631e6a07
parent 47216 71c04702a3d5
permissions -rw-r--r--
8213181: Updation of ProblemList.txt for removal of passing swing test Reviewed-by: serb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2000, 2006, 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
 * An object that can be used to get information about the types
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * and properties for each parameter marker in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * <code>PreparedStatement</code> object. For some queries and driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * implementations, the data that would be returned by a <code>ParameterMetaData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * object may not be available until the <code>PreparedStatement</code> has
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * been executed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *Some driver implementations may not be able to provide information about the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 *types and properties for each parameter marker in a <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
public interface ParameterMetaData extends Wrapper {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * Retrieves the number of parameters in the <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     * object for which this <code>ParameterMetaData</code> object contains
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     * information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     * @return the number of parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    int getParameterCount() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     * Retrieves whether null values are allowed in the designated parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * @param param the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * @return the nullability status of the given parameter; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     *        <code>ParameterMetaData.parameterNoNulls</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     *        <code>ParameterMetaData.parameterNullable</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     *        <code>ParameterMetaData.parameterNullableUnknown</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    int isNullable(int param) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * The constant indicating that a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * parameter will not allow <code>NULL</code> values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    int parameterNoNulls = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * The constant indicating that a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * parameter will allow <code>NULL</code> values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    int parameterNullable = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * The constant indicating that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * nullability of a parameter is unknown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    int parameterNullableUnknown = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * Retrieves whether values for the designated parameter can be signed numbers.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * @param param the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * @return <code>true</code> if so; <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    boolean isSigned(int param) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * Retrieves the designated parameter's specified column size.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * <P>The returned value represents the maximum column size for the given parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * For numeric data, this is the maximum precision.  For character data, this is the length in characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * For datetime datatypes, this is the length in characters of the String representation (assuming the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes.  For the ROWID datatype,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * this is the length in bytes. 0 is returned for data types where the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * column size is not applicable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @param param the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * @return precision
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    int getPrecision(int param) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * Retrieves the designated parameter's number of digits to right of the decimal point.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * 0 is returned for data types where the scale is not applicable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * @param param the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @return scale
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    int getScale(int param) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * Retrieves the designated parameter's SQL type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * @param param the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @return SQL type from <code>java.sql.Types</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * @see Types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    int getParameterType(int param) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * Retrieves the designated parameter's database-specific type name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * @param param the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @return type the name used by the database. If the parameter type is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * a user-defined type, then a fully-qualified type name is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    String getParameterTypeName(int param) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * Retrieves the fully-qualified name of the Java class whose instances
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * should be passed to the method <code>PreparedStatement.setObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * @param param the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * @return the fully-qualified name of the class in the Java programming
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     *         language that would be used by the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     *         <code>PreparedStatement.setObject</code> to set the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     *         in the specified parameter. This is the class name used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     *         for custom mapping.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    String getParameterClassName(int param) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * The constant indicating that the mode of the parameter is unknown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    int parameterModeUnknown = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * The constant indicating that the parameter's mode is IN.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    int parameterModeIn = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * The constant indicating that the parameter's mode is INOUT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    int parameterModeInOut = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * The constant indicating that the parameter's mode is  OUT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    int parameterModeOut = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * Retrieves the designated parameter's mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * @param param the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * @return mode of the parameter; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     *        <code>ParameterMetaData.parameterModeIn</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     *        <code>ParameterMetaData.parameterModeOut</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     *        <code>ParameterMetaData.parameterModeInOut</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     *        <code>ParameterMetaData.parameterModeUnknown</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    int getParameterMode(int param) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
}