Class RowSetMetaDataImpl
java.lang.Object
javax.sql.rowset.RowSetMetaDataImpl
- All Implemented Interfaces:
- Serializable,- ResultSetMetaData,- Wrapper,- RowSetMetaData
Provides implementations for the methods that set and get
 metadata information about a 
RowSet object's columns.
 A RowSetMetaDataImpl object keeps track of the
 number of columns in the rowset and maintains an internal array
 of column attributes for each column.
 
 A RowSet object creates a RowSetMetaDataImpl
 object internally in order to set and retrieve information about
 its columns.
 
 NOTE: All metadata in a RowSetMetaDataImpl object
 should be considered as unavailable until the RowSet object
 that it describes is populated.
 Therefore, any RowSetMetaDataImpl method that retrieves information
 is defined as having unspecified behavior when it is called
 before the RowSet object contains data.
- Since:
- 1.5
- See Also:
- 
Field SummaryFields declared in interface java.sql.ResultSetMetaDatacolumnNoNulls, columnNullable, columnNullableUnknown
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetCatalogName(int columnIndex) Retrieves the catalog name of the table from which the value in the designated column was derived.getColumnClassName(int columnIndex) Retrieves the fully-qualified name of the class in the Java programming language to which a value in the designated column will be mapped.intRetrieves the number of columns in theRowSetobject for which thisRowSetMetaDataImplobject was created.intgetColumnDisplaySize(int columnIndex) Retrieves the normal maximum width in chars of the designated column.getColumnLabel(int columnIndex) Retrieves the suggested column title for the designated column for use in printouts and displays.getColumnName(int columnIndex) Retrieves the name of the designated column.intgetColumnType(int columnIndex) Retrieves the type code (one of thejava.sql.Typesconstants) for the SQL type of the value stored in the designated column.getColumnTypeName(int columnIndex) Retrieves the DBMS-specific type name for values stored in the designated column.intgetPrecision(int columnIndex) Retrieves the total number of digits for values stored in the designated column.intgetScale(int columnIndex) Retrieves the number of digits to the right of the decimal point for values stored in the designated column.getSchemaName(int columnIndex) Retrieves the schema name of the table from which the value in the designated column was derived.getTableName(int columnIndex) Retrieves the name of the table from which the value in the designated column was derived.booleanisAutoIncrement(int columnIndex) Retrieves whether a value stored in the designated column is automatically numbered, and thus readonly.booleanisCaseSensitive(int columnIndex) Indicates whether the case of the designated column's name matters.booleanisCurrency(int columnIndex) Indicates whether a value stored in the designated column is a cash value.booleanisDefinitelyWritable(int columnIndex) Indicates whether a write operation on the designated column will definitely succeed.intisNullable(int columnIndex) Retrieves a constant indicating whether it is possible to store aNULLvalue in the designated column.booleanisReadOnly(int columnIndex) Indicates whether the designated column is definitely not writable, thus readonly.booleanisSearchable(int columnIndex) Indicates whether a value stored in the designated column can be used in aWHEREclause.booleanisSigned(int columnIndex) Indicates whether a value stored in the designated column is a signed number.booleanisWrapperFor(Class<?> interfaces) Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.booleanisWritable(int columnIndex) Indicates whether it is possible for a write operation on the designated column to succeed.voidsetAutoIncrement(int columnIndex, boolean property) Sets whether the designated column is automatically numbered, thus read-only, to the givenbooleanvalue.voidsetCaseSensitive(int columnIndex, boolean property) Sets whether the name of the designated column is case sensitive to the givenboolean.voidsetCatalogName(int columnIndex, String catalogName) Sets the catalog name of the table from which the designated column was derived to catalogName.voidsetColumnCount(int columnCount) Sets to the given number the number of columns in theRowSetobject for which thisRowSetMetaDataImplobject was created.voidsetColumnDisplaySize(int columnIndex, int size) Sets the normal maximum number of chars in the designated column to the given number.voidsetColumnLabel(int columnIndex, String label) Sets the suggested column label for use in printouts and displays, if any, to label.voidsetColumnName(int columnIndex, String columnName) Sets the column name of the designated column to the given name.voidsetColumnType(int columnIndex, int SQLType) Sets the SQL type code for values stored in the designated column to the given type code from the classjava.sql.Types.voidsetColumnTypeName(int columnIndex, String typeName) Sets the type name used by the data source for values stored in the designated column to the given type name.voidsetCurrency(int columnIndex, boolean property) Sets whether a value stored in the designated column is a cash value to the givenboolean.voidsetNullable(int columnIndex, int property) Sets whether a value stored in the designated column can be set toNULLto the given constant from the interfaceResultSetMetaData.voidsetPrecision(int columnIndex, int precision) Sets the total number of decimal digits in a value stored in the designated column to the given number.voidsetScale(int columnIndex, int scale) Sets the number of digits to the right of the decimal point in a value stored in the designated column to the given number.voidsetSchemaName(int columnIndex, String schemaName) Sets the designated column's table's schema name, if any, to schemaName.voidsetSearchable(int columnIndex, boolean property) Sets whether a value stored in the designated column can be used in aWHEREclause to the givenbooleanvalue.voidsetSigned(int columnIndex, boolean property) Sets whether a value stored in the designated column is a signed number to the givenboolean.voidsetTableName(int columnIndex, String tableName) Sets the name of the table from which the designated column was derived to the given table name.<T> TReturns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.
- 
Constructor Details- 
RowSetMetaDataImplpublic RowSetMetaDataImpl()Constructs aRowSetMetaDataImplobject.
 
