1 /* 2 * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 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 javax.sql; 27 28 import java.sql.*; 29 30 /** 31 * An object that contains information about the columns in a 32 * <code>RowSet</code> object. This interface is 33 * an extension of the <code>ResultSetMetaData</code> interface with 34 * methods for setting the values in a <code>RowSetMetaData</code> object. 35 * When a <code>RowSetReader</code> object reads data into a <code>RowSet</code> 36 * object, it creates a <code>RowSetMetaData</code> object and initializes it 37 * using the methods in the <code>RowSetMetaData</code> interface. Then the 38 * reader passes the <code>RowSetMetaData</code> object to the rowset. 39 * <P> 40 * The methods in this interface are invoked internally when an application 41 * calls the method <code>RowSet.execute</code>; an application 42 * programmer would not use them directly. 43 * 44 * @since 1.4 45 */ 46 47 public interface RowSetMetaData extends ResultSetMetaData { 48 49 /** 50 * Sets the number of columns in the <code>RowSet</code> object to 51 * the given number. 52 * 53 * @param columnCount the number of columns in the <code>RowSet</code> object 54 * @exception SQLException if a database access error occurs 55 */ setColumnCount(int columnCount)56 void setColumnCount(int columnCount) throws SQLException; 57 58 /** 59 * Sets whether the designated column is automatically numbered, 60 * The default is for a <code>RowSet</code> object's 61 * columns not to be automatically numbered. 62 * 63 * @param columnIndex the first column is 1, the second is 2, ... 64 * @param property <code>true</code> if the column is automatically 65 * numbered; <code>false</code> if it is not 66 * 67 * @exception SQLException if a database access error occurs 68 */ setAutoIncrement(int columnIndex, boolean property)69 void setAutoIncrement(int columnIndex, boolean property) throws SQLException; 70 71 /** 72 * Sets whether the designated column is case sensitive. 73 * The default is <code>false</code>. 74 * 75 * @param columnIndex the first column is 1, the second is 2, ... 76 * @param property <code>true</code> if the column is case sensitive; 77 * <code>false</code> if it is not 78 * 79 * @exception SQLException if a database access error occurs 80 */ setCaseSensitive(int columnIndex, boolean property)81 void setCaseSensitive(int columnIndex, boolean property) throws SQLException; 82 83 /** 84 * Sets whether the designated column can be used in a where clause. 85 * The default is <code>false</code>. 86 * 87 * @param columnIndex the first column is 1, the second is 2, ... 88 * @param property <code>true</code> if the column can be used in a 89 * <code>WHERE</code> clause; <code>false</code> if it cannot 90 * 91 * @exception SQLException if a database access error occurs 92 */ setSearchable(int columnIndex, boolean property)93 void setSearchable(int columnIndex, boolean property) throws SQLException; 94 95 /** 96 * Sets whether the designated column is a cash value. 97 * The default is <code>false</code>. 98 * 99 * @param columnIndex the first column is 1, the second is 2, ... 100 * @param property <code>true</code> if the column is a cash value; 101 * <code>false</code> if it is not 102 * 103 * @exception SQLException if a database access error occurs 104 */ setCurrency(int columnIndex, boolean property)105 void setCurrency(int columnIndex, boolean property) throws SQLException; 106 107 /** 108 * Sets whether the designated column's value can be set to 109 * <code>NULL</code>. 110 * The default is <code>ResultSetMetaData.columnNullableUnknown</code> 111 * 112 * @param columnIndex the first column is 1, the second is 2, ... 113 * @param property one of the following constants: 114 * <code>ResultSetMetaData.columnNoNulls</code>, 115 * <code>ResultSetMetaData.columnNullable</code>, or 116 * <code>ResultSetMetaData.columnNullableUnknown</code> 117 * 118 * @exception SQLException if a database access error occurs 119 */ setNullable(int columnIndex, int property)120 void setNullable(int columnIndex, int property) throws SQLException; 121 122 /** 123 * Sets whether the designated column is a signed number. 124 * The default is <code>false</code>. 125 * 126 * @param columnIndex the first column is 1, the second is 2, ... 127 * @param property <code>true</code> if the column is a signed number; 128 * <code>false</code> if it is not 129 * 130 * @exception SQLException if a database access error occurs 131 */ setSigned(int columnIndex, boolean property)132 void setSigned(int columnIndex, boolean property) throws SQLException; 133 134 /** 135 * Sets the designated column's normal maximum width in chars to the 136 * given <code>int</code>. 137 * 138 * @param columnIndex the first column is 1, the second is 2, ... 139 * @param size the normal maximum number of characters for 140 * the designated column 141 * 142 * @exception SQLException if a database access error occurs 143 */ setColumnDisplaySize(int columnIndex, int size)144 void setColumnDisplaySize(int columnIndex, int size) throws SQLException; 145 146 /** 147 * Sets the suggested column title for use in printouts and 148 * displays, if any, to the given <code>String</code>. 149 * 150 * @param columnIndex the first column is 1, the second is 2, ... 151 * @param label the column title 152 * @exception SQLException if a database access error occurs 153 */ setColumnLabel(int columnIndex, String label)154 void setColumnLabel(int columnIndex, String label) throws SQLException; 155 156 /** 157 * Sets the name of the designated column to the given <code>String</code>. 158 * 159 * @param columnIndex the first column is 1, the second is 2, ... 160 * @param columnName the designated column's name 161 * @exception SQLException if a database access error occurs 162 */ setColumnName(int columnIndex, String columnName)163 void setColumnName(int columnIndex, String columnName) throws SQLException; 164 165 /** 166 * Sets the name of the designated column's table's schema, if any, to 167 * the given <code>String</code>. 168 * 169 * @param columnIndex the first column is 1, the second is 2, ... 170 * @param schemaName the schema name 171 * @exception SQLException if a database access error occurs 172 */ setSchemaName(int columnIndex, String schemaName)173 void setSchemaName(int columnIndex, String schemaName) throws SQLException; 174 175 /** 176 * Sets the designated column's number of decimal digits to the 177 * given <code>int</code>. 178 * 179 * @param columnIndex the first column is 1, the second is 2, ... 180 * @param precision the total number of decimal digits 181 * @exception SQLException if a database access error occurs 182 */ setPrecision(int columnIndex, int precision)183 void setPrecision(int columnIndex, int precision) throws SQLException; 184 185 /** 186 * Sets the designated column's number of digits to the 187 * right of the decimal point to the given <code>int</code>. 188 * 189 * @param columnIndex the first column is 1, the second is 2, ... 190 * @param scale the number of digits to right of decimal point 191 * @exception SQLException if a database access error occurs 192 */ setScale(int columnIndex, int scale)193 void setScale(int columnIndex, int scale) throws SQLException; 194 195 /** 196 * Sets the designated column's table name, if any, to the given 197 * <code>String</code>. 198 * 199 * @param columnIndex the first column is 1, the second is 2, ... 200 * @param tableName the column's table name 201 * @exception SQLException if a database access error occurs 202 */ setTableName(int columnIndex, String tableName)203 void setTableName(int columnIndex, String tableName) throws SQLException; 204 205 /** 206 * Sets the designated column's table's catalog name, if any, to the given 207 * <code>String</code>. 208 * 209 * @param columnIndex the first column is 1, the second is 2, ... 210 * @param catalogName the column's catalog name 211 * @exception SQLException if a database access error occurs 212 */ setCatalogName(int columnIndex, String catalogName)213 void setCatalogName(int columnIndex, String catalogName) throws SQLException; 214 215 /** 216 * Sets the designated column's SQL type to the one given. 217 * 218 * @param columnIndex the first column is 1, the second is 2, ... 219 * @param SQLType the column's SQL type 220 * @exception SQLException if a database access error occurs 221 * @see Types 222 */ setColumnType(int columnIndex, int SQLType)223 void setColumnType(int columnIndex, int SQLType) throws SQLException; 224 225 /** 226 * Sets the designated column's type name that is specific to the 227 * data source, if any, to the given <code>String</code>. 228 * 229 * @param columnIndex the first column is 1, the second is 2, ... 230 * @param typeName data source specific type name. 231 * @exception SQLException if a database access error occurs 232 */ setColumnTypeName(int columnIndex, String typeName)233 void setColumnTypeName(int columnIndex, String typeName) throws SQLException; 234 235 } 236