RowSetMetaDataImpl (Java 2 Platform SE 5.0) (original) (raw)


javax.sql.rowset

Class RowSetMetaDataImpl

java.lang.Object extended by javax.sql.rowset.RowSetMetaDataImpl

All Implemented Interfaces:

Serializable, ResultSetMetaData, RowSetMetaData


public class RowSetMetaDataImpl

extends Object

implements RowSetMetaData, Serializable

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.

See Also:

Serialized Form


Field Summary
Fields inherited from interface java.sql.ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown
Constructor Summary
RowSetMetaDataImpl()
Method Summary
String getCatalogName(int columnIndex) Retrieves the catalog name of the table from which the value in the designated column was derived.
String 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.
int getColumnCount() Retrieves the number of columns in the RowSet object for which this RowSetMetaDataImpl object was created.
int getColumnDisplaySize(int columnIndex) Retrieves the normal maximum width in chars of the designated column.
String getColumnLabel(int columnIndex) Retrieves the the suggested column title for the designated column for use in printouts and displays.
String getColumnName(int columnIndex) Retrieves the name of the designated column.
int getColumnType(int columnIndex) Retrieves the type code (one of the java.sql.Types constants) for the SQL type of the value stored in the designated column.
String getColumnTypeName(int columnIndex) Retrieves the DBMS-specific type name for values stored in the designated column.
int getPrecision(int columnIndex) Retrieves the total number of digits for values stored in the designated column.
int getScale(int columnIndex) Retrieves the number of digits to the right of the decimal point for values stored in the designated column.
String getSchemaName(int columnIndex) Retrieves the schema name of the table from which the value in the designated column was derived.
String getTableName(int columnIndex) Retrieves the name of the table from which the value in the designated column was derived.
boolean isAutoIncrement(int columnIndex) Retrieves whether a value stored in the designated column is automatically numbered, and thus readonly.
boolean isCaseSensitive(int columnIndex) Indicates whether the case of the designated column's name matters.
boolean isCurrency(int columnIndex) Indicates whether a value stored in the designated column is a cash value.
boolean isDefinitelyWritable(int columnIndex) Indicates whether a write operation on the designated column will definitely succeed.
int isNullable(int columnIndex) Retrieves a constant indicating whether it is possible to store a NULL value in the designated column.
boolean isReadOnly(int columnIndex) Indicates whether the designated column is definitely not writable, thus readonly.
boolean isSearchable(int columnIndex) Indicates whether a value stored in the designated column can be used in a WHERE clause.
boolean isSigned(int columnIndex) Indicates whether a value stored in the designated column is a signed number.
boolean isWritable(int columnIndex) Indicates whether it is possible for a write operation on the designated column to succeed.
void [setAutoIncrement](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setAutoIncrement%28int, boolean%29)(int columnIndex, boolean property) Sets whether the designated column is automatically numbered, thus read-only, to the given boolean value.
void [setCaseSensitive](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setCaseSensitive%28int, boolean%29)(int columnIndex, boolean property) Sets whether the name of the designated column is case sensitive to the given boolean.
void [setCatalogName](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setCatalogName%28int, java.lang.String%29)(int columnIndex,String catalogName) Sets the catalog name of the table from which the designated column was derived to catalogName.
void setColumnCount(int columnCount) Sets to the given number the number of columns in the RowSet object for which this RowSetMetaDataImpl object was created.
void [setColumnDisplaySize](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setColumnDisplaySize%28int, int%29)(int columnIndex, int size) Sets the normal maximum number of chars in the designated column to the given number.
void [setColumnLabel](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setColumnLabel%28int, java.lang.String%29)(int columnIndex,String label) Sets the suggested column label for use in printouts and displays, if any, to label.
void [setColumnName](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setColumnName%28int, java.lang.String%29)(int columnIndex,String columnName) Sets the column name of the designated column to the given name.
void [setColumnType](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setColumnType%28int, int%29)(int columnIndex, int SQLType) Sets the SQL type code for values stored in the designated column to the given type code from the class java.sql.Types.
void [setColumnTypeName](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setColumnTypeName%28int, java.lang.String%29)(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.
void [setCurrency](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setCurrency%28int, boolean%29)(int columnIndex, boolean property) Sets whether a value stored in the designated column is a cash value to the given boolean.
void [setNullable](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setNullable%28int, int%29)(int columnIndex, int property) Sets whether a value stored in the designated column can be set to NULL to the given constant from the interfaceResultSetMetaData.
void [setPrecision](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setPrecision%28int, int%29)(int columnIndex, int precision) Sets the total number of decimal digits in a value stored in the designated column to the given number.
void [setScale](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setScale%28int, int%29)(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.
void [setSchemaName](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setSchemaName%28int, java.lang.String%29)(int columnIndex,String schemaName) Sets the designated column's table's schema name, if any, to schemaName.
void [setSearchable](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setSearchable%28int, boolean%29)(int columnIndex, boolean property) Sets whether a value stored in the designated column can be used in a WHERE clause to the given boolean value.
void [setSigned](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setSigned%28int, boolean%29)(int columnIndex, boolean property) Sets whether a value stored in the designated column is a signed number to the given boolean.
void [setTableName](../../../javax/sql/rowset/RowSetMetaDataImpl.html#setTableName%28int, java.lang.String%29)(int columnIndex,String tableName) Sets the name of the table from which the designated column was derived to the given table name.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, [wait](../../../java/lang/Object.html#wait%28long, int%29)
Constructor Detail

RowSetMetaDataImpl

public RowSetMetaDataImpl()

Method Detail

setColumnCount

public void setColumnCount(int columnCount) throws SQLException

Sets to the given number the number of columns in the RowSet object for which this RowSetMetaDataImpl object was created.

Specified by:

[setColumnCount](../../../javax/sql/RowSetMetaData.html#setColumnCount%28int%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnCount - an int giving the number of columns in the RowSet object

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if the given number is equal to or less than zero


setAutoIncrement

public void setAutoIncrement(int columnIndex, boolean property) throws SQLException

Sets whether the designated column is automatically numbered, thus read-only, to the given boolean value.

Specified by:

[setAutoIncrement](../../../javax/sql/RowSetMetaData.html#setAutoIncrement%28int, boolean%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns in the rowset, inclusive

property - true if the given column is automatically incremented; false otherwise

Throws:

`SQLException` - if a database access error occurs or the given index is out of bounds

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs


setCaseSensitive

public void setCaseSensitive(int columnIndex, boolean property) throws SQLException

Sets whether the name of the designated column is case sensitive to the given boolean.

Specified by:

[setCaseSensitive](../../../javax/sql/RowSetMetaData.html#setCaseSensitive%28int, boolean%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns in the rowset, inclusive

property - true to indicate that the column name is case sensitive; false otherwise

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


setSearchable

public void setSearchable(int columnIndex, boolean property) throws SQLException

Sets whether a value stored in the designated column can be used in a WHERE clause to the given boolean value.

Specified by:

[setSearchable](../../../javax/sql/RowSetMetaData.html#setSearchable%28int, boolean%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns in the rowset, inclusive

property - true to indicate that a column value can be used in a WHERE clause;false otherwise

Throws:

`SQLException` - if a database access error occurs or the given column number is out of bounds

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs


setCurrency

public void setCurrency(int columnIndex, boolean property) throws SQLException

Sets whether a value stored in the designated column is a cash value to the given boolean.

Specified by:

[setCurrency](../../../javax/sql/RowSetMetaData.html#setCurrency%28int, boolean%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive between 1 and 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

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs


setNullable

public void setNullable(int columnIndex, int property) throws SQLException

Sets whether a value stored in the designated column can be set to NULL to the given constant from the interfaceResultSetMetaData.

Specified by:

[setNullable](../../../javax/sql/RowSetMetaData.html#setNullable%28int, int%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

property - one of the following ResultSetMetaData constants:columnNoNulls,columnNullable, orcolumnNullableUnknown

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, orResultSetMetaData.columnNullableUnknown

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs


setSigned

public void setSigned(int columnIndex, boolean property) throws SQLException

Sets whether a value stored in the designated column is a signed number to the given boolean.

Specified by:

[setSigned](../../../javax/sql/RowSetMetaData.html#setSigned%28int, boolean%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

property - true to indicate that a column value is a signed number;false to indicate that it is not

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


setColumnDisplaySize

public void setColumnDisplaySize(int columnIndex, int size) throws SQLException

Sets the normal maximum number of chars in the designated column to the given number.

Specified by:

[setColumnDisplaySize](../../../javax/sql/RowSetMetaData.html#setColumnDisplaySize%28int, int%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

size - the maximum size of the column in chars; must be 0 or more

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs, the given column number is out of bounds, or size is less than 0


setColumnLabel

public void setColumnLabel(int columnIndex, String label) throws SQLException

Sets 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:

[setColumnLabel](../../../javax/sql/RowSetMetaData.html#setColumnLabel%28int, java.lang.String%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

label - the column label to be used in printouts and displays; if the column label is null, an empty String is set

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column index is out of bounds


setColumnName

public void setColumnName(int columnIndex, String columnName) throws SQLException

Sets the column name of the designated column to the given name.

Specified by:

[setColumnName](../../../javax/sql/RowSetMetaData.html#setColumnName%28int, java.lang.String%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

columnName - a String object indicating the column name; if the given name is null, an empty String is set

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column index is out of bounds


setSchemaName

public void setSchemaName(int columnIndex, String schemaName) throws SQLException

Sets the designated column's table's schema name, if any, to schemaName. If schemaName is null, the schema name is set to an empty string ("").

Specified by:

[setSchemaName](../../../javax/sql/RowSetMetaData.html#setSchemaName%28int, java.lang.String%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and 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 String or null

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


setPrecision

public void setPrecision(int columnIndex, int precision) throws SQLException

Sets the total number of decimal digits in a value stored in the designated column to the given number.

Specified by:

[setPrecision](../../../javax/sql/RowSetMetaData.html#setPrecision%28int, int%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

precision - the total number of decimal digits; must be 0 or more

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs,columnIndex is out of bounds, or precision is less than 0


setScale

public void setScale(int columnIndex, int scale) throws SQLException

Sets 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:

[setScale](../../../javax/sql/RowSetMetaData.html#setScale%28int, int%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

scale - the number of digits to the right of the decimal point; must be zero or greater

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs, columnIndex is out of bounds, or scale is less than 0


setTableName

public void setTableName(int columnIndex, String tableName) throws SQLException

Sets the name of the table from which the designated column was derived to the given table name.

Specified by:

[setTableName](../../../javax/sql/RowSetMetaData.html#setTableName%28int, java.lang.String%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

tableName - the column's table name; may be null or an empty string

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


setCatalogName

public void setCatalogName(int columnIndex, String catalogName) throws SQLException

Sets the catalog name of the table from which the designated column was derived to catalogName. If catalogName is null, the catalog name is set to an empty string.

Specified by:

[setCatalogName](../../../javax/sql/RowSetMetaData.html#setCatalogName%28int, java.lang.String%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

catalogName - the column's table's catalog name; if the catalogName is null, an empty String is set

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


setColumnType

public void setColumnType(int columnIndex, int SQLType) throws SQLException

Sets the SQL type code for values stored in the designated column to the given type code from the class java.sql.Types.

Specified by:

[setColumnType](../../../javax/sql/RowSetMetaData.html#setColumnType%28int, int%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and 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](../../../java/sql/SQLException.html "class in java.sql") - 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:

Types


setColumnTypeName

public void setColumnTypeName(int columnIndex, String typeName) throws SQLException

Sets the type name used by the data source for values stored in the designated column to the given type name.

Specified by:

[setColumnTypeName](../../../javax/sql/RowSetMetaData.html#setColumnTypeName%28int, java.lang.String%29) in interface [RowSetMetaData](../../../javax/sql/RowSetMetaData.html "interface in javax.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

typeName - the data source-specific type name; if typeName is null, an empty String is set

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


getColumnCount

public int getColumnCount() throws SQLException

Retrieves the number of columns in the RowSet object for which this RowSetMetaDataImpl object was created.

Specified by:

[getColumnCount](../../../java/sql/ResultSetMetaData.html#getColumnCount%28%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Returns:

the number of columns

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if an error occurs determining the column count


isAutoIncrement

public boolean isAutoIncrement(int columnIndex) throws SQLException

Retrieves whether a value stored in the designated column is automatically numbered, and thus readonly.

Specified by:

[isAutoIncrement](../../../java/sql/ResultSetMetaData.html#isAutoIncrement%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

true if the column is automatically numbered; false otherwise

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


isCaseSensitive

public boolean isCaseSensitive(int columnIndex) throws SQLException

Indicates whether the case of the designated column's name matters.

Specified by:

[isCaseSensitive](../../../java/sql/ResultSetMetaData.html#isCaseSensitive%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

true if the column name is case sensitive;false otherwise

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


isSearchable

public boolean isSearchable(int columnIndex) throws SQLException

Indicates whether a value stored in the designated column can be used in a WHERE clause.

Specified by:

[isSearchable](../../../java/sql/ResultSetMetaData.html#isSearchable%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

true if a value in the designated column can be used in aWHERE clause; false otherwise

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


isCurrency

public boolean isCurrency(int columnIndex) throws SQLException

Indicates whether a value stored in the designated column is a cash value.

Specified by:

[isCurrency](../../../java/sql/ResultSetMetaData.html#isCurrency%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

true if a value in the designated column is a cash value;false otherwise

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


isNullable

public int isNullable(int columnIndex) throws SQLException

Retrieves a constant indicating whether it is possible to store a NULL value in the designated column.

Specified by:

[isNullable](../../../java/sql/ResultSetMetaData.html#isNullable%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

a constant from the ResultSetMetaData interface; either columnNoNulls,columnNullable, orcolumnNullableUnknown

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


isSigned

public boolean isSigned(int columnIndex) throws SQLException

Indicates whether a value stored in the designated column is a signed number.

Specified by:

[isSigned](../../../java/sql/ResultSetMetaData.html#isSigned%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

true if if a value in the designated column is a signed number; false otherwise

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


getColumnDisplaySize

public int getColumnDisplaySize(int columnIndex) throws SQLException

Retrieves the normal maximum width in chars of the designated column.

Specified by:

[getColumnDisplaySize](../../../java/sql/ResultSetMetaData.html#getColumnDisplaySize%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

the maximum number of chars that can be displayed in the designated column

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


getColumnLabel

public String getColumnLabel(int columnIndex) throws SQLException

Retrieves the the suggested column title for the designated column for use in printouts and displays.

Specified by:

[getColumnLabel](../../../java/sql/ResultSetMetaData.html#getColumnLabel%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

the suggested column name to use in printouts and displays

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


getColumnName

public String getColumnName(int columnIndex) throws SQLException

Retrieves the name of the designated column.

Specified by:

[getColumnName](../../../java/sql/ResultSetMetaData.html#getColumnName%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

the column name of the designated column

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


getSchemaName

public String getSchemaName(int columnIndex) throws SQLException

Retrieves the schema name of the table from which the value in the designated column was derived.

Specified by:

[getSchemaName](../../../java/sql/ResultSetMetaData.html#getSchemaName%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

the schema name or an empty String if no schema name is available

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


getPrecision

public int getPrecision(int columnIndex) throws SQLException

Retrieves the total number of digits for values stored in the designated column.

Specified by:

[getPrecision](../../../java/sql/ResultSetMetaData.html#getPrecision%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

the precision for values stored in the designated column

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


getScale

public int getScale(int columnIndex) throws SQLException

Retrieves the number of digits to the right of the decimal point for values stored in the designated column.

Specified by:

[getScale](../../../java/sql/ResultSetMetaData.html#getScale%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

the scale for values stored in the designated column

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


getTableName

public String getTableName(int columnIndex) throws SQLException

Retrieves the name of the table from which the value in the designated column was derived.

Specified by:

[getTableName](../../../java/sql/ResultSetMetaData.html#getTableName%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

the table name or an empty String if no table name is available

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


getCatalogName

public String getCatalogName(int columnIndex) throws SQLException

Retrieves the catalog name of the table from which the value in the designated column was derived.

Specified by:

[getCatalogName](../../../java/sql/ResultSetMetaData.html#getCatalogName%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

the catalog name of the column's table or an empty String if no catalog name is available

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


getColumnType

public int getColumnType(int columnIndex) throws SQLException

Retrieves the type code (one of the java.sql.Types constants) for the SQL type of the value stored in the designated column.

Specified by:

[getColumnType](../../../java/sql/ResultSetMetaData.html#getColumnType%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

an int representing the SQL type of values stored in the designated column

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds

See Also:

Types


getColumnTypeName

public String getColumnTypeName(int columnIndex) throws SQLException

Retrieves the DBMS-specific type name for values stored in the designated column.

Specified by:

[getColumnTypeName](../../../java/sql/ResultSetMetaData.html#getColumnTypeName%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

the type name used by the data source

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


isReadOnly

public boolean isReadOnly(int columnIndex) throws SQLException

Indicates whether the designated column is definitely not writable, thus readonly.

Specified by:

[isReadOnly](../../../java/sql/ResultSetMetaData.html#isReadOnly%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

true if this RowSet object is read-Only and thus not updatable; false otherwise

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


isWritable

public boolean isWritable(int columnIndex) throws SQLException

Indicates whether it is possible for a write operation on the designated column to succeed. A return value oftrue means that a write operation may or may not succeed.

Specified by:

[isWritable](../../../java/sql/ResultSetMetaData.html#isWritable%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

true if a write operation on the designated column may will succeed; false otherwise

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


isDefinitelyWritable

public boolean isDefinitelyWritable(int columnIndex) throws SQLException

Indicates whether a write operation on the designated column will definitely succeed.

Specified by:

[isDefinitelyWritable](../../../java/sql/ResultSetMetaData.html#isDefinitelyWritable%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive

Returns:

true if a write operation on the designated column will definitely succeed; false otherwise

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds


getColumnClassName

public String getColumnClassName(int columnIndex) throws SQLException

Retrieves 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 an int, 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 implementsSQLData. When the method ResultSet.getObject is called to retrieve a value from the designated column, it will create an instance of this class or one of its subclasses.

Specified by:

[getColumnClassName](../../../java/sql/ResultSetMetaData.html#getColumnClassName%28int%29) in interface [ResultSetMetaData](../../../java/sql/ResultSetMetaData.html "interface in java.sql")

Parameters:

columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and 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.getObject to retrieve the value in the specified column. This is the class name used for custom mapping when there is a custom mapping.

Throws:

[SQLException](../../../java/sql/SQLException.html "class in java.sql") - if a database access error occurs or the given column number is out of bounds



Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.