- 
- 
Method Details- 
setColumnCountSets to the given number the number of columns in theRowSetobject for which thisRowSetMetaDataImplobject was created.- Specified by:
- setColumnCountin interface- RowSetMetaData
- Parameters:
- columnCount- an- intgiving the number of columns in the- RowSetobject
- Throws:
- SQLException- if the given number is equal to or less than zero
 
- 
setAutoIncrementSets whether the designated column is automatically numbered, thus read-only, to the givenbooleanvalue.- Specified by:
- setAutoIncrementin interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns in the rowset, inclusive
- property-- trueif the given column is automatically incremented;- falseotherwise
- Throws:
- SQLException- if a database access error occurs or the given index is out of bounds
 
- 
setCaseSensitiveSets whether the name of the designated column is case sensitive to the givenboolean.- Specified by:
- setCaseSensitivein interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns in the rowset, inclusive
- property-- trueto indicate that the column name is case sensitive;- falseotherwise
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
setSearchableSets whether a value stored in the designated column can be used in aWHEREclause to the givenbooleanvalue.- Specified by:
- setSearchablein interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns in the rowset, inclusive
- property-- trueto indicate that a column value can be used in a- WHEREclause;- falseotherwise
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
setCurrencySets whether a value stored in the designated column is a cash value to the givenboolean.- Specified by:
- setCurrencyin interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive between- 1and the number of columns, inclusive
- property- true if the value is a cash value; false otherwise.
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
setNullableSets whether a value stored in the designated column can be set toNULLto the given constant from the interfaceResultSetMetaData.- Specified by:
- setNullablein interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- property- one of the following- ResultSetMetaDataconstants:- columnNoNulls,- columnNullable, or- columnNullableUnknown
- Throws:
- SQLException- if a database access error occurs, the given column number is out of bounds, or the value supplied for the property parameter is not one of the following constants:- ResultSetMetaData.columnNoNulls,- ResultSetMetaData.columnNullable, or- ResultSetMetaData.columnNullableUnknown
 
- 
setSignedSets whether a value stored in the designated column is a signed number to the givenboolean.- Specified by:
- setSignedin interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- property-- trueto indicate that a column value is a signed number;- falseto indicate that it is not
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
setColumnDisplaySizeSets the normal maximum number of chars in the designated column to the given number.- Specified by:
- setColumnDisplaySizein interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- size- the maximum size of the column in chars; must be- 0or more
- Throws:
- SQLException- if a database access error occurs, the given column number is out of bounds, or size is less than- 0
 
- 
setColumnLabelSets the suggested column label for use in printouts and displays, if any, to label. If label isnull, the column label is set to an empty string ("").- Specified by:
- setColumnLabelin interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- label- the column label to be used in printouts and displays; if the column label is- null, an empty- Stringis set
- Throws:
- SQLException- if a database access error occurs or the given column index is out of bounds
 
