summaryrefslogtreecommitdiffstats
path: root/luni/src/main/java/javax/sql/RowSetMetaData.java
blob: 196c8b9aac6ee56e13d4bf76d4678a9b5011e31c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package javax.sql;

import java.sql.ResultSetMetaData;
import java.sql.SQLException;

/**
 * An interface which provides facilities for getting information about the
 * columns in a {@code RowSet}.
 * <p>
 * {@code RowSetMetaData} extends {@link java.sql.ResultSetMetaData}, adding new
 * operations for carrying out value sets.
 * <p>
 * Application code would not normally call this interface directly. It would be
 * called internally when {@code RowSet.execute} is called.
 *
 * @see RowSetInternal#setMetaData(RowSetMetaData)
 */
public interface RowSetMetaData extends ResultSetMetaData {

    /**
     * Sets automatic numbering for a specified column in the {@code RowSet}. If
     * automatic numbering is on, the column is read-only. The default value for
     * the auto increment parameter is {@code false}.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param autoIncrement
     *            {@code true} to set automatic numbering on, {@code false} to
     *            turn it off (default).
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setAutoIncrement(int columnIndex, boolean autoIncrement)
            throws SQLException;

    /**
     * Sets the case sensitive property for a specified column in the {@code
     * RowSet}. The default is that the column is not case sensitive.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param caseSensitive
     *            {@code true} to make the column case sensitive, {@code false}
     *            to make it case insensitive (default).
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setCaseSensitive(int columnIndex, boolean caseSensitive)
            throws SQLException;

    /**
     * Sets the catalog name for a specified column in the {@code RowSet}.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param catalogName
     *            the new catalog's name.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setCatalogName(int columnIndex, String catalogName)
            throws SQLException;

    /**
     * Sets the number of columns contained in the row set.
     *
     * @param columnCount
     *            the number of columns contained in the {@code RowSet}.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setColumnCount(int columnCount) throws SQLException;

    /**
     * Sets the normal maximum width in characters for a specified column in the
     * {@code RowSet}.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param displaySize
     *            the normal maximum column width in characters.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setColumnDisplaySize(int columnIndex, int displaySize)
            throws SQLException;

    /**
     * Sets the suggested name as label for the column contained in the {@code
     * RowSet}. The label is an alias for printing and displaying purposes.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param theLabel
     *            the alias name for the column.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setColumnLabel(int columnIndex, String theLabel)
            throws SQLException;

    /**
     * Sets the column name for a specified column in the {@code RowSet}.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param theColumnName
     *            the column's label.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setColumnName(int columnIndex, String theColumnName)
            throws SQLException;

    /**
     * Sets the SQL type for a specified column in the {@code RowSet}.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param theSQLType
     *            the SQL Type, as defined by {@code java.sql.Types}.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setColumnType(int columnIndex, int theSQLType)
            throws SQLException;

    /**
     * Sets the type name for a specified column in the {@code RowSet}, where
     * the data type is specific to the data source.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param theTypeName
     *            the SQL type name for the column.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setColumnTypeName(int columnIndex, String theTypeName)
            throws SQLException;

    /**
     * Sets whether a specified column is a currency value. The default value is
     * {@code false}.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param isCurrency
     *            {@code true} if the column should be treated as a currency
     *            value, {@code false} if it should not be treated as a currency
     *            value (default).
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setCurrency(int columnIndex, boolean isCurrency)
            throws SQLException;

    /**
     * Sets whether a specified column can contain SQL {@code NULL} values.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param nullability
     *            an integer which is one of the following values:
     *            <ul>
     *            <li>{@code ResultSetMetaData.columnNoNulls}</li>
     *            <li>{@code ResultSetMetaData.columnNullable}</li>
     *            <li>{@code ResultSetMetaData.columnNullableUnknown}</li>
     *            </ul>
     *            <p>
     *            The default value is {@code
     *            ResultSetMetaData.columnNullableUnknown}.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setNullable(int columnIndex, int nullability)
            throws SQLException;

    /**
     * Sets the number of decimal digits for a specified column in the {@code
     * RowSet}.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param thePrecision
     *            the number of decimal digits.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setPrecision(int columnIndex, int thePrecision)
            throws SQLException;

    /**
     * Declares how many decimal digits there should be after a decimal point
     * for the column specified by {@code columnIndex}.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param theScale
     *            the number of digits after the decimal point.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setScale(int columnIndex, int theScale) throws SQLException;

    /**
     * Sets the schema name for a specified column in the {@code RowSet}.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param theSchemaName
     *            a {@code String} containing the schema name.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setSchemaName(int columnIndex, String theSchemaName)
            throws SQLException;

    /**
     * Sets whether a specified column can be used in a search involving a
     * {@code WHERE} clause. The default value is {@code false}.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param isSearchable
     *            {@code true} of the column can be used in a {@code WHERE}
     *            clause search, {@code false} otherwise.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setSearchable(int columnIndex, boolean isSearchable)
            throws SQLException;

    /**
     * Sets if a specified column can contain signed numbers.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param isSigned
     *            {@code true} if the column can contain signed numbers, {@code
     *            false} otherwise.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setSigned(int columnIndex, boolean isSigned)
            throws SQLException;

    /**
     * Sets the table name for a specified column in the {@code RowSet}.
     *
     * @param columnIndex
     *            the index number for the column; the first column's index is
     *            1.
     * @param theTableName
     *            the table name for the column.
     * @throws SQLException
     *             if a problem occurs accessing the database.
     */
    public void setTableName(int columnIndex, String theTableName)
            throws SQLException;
}