src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java

Print this page




 142 
 143            for (int i=1; i <= colCount; i++) {
 144                  colInfo[i] = new ColInfo();
 145            }
 146        }
 147 
 148 
 149     }
 150 
 151     /**
 152      * Sets whether the designated column is automatically
 153      * numbered, thus read-only, to the given <code>boolean</code>
 154      * value.
 155      *
 156      * @param columnIndex the first column is 1, the second is 2, and so on;
 157      *        must be between <code>1</code> and the number of columns
 158      *        in the rowset, inclusive
 159      * @param property <code>true</code> if the given column is
 160      *                 automatically incremented; <code>false</code>
 161      *                 otherwise
 162      * @throws <code>SQLException</code> if a database access error occurs or
 163      *         the given index is out of bounds
 164      */
 165     public void setAutoIncrement(int columnIndex, boolean property) throws SQLException {
 166         checkColRange(columnIndex);
 167         colInfo[columnIndex].autoIncrement = property;
 168     }
 169 
 170     /**
 171      * Sets whether the name of the designated column is case sensitive to
 172      * the given <code>boolean</code>.
 173      *
 174      * @param columnIndex the first column is 1, the second is 2, and so on;
 175      *        must be between <code>1</code> and the number of columns
 176      *        in the rowset, inclusive
 177      * @param property <code>true</code> to indicate that the column
 178      *                 name is case sensitive; <code>false</code> otherwise
 179      * @throws SQLException if a database access error occurs or
 180      *         the given column number is out of bounds
 181      */
 182     public void setCaseSensitive(int columnIndex, boolean property) throws SQLException {
 183         checkColRange(columnIndex);
 184         colInfo[columnIndex].caseSensitive = property;
 185     }
 186 
 187     /**
 188      * Sets whether a value stored in the designated column can be used
 189      * in a <code>WHERE</code> clause to the given <code>boolean</code> value.
 190      *
 191      * @param columnIndex the first column is 1, the second is 2, and so on;
 192      *                    must be between <code>1</code> and the number
 193      *                    of columns in the rowset, inclusive
 194      * @param property <code>true</code> to indicate that a column
 195      *                 value can be used in a <code>WHERE</code> clause;
 196      *                 <code>false</code> otherwise
 197      *
 198      * @throws <code>SQLException</code> if a database access error occurs or
 199      *         the given column number is out of bounds
 200      */
 201     public void setSearchable(int columnIndex, boolean property)
 202         throws SQLException {
 203         checkColRange(columnIndex);
 204         colInfo[columnIndex].searchable = property;
 205     }
 206 
 207     /**
 208      * Sets whether a value stored in the designated column is a cash
 209      * value to the given <code>boolean</code>.
 210      *
 211      * @param columnIndex the first column is 1, the second is 2, and so on;
 212      * must be between <code>1</code> and the number of columns,
 213      * inclusive between <code>1</code> and the number of columns, inclusive
 214      * @param property true if the value is a cash value; false otherwise.
 215      * @throws <code>SQLException</code> if a database access error occurs
 216      *         or the given column number is out of bounds
 217      */
 218     public void setCurrency(int columnIndex, boolean property)
 219         throws SQLException {
 220         checkColRange(columnIndex);
 221         colInfo[columnIndex].currency = property;
 222     }
 223 
 224     /**
 225      * Sets whether a value stored in the designated column can be set
 226      * to <code>NULL</code> to the given constant from the interface
 227      * <code>ResultSetMetaData</code>.
 228      *
 229      * @param columnIndex the first column is 1, the second is 2, and so on;
 230      *        must be between <code>1</code> and the number of columns, inclusive
 231      * @param property one of the following <code>ResultSetMetaData</code> constants:
 232      *                 <code>columnNoNulls</code>,
 233      *                 <code>columnNullable</code>, or
 234      *                 <code>columnNullableUnknown</code>
 235      *
 236      * @throws <code>SQLException</code> if a database access error occurs,
 237      *         the given column number is out of bounds, or the value supplied
 238      *         for the <i>property</i> parameter is not one of the following
 239      *         constants:
 240      *           <code>ResultSetMetaData.columnNoNulls</code>,
 241      *           <code>ResultSetMetaData.columnNullable</code>, or
 242      *           <code>ResultSetMetaData.columnNullableUnknown</code>
 243      */
 244     public void setNullable(int columnIndex, int property) throws SQLException {
 245         if ((property < ResultSetMetaData.columnNoNulls) ||
 246             property > ResultSetMetaData.columnNullableUnknown) {
 247                 throw new SQLException("Invalid nullable constant set. Must be " +
 248                     "either columnNoNulls, columnNullable or columnNullableUnknown");
 249         }
 250         checkColRange(columnIndex);
 251         colInfo[columnIndex].nullable = property;
 252     }
 253 
 254     /**
 255      * Sets whether a value stored in the designated column is a signed
 256      * number to the given <code>boolean</code>.




 142 
 143            for (int i=1; i <= colCount; i++) {
 144                  colInfo[i] = new ColInfo();
 145            }
 146        }
 147 
 148 
 149     }
 150 
 151     /**
 152      * Sets whether the designated column is automatically
 153      * numbered, thus read-only, to the given <code>boolean</code>
 154      * value.
 155      *
 156      * @param columnIndex the first column is 1, the second is 2, and so on;
 157      *        must be between <code>1</code> and the number of columns
 158      *        in the rowset, inclusive
 159      * @param property <code>true</code> if the given column is
 160      *                 automatically incremented; <code>false</code>
 161      *                 otherwise
 162      * @throws SQLException if a database access error occurs or
 163      *         the given index is out of bounds
 164      */
 165     public void setAutoIncrement(int columnIndex, boolean property) throws SQLException {
 166         checkColRange(columnIndex);
 167         colInfo[columnIndex].autoIncrement = property;
 168     }
 169 
 170     /**
 171      * Sets whether the name of the designated column is case sensitive to
 172      * the given <code>boolean</code>.
 173      *
 174      * @param columnIndex the first column is 1, the second is 2, and so on;
 175      *        must be between <code>1</code> and the number of columns
 176      *        in the rowset, inclusive
 177      * @param property <code>true</code> to indicate that the column
 178      *                 name is case sensitive; <code>false</code> otherwise
 179      * @throws SQLException if a database access error occurs or
 180      *         the given column number is out of bounds
 181      */
 182     public void setCaseSensitive(int columnIndex, boolean property) throws SQLException {
 183         checkColRange(columnIndex);
 184         colInfo[columnIndex].caseSensitive = property;
 185     }
 186 
 187     /**
 188      * Sets whether a value stored in the designated column can be used
 189      * in a <code>WHERE</code> clause to the given <code>boolean</code> value.
 190      *
 191      * @param columnIndex the first column is 1, the second is 2, and so on;
 192      *                    must be between <code>1</code> and the number
 193      *                    of columns in the rowset, inclusive
 194      * @param property <code>true</code> to indicate that a column
 195      *                 value can be used in a <code>WHERE</code> clause;
 196      *                 <code>false</code> otherwise
 197      *
 198      * @throws SQLException if a database access error occurs or
 199      *         the given column number is out of bounds
 200      */
 201     public void setSearchable(int columnIndex, boolean property)
 202         throws SQLException {
 203         checkColRange(columnIndex);
 204         colInfo[columnIndex].searchable = property;
 205     }
 206 
 207     /**
 208      * Sets whether a value stored in the designated column is a cash
 209      * value to the given <code>boolean</code>.
 210      *
 211      * @param columnIndex the first column is 1, the second is 2, and so on;
 212      * must be between <code>1</code> and the number of columns,
 213      * inclusive between <code>1</code> and the number of columns, inclusive
 214      * @param property true if the value is a cash value; false otherwise.
 215      * @throws SQLException if a database access error occurs
 216      *         or the given column number is out of bounds
 217      */
 218     public void setCurrency(int columnIndex, boolean property)
 219         throws SQLException {
 220         checkColRange(columnIndex);
 221         colInfo[columnIndex].currency = property;
 222     }
 223 
 224     /**
 225      * Sets whether a value stored in the designated column can be set
 226      * to <code>NULL</code> to the given constant from the interface
 227      * <code>ResultSetMetaData</code>.
 228      *
 229      * @param columnIndex the first column is 1, the second is 2, and so on;
 230      *        must be between <code>1</code> and the number of columns, inclusive
 231      * @param property one of the following <code>ResultSetMetaData</code> constants:
 232      *                 <code>columnNoNulls</code>,
 233      *                 <code>columnNullable</code>, or
 234      *                 <code>columnNullableUnknown</code>
 235      *
 236      * @throws SQLException if a database access error occurs,
 237      *         the given column number is out of bounds, or the value supplied
 238      *         for the <i>property</i> parameter is not one of the following
 239      *         constants:
 240      *           <code>ResultSetMetaData.columnNoNulls</code>,
 241      *           <code>ResultSetMetaData.columnNullable</code>, or
 242      *           <code>ResultSetMetaData.columnNullableUnknown</code>
 243      */
 244     public void setNullable(int columnIndex, int property) throws SQLException {
 245         if ((property < ResultSetMetaData.columnNoNulls) ||
 246             property > ResultSetMetaData.columnNullableUnknown) {
 247                 throw new SQLException("Invalid nullable constant set. Must be " +
 248                     "either columnNoNulls, columnNullable or columnNullableUnknown");
 249         }
 250         checkColRange(columnIndex);
 251         colInfo[columnIndex].nullable = property;
 252     }
 253 
 254     /**
 255      * Sets whether a value stored in the designated column is a signed
 256      * number to the given <code>boolean</code>.