- 
setColumnNameSets the column name of the designated column to the given name.- Specified by:
- setColumnNamein interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- columnName- a- Stringobject indicating the column name; if the given name is- null, an empty- Stringis set
- Throws:
- SQLException- if a database access error occurs or the given column index is out of bounds
 
- 
setSchemaNameSets the designated column's table's schema name, if any, to schemaName. If schemaName isnull, the schema name is set to an empty string ("").- Specified by:
- setSchemaNamein interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- schemaName- the schema name for the table from which a value in the designated column was derived; may be an empty- Stringor- null
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
setPrecisionSets the total number of decimal digits in a value stored in the designated column to the given number.- Specified by:
- setPrecisionin interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- precision- the total number of decimal digits; must be- 0or more
- Throws:
- SQLException- if a database access error occurs, columnIndex is out of bounds, or precision is less than- 0
 
- 
setScaleSets the number of digits to the right of the decimal point in a value stored in the designated column to the given number.- Specified by:
- setScalein interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- scale- the number of digits to the right of the decimal point; must be zero or greater
- Throws:
- SQLException- if a database access error occurs, columnIndex is out of bounds, or scale is less than- 0
 
- 
setTableNameSets the name of the table from which the designated column was derived to the given table name.- Specified by:
- setTableNamein interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- tableName- the column's table name; may be- nullor an empty string
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
setCatalogNameSets the catalog name of the table from which the designated column was derived to catalogName. If catalogName isnull, the catalog name is set to an empty string.- Specified by:
- setCatalogNamein interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- catalogName- the column's table's catalog name; if the catalogName is- null, an empty- Stringis set
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
setColumnTypeSets the SQL type code for values stored in the designated column to the given type code from the classjava.sql.Types.- Specified by:
- setColumnTypein interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- SQLType- the designated column's SQL type, which must be one of the constants in the class- java.sql.Types
- Throws:
- SQLException- if a database access error occurs, the given column number is out of bounds, or the column type specified is not one of the constants in- java.sql.Types
- See Also:
 
- 
setColumnTypeNameSets the type name used by the data source for values stored in the designated column to the given type name.- Specified by:
- setColumnTypeNamein interface- RowSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- typeName- the data source-specific type name; if typeName is- null, an empty- Stringis set
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
getColumnCountRetrieves the number of columns in theRowSetobject for which thisRowSetMetaDataImplobject was created.- Specified by:
- getColumnCountin interface- ResultSetMetaData
- Returns:
- the number of columns
- Throws:
- SQLException- if an error occurs determining the column count
 
- 
isAutoIncrementRetrieves whether a value stored in the designated column is automatically numbered, and thus readonly.- Specified by:
- isAutoIncrementin interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- trueif the column is automatically numbered;- falseotherwise
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
isCaseSensitiveIndicates whether the case of the designated column's name matters.- Specified by:
- isCaseSensitivein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- trueif the column name is case sensitive;- falseotherwise
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
isSearchableIndicates whether a value stored in the designated column can be used in aWHEREclause.- Specified by:
- isSearchablein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- trueif a value in the designated column can be used in a- WHEREclause;- falseotherwise
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
isCurrencyIndicates whether a value stored in the designated column is a cash value.- Specified by:
- isCurrencyin interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- trueif a value in the designated column is a cash value;- falseotherwise
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
isNullableRetrieves a constant indicating whether it is possible to store aNULLvalue in the designated column.- Specified by:
- isNullablein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- a constant from the ResultSetMetaDatainterface; eithercolumnNoNulls,columnNullable, orcolumnNullableUnknown
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
isSignedIndicates whether a value stored in the designated column is a signed number.- Specified by:
- isSignedin interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- trueif a value in the designated column is a signed number;- falseotherwise
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
getColumnDisplaySizeRetrieves the normal maximum width in chars of the designated column.- Specified by:
- getColumnDisplaySizein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- the maximum number of chars that can be displayed in the designated column
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
getColumnLabelRetrieves the suggested column title for the designated column for use in printouts and displays.- Specified by:
- getColumnLabelin interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- the suggested column name to use in printouts and displays
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
getColumnNameRetrieves the name of the designated column.- Specified by:
- getColumnNamein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- the column name of the designated column
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
getSchemaNameRetrieves the schema name of the table from which the value in the designated column was derived.- Specified by:
- getSchemaNamein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- the schema name or an empty Stringif no schema name is available
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
getPrecisionRetrieves the total number of digits for values stored in the designated column.- Specified by:
- getPrecisionin interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- the precision for values stored in the designated column
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
getScaleRetrieves the number of digits to the right of the decimal point for values stored in the designated column.- Specified by:
- getScalein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- the scale for values stored in the designated column
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
getTableNameRetrieves the name of the table from which the value in the designated column was derived.- Specified by:
- getTableNamein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- the table name or an empty Stringif no table name is available
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
getCatalogNameRetrieves the catalog name of the table from which the value in the designated column was derived.- Specified by:
- getCatalogNamein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- the catalog name of the column's table or an empty
         Stringif no catalog name is available
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
getColumnTypeRetrieves the type code (one of thejava.sql.Typesconstants) for the SQL type of the value stored in the designated column.- Specified by:
- getColumnTypein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- an intrepresenting the SQL type of values stored in the designated column
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
- See Also:
 
- 
getColumnTypeNameRetrieves the DBMS-specific type name for values stored in the designated column.- Specified by:
- getColumnTypeNamein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- the type name used by the data source
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
isReadOnlyIndicates whether the designated column is definitely not writable, thus readonly.- Specified by:
- isReadOnlyin interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- trueif this- RowSetobject is read-Only and thus not updatable;- falseotherwise
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
isWritableIndicates whether it is possible for a write operation on the designated column to succeed. A return value oftruemeans that a write operation may or may not succeed.- Specified by:
- isWritablein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- trueif a write operation on the designated column may will succeed;- falseotherwise
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
isDefinitelyWritableIndicates whether a write operation on the designated column will definitely succeed.- Specified by:
- isDefinitelyWritablein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- trueif a write operation on the designated column will definitely succeed;- falseotherwise
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
getColumnClassNameRetrieves the fully-qualified name of the class in the Java programming language to which a value in the designated column will be mapped. For example, if the value is anint, the class name returned by this method will bejava.lang.Integer.If the value in the designated column has a custom mapping, this method returns the name of the class that implements SQLData. When the methodResultSet.getObjectis called to retrieve a value from the designated column, it will create an instance of this class or one of its subclasses.- Specified by:
- getColumnClassNamein interface- ResultSetMetaData
- Parameters:
- columnIndex- the first column is 1, the second is 2, and so on; must be between- 1and the number of columns, inclusive
- Returns:
- the fully-qualified name of the class in the Java programming
        language that would be used by the method RowSet.getObjectto retrieve the value in the specified column. This is the class name used for custom mapping when there is a custom mapping.
- Throws:
- SQLException- if a database access error occurs or the given column number is out of bounds
 
- 
unwrapReturns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. The result may be either the object found to implement the interface or a proxy for that object. If the receiver implements the interface then that is the object. If the receiver is a wrapper and the wrapped object implements the interface then that is the object. Otherwise the object is the result of callingunwraprecursively on the wrapped object. If the receiver is not a wrapper and does not implement the interface, then anSQLExceptionis thrown.- Specified by:
- unwrapin interface- Wrapper
- Type Parameters:
- T- the type of the class modeled by this Class object
- Parameters:
- iface- A Class defining an interface that the result must implement.
- Returns:
- an object that implements the interface. May be a proxy for the actual implementing object.
- Throws:
- SQLException- If no object found that implements the interface
- Since:
- 1.6
 
- 
isWrapperForReturns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively callingisWrapperForon the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared tounwrapso that callers can use this method to avoid expensiveunwrapcalls that may fail. If this method returns true then callingunwrapwith the same argument should succeed.- Specified by:
- isWrapperForin interface- Wrapper
- Parameters:
- interfaces- a Class defining an interface.
- Returns:
- true if this implements the interface or directly or indirectly wraps an object that does.
- Throws:
- SQLException- if an error occurs while determining whether this is a wrapper for an object with the given interface.
- Since:
- 1.6
 
 
-