Class RowSetMetaDataImpl

java.lang.Object
javax.sql.rowset.RowSetMetaDataImpl
All Implemented Interfaces:
Serializable, ResultSetMetaData, Wrapper, 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.

Since:
1.5
See Also:
  • Field Summary

  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a RowSetMetaDataImpl object.
  • Method Summary

    Modifier and Type
    Method
    Description
    getCatalogName(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.
    int
    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.
    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.
    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.
    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.
    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.
    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
    isWrapperFor(Class<?> interfaces)
    Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.
    boolean
    isWritable(int columnIndex)
    Indicates whether it is possible for a write operation on the designated column to succeed.
    void
    setAutoIncrement(int columnIndex, boolean property)
    Sets whether the designated column is automatically numbered, thus read-only, to the given boolean value.
    void
    setCaseSensitive(int columnIndex, boolean property)
    Sets whether the name of the designated column is case sensitive to the given boolean.
    void
    setCatalogName(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(int columnIndex, int size)
    Sets the normal maximum number of chars in the designated column to the given number.
    void
    setColumnLabel(int columnIndex, String label)
    Sets the suggested column label for use in printouts and displays, if any, to label.
    void
    setColumnName(int columnIndex, String columnName)
    Sets the column name of the designated column to the given name.
    void
    setColumnType(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(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(int columnIndex, boolean property)
    Sets whether a value stored in the designated column is a cash value to the given boolean.
    void
    setNullable(int columnIndex, int property)
    Sets whether a value stored in the designated column can be set to NULL to the given constant from the interface ResultSetMetaData.
    void
    setPrecision(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(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(int columnIndex, String schemaName)
    Sets the designated column's table's schema name, if any, to schemaName.
    void
    setSearchable(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(int columnIndex, boolean property)
    Sets whether a value stored in the designated column is a signed number to the given boolean.
    void
    setTableName(int columnIndex, String tableName)
    Sets the name of the table from which the designated column was derived to the given table name.
    <T> T
    unwrap(Class<T> iface)
    Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.
  • Constructor Details

    • RowSetMetaDataImpl

      public RowSetMetaDataImpl()
      Constructs a RowSetMetaDataImpl object.
  • Method Details

    • 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 in interface RowSetMetaData
      Parameters:
      columnCount - an int giving the number of columns in the RowSet object
      Throws:
      SQLException - 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 in interface RowSetMetaData
      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
    • 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 in interface RowSetMetaData
      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 - 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 in interface RowSetMetaData
      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
    • 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 in interface RowSetMetaData
      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
    • 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 interface ResultSetMetaData.
      Specified by:
      setNullable in interface RowSetMetaData
      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, 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
    • 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 in interface RowSetMetaData
      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 - 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 in interface RowSetMetaData
      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 - 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 is null, the column label is set to an empty string ("").
      Specified by:
      setColumnLabel in interface RowSetMetaData
      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 - 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 in interface RowSetMetaData
      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 - 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 in interface RowSetMetaData
      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 - 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 in interface RowSetMetaData
      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 - 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 in interface RowSetMetaData
      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 - 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 in interface RowSetMetaData
      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 - 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 in interface RowSetMetaData
      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 - 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