Path: blob/master/src/java.sql/share/classes/javax/sql/RowSetMetaData.java
41152 views
/*1* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.sql;2627import java.sql.*;2829/**30* An object that contains information about the columns in a31* {@code RowSet} object. This interface is32* an extension of the {@code ResultSetMetaData} interface with33* methods for setting the values in a {@code RowSetMetaData} object.34* When a {@code RowSetReader} object reads data into a {@code RowSet}35* object, it creates a {@code RowSetMetaData} object and initializes it36* using the methods in the {@code RowSetMetaData} interface. Then the37* reader passes the {@code RowSetMetaData} object to the rowset.38* <P>39* The methods in this interface are invoked internally when an application40* calls the method {@code RowSet.execute}; an application41* programmer would not use them directly.42*43* @since 1.444*/4546public interface RowSetMetaData extends ResultSetMetaData {4748/**49* Sets the number of columns in the {@code RowSet} object to50* the given number.51*52* @param columnCount the number of columns in the {@code RowSet} object53* @throws SQLException if a database access error occurs54*/55void setColumnCount(int columnCount) throws SQLException;5657/**58* Sets whether the designated column is automatically numbered,59* The default is for a {@code RowSet} object's60* columns not to be automatically numbered.61*62* @param columnIndex the first column is 1, the second is 2, ...63* @param property {@code true} if the column is automatically64* numbered; {@code false} if it is not65*66* @throws SQLException if a database access error occurs67*/68void setAutoIncrement(int columnIndex, boolean property) throws SQLException;6970/**71* Sets whether the designated column is case sensitive.72* The default is {@code false}.73*74* @param columnIndex the first column is 1, the second is 2, ...75* @param property {@code true} if the column is case sensitive;76* {@code false} if it is not77*78* @throws SQLException if a database access error occurs79*/80void setCaseSensitive(int columnIndex, boolean property) throws SQLException;8182/**83* Sets whether the designated column can be used in a where clause.84* The default is {@code false}.85*86* @param columnIndex the first column is 1, the second is 2, ...87* @param property {@code true} if the column can be used in a88* {@code WHERE} clause; {@code false} if it cannot89*90* @throws SQLException if a database access error occurs91*/92void setSearchable(int columnIndex, boolean property) throws SQLException;9394/**95* Sets whether the designated column is a cash value.96* The default is {@code false}.97*98* @param columnIndex the first column is 1, the second is 2, ...99* @param property {@code true} if the column is a cash value;100* {@code false} if it is not101*102* @throws SQLException if a database access error occurs103*/104void setCurrency(int columnIndex, boolean property) throws SQLException;105106/**107* Sets whether the designated column's value can be set to108* {@code NULL}.109* The default is {@code ResultSetMetaData.columnNullableUnknown}110*111* @param columnIndex the first column is 1, the second is 2, ...112* @param property one of the following constants:113* {@code ResultSetMetaData.columnNoNulls},114* {@code ResultSetMetaData.columnNullable}, or115* {@code ResultSetMetaData.columnNullableUnknown}116*117* @throws SQLException if a database access error occurs118*/119void setNullable(int columnIndex, int property) throws SQLException;120121/**122* Sets whether the designated column is a signed number.123* The default is {@code false}.124*125* @param columnIndex the first column is 1, the second is 2, ...126* @param property {@code true} if the column is a signed number;127* {@code false} if it is not128*129* @throws SQLException if a database access error occurs130*/131void setSigned(int columnIndex, boolean property) throws SQLException;132133/**134* Sets the designated column's normal maximum width in chars to the135* given {@code int}.136*137* @param columnIndex the first column is 1, the second is 2, ...138* @param size the normal maximum number of characters for139* the designated column140*141* @throws SQLException if a database access error occurs142*/143void setColumnDisplaySize(int columnIndex, int size) throws SQLException;144145/**146* Sets the suggested column title for use in printouts and147* displays, if any, to the given {@code String}.148*149* @param columnIndex the first column is 1, the second is 2, ...150* @param label the column title151* @throws SQLException if a database access error occurs152*/153void setColumnLabel(int columnIndex, String label) throws SQLException;154155/**156* Sets the name of the designated column to the given {@code String}.157*158* @param columnIndex the first column is 1, the second is 2, ...159* @param columnName the designated column's name160* @throws SQLException if a database access error occurs161*/162void setColumnName(int columnIndex, String columnName) throws SQLException;163164/**165* Sets the name of the designated column's table's schema, if any, to166* the given {@code String}.167*168* @param columnIndex the first column is 1, the second is 2, ...169* @param schemaName the schema name170* @throws SQLException if a database access error occurs171*/172void setSchemaName(int columnIndex, String schemaName) throws SQLException;173174/**175* Sets the designated column's number of decimal digits to the176* given {@code int}.177*178* @param columnIndex the first column is 1, the second is 2, ...179* @param precision the total number of decimal digits180* @throws SQLException if a database access error occurs181*/182void setPrecision(int columnIndex, int precision) throws SQLException;183184/**185* Sets the designated column's number of digits to the186* right of the decimal point to the given {@code int}.187*188* @param columnIndex the first column is 1, the second is 2, ...189* @param scale the number of digits to right of decimal point190* @throws SQLException if a database access error occurs191*/192void setScale(int columnIndex, int scale) throws SQLException;193194/**195* Sets the designated column's table name, if any, to the given196* {@code String}.197*198* @param columnIndex the first column is 1, the second is 2, ...199* @param tableName the column's table name200* @throws SQLException if a database access error occurs201*/202void setTableName(int columnIndex, String tableName) throws SQLException;203204/**205* Sets the designated column's table's catalog name, if any, to the given206* {@code String}.207*208* @param columnIndex the first column is 1, the second is 2, ...209* @param catalogName the column's catalog name210* @throws SQLException if a database access error occurs211*/212void setCatalogName(int columnIndex, String catalogName) throws SQLException;213214/**215* Sets the designated column's SQL type to the one given.216*217* @param columnIndex the first column is 1, the second is 2, ...218* @param SQLType the column's SQL type219* @throws SQLException if a database access error occurs220* @see Types221*/222void setColumnType(int columnIndex, int SQLType) throws SQLException;223224/**225* Sets the designated column's type name that is specific to the226* data source, if any, to the given {@code String}.227*228* @param columnIndex the first column is 1, the second is 2, ...229* @param typeName data source specific type name.230* @throws SQLException if a database access error occurs231*/232void setColumnTypeName(int columnIndex, String typeName) throws SQLException;233234}235236237