|
Java™ Platform Standard Ed. 6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.sql.rowset.RowSetMetaDataImpl
public class RowSetMetaDataImpl
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.
| 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 |
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. |
|
|
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. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RowSetMetaDataImpl()
| Method Detail |
|---|
public void setColumnCount(int columnCount)
throws SQLException
RowSet
object for which this RowSetMetaDataImpl object was created.
setColumnCount in interface RowSetMetaDatacolumnCount - an int giving the number of columns in the
RowSet object
SQLException - if the given number is equal to or less than zero
public void setAutoIncrement(int columnIndex,
boolean property)
throws SQLException
boolean
value.
setAutoIncrement in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns
in the rowset, inclusiveproperty - true if the given column is
automatically incremented; false
otherwise
SQLException - if a database access error occurs or
the given index is out of bounds
SQLException - if a database access error occurs
public void setCaseSensitive(int columnIndex,
boolean property)
throws SQLException
boolean.
setCaseSensitive in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns
in the rowset, inclusiveproperty - true to indicate that the column
name is case sensitive; false otherwise
SQLException - if a database access error occurs or
the given column number is out of bounds
public void setSearchable(int columnIndex,
boolean property)
throws SQLException
WHERE clause to the given boolean value.
setSearchable in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number
of columns in the rowset, inclusiveproperty - true to indicate that a column
value can be used in a WHERE clause;
false otherwise
SQLException - if a database access error occurs or
the given column number is out of bounds
SQLException - if a database access error occurs
public void setCurrency(int columnIndex,
boolean property)
throws SQLException
boolean.
setCurrency in interface RowSetMetaDatacolumnIndex - 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, inclusiveproperty - true if the value is a cash value; false otherwise.
SQLException - if a database access error occurs
or the given column number is out of bounds
SQLException - if a database access error occurs
public void setNullable(int columnIndex,
int property)
throws SQLException
NULL to the given constant from the interface
ResultSetMetaData.
setNullable in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusiveproperty - one of the following ResultSetMetaData constants:
columnNoNulls,
columnNullable, or
columnNullableUnknown
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
SQLException - if a database access error occurs
public void setSigned(int columnIndex,
boolean property)
throws SQLException
boolean.
setSigned in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusiveproperty - true to indicate that a column
value is a signed number;
false to indicate that it is not
SQLException - if a database access error occurs
or the given column number is out of bounds
public void setColumnDisplaySize(int columnIndex,
int size)
throws SQLException
setColumnDisplaySize in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusivesize - the maximum size of the column in chars; must be
0 or more
SQLException - if a database access error occurs,
the given column number is out of bounds, or size is
less than 0
public void setColumnLabel(int columnIndex,
String label)
throws SQLException
null, the column label is set to an empty string
("").
setColumnLabel in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusivelabel - the column label to be used in printouts and displays; if the
column label is null, an empty String is
set
SQLException - if a database access error occurs
or the given column index is out of bounds
public void setColumnName(int columnIndex,
String columnName)
throws SQLException
setColumnName in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusivecolumnName - a String object indicating the column name;
if the given name is null, an empty String
is set
SQLException - if a database access error occurs or the given column
index is out of bounds
public void setSchemaName(int columnIndex,
String schemaName)
throws SQLException
null,
the schema name is set to an empty string ("").
setSchemaName in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusiveschemaName - the schema name for the table from which a value in the
designated column was derived; may be an empty String
or null
SQLException - if a database access error occurs
or the given column number is out of bounds
public void setPrecision(int columnIndex,
int precision)
throws SQLException
setPrecision in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusiveprecision - the total number of decimal digits; must be 0
or more
SQLException - if a database access error occurs,
columnIndex is out of bounds, or precision
is less than 0
public void setScale(int columnIndex,
int scale)
throws SQLException
setScale in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusivescale - the number of digits to the right of the decimal point; must be
zero or greater
SQLException - if a database access error occurs,
columnIndex is out of bounds, or scale
is less than 0
public void setTableName(int columnIndex,
String tableName)
throws SQLException
setTableName in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusivetableName - the column's table name; may be null or an
empty string
SQLException - if a database access error occurs
or the given column number is out of bounds
public void setCatalogName(int columnIndex,
String catalogName)
throws SQLException
null, the catalog name is set to an empty string.
setCatalogName in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusivecatalogName - the column's table's catalog name; if the catalogName
is null, an empty String is set
SQLException - if a database access error occurs
or the given column number is out of bounds
public void setColumnType(int columnIndex,
int SQLType)
throws SQLException
java.sql.Types.
setColumnType in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusiveSQLType - the designated column's SQL type, which must be one of the
constants in the class java.sql.Types
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.TypesTypes
public void setColumnTypeName(int columnIndex,
String typeName)
throws SQLException
setColumnTypeName in interface RowSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusivetypeName - the data source-specific type name; if typeName is
null, an empty String is set
SQLException - if a database access error occurs
or the given column number is out of bounds
public int getColumnCount()
throws SQLException
RowSet object
for which this RowSetMetaDataImpl object was created.
getColumnCount in interface ResultSetMetaDataSQLException - if an error occurs determining the column count
public boolean isAutoIncrement(int columnIndex)
throws SQLException
isAutoIncrement in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
true if the column is automatically numbered;
false otherwise
SQLException - if a database access error occurs
or the given column number is out of bounds
public boolean isCaseSensitive(int columnIndex)
throws SQLException
isCaseSensitive in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
true if the column name is case sensitive;
false otherwise
SQLException - if a database access error occurs
or the given column number is out of bounds
public boolean isSearchable(int columnIndex)
throws SQLException
WHERE clause.
isSearchable in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
true if a value in the designated column can be used in a
WHERE clause; false otherwise
SQLException - if a database access error occurs
or the given column number is out of bounds
public boolean isCurrency(int columnIndex)
throws SQLException
isCurrency in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
true if a value in the designated column is a cash value;
false otherwise
SQLException - if a database access error occurs
or the given column number is out of bounds
public int isNullable(int columnIndex)
throws SQLException
NULL value in the designated column.
isNullable in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
ResultSetMetaData interface;
either columnNoNulls,
columnNullable, or
columnNullableUnknown
SQLException - if a database access error occurs
or the given column number is out of bounds
public boolean isSigned(int columnIndex)
throws SQLException
isSigned in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
true if if a value in the designated column is a signed
number; false otherwise
SQLException - if a database access error occurs
or the given column number is out of bounds
public int getColumnDisplaySize(int columnIndex)
throws SQLException
getColumnDisplaySize in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
SQLException - if a database access error occurs
or the given column number is out of bounds
public String getColumnLabel(int columnIndex)
throws SQLException
getColumnLabel in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
SQLException - if a database access error occurs
or the given column number is out of bounds
public String getColumnName(int columnIndex)
throws SQLException
getColumnName in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
SQLException - if a database access error occurs
or the given column number is out of bounds
public String getSchemaName(int columnIndex)
throws SQLException
getSchemaName in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns,
inclusive
String if no schema
name is available
SQLException - if a database access error occurs
or the given column number is out of bounds
public int getPrecision(int columnIndex)
throws SQLException
getPrecision in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
SQLException - if a database access error occurs
or the given column number is out of bounds
public int getScale(int columnIndex)
throws SQLException
getScale in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
SQLException - if a database access error occurs
or the given column number is out of bounds
public String getTableName(int columnIndex)
throws SQLException
getTableName in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
String if no table name
is available
SQLException - if a database access error occurs
or the given column number is out of bounds
public String getCatalogName(int columnIndex)
throws SQLException
getCatalogName in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
String if no catalog name is available
SQLException - if a database access error occurs
or the given column number is out of bounds
public int getColumnType(int columnIndex)
throws SQLException
java.sql.Types
constants) for the SQL type of the value stored in the
designated column.
getColumnType in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
int representing the SQL type of values
stored in the designated column
SQLException - if a database access error occurs
or the given column number is out of boundsTypes
public String getColumnTypeName(int columnIndex)
throws SQLException
getColumnTypeName in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
SQLException - if a database access error occurs
or the given column number is out of bounds
public boolean isReadOnly(int columnIndex)
throws SQLException
isReadOnly in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
true if this RowSet object is read-Only
and thus not updatable; false otherwise
SQLException - if a database access error occurs
or the given column number is out of bounds
public boolean isWritable(int columnIndex)
throws SQLException
true means that a write operation may or may
not succeed.
isWritable in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
true if a write operation on the designated column may
will succeed; false otherwise
SQLException - if a database access error occurs
or the given column number is out of bounds
public boolean isDefinitelyWritable(int columnIndex)
throws SQLException
isDefinitelyWritable in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
true if a write operation on the designated column will
definitely succeed; false otherwise
SQLException - if a database access error occurs
or the given column number is out of bounds
public String getColumnClassName(int columnIndex)
throws SQLException
int,
the class name returned by this method will be
java.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 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.
getColumnClassName in interface ResultSetMetaDatacolumnIndex - the first column is 1, the second is 2, and so on;
must be between 1 and the number of columns, inclusive
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.
SQLException - if a database access error occurs
or the given column number is out of bounds
public <T> T unwrap(Class<T> iface)
throws SQLException
unwrap recursively on the wrapped object. If the receiver is not a
wrapper and does not implement the interface, then an SQLException is thrown.
unwrap in interface Wrapperiface - A Class defining an interface that the result must implement.
SQLException - If no object found that implements the interface
public boolean isWrapperFor(Class<?> interfaces)
throws SQLException
isWrapperFor on 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 to unwrap so that
callers can use this method to avoid expensive unwrap calls that may fail. If this method
returns true then calling unwrap with the same argument should succeed.
isWrapperFor in interface Wrapperinterfaces - a Class defining an interface.
SQLException - if an error occurs while determining whether this is a wrapper
for an object with the given interface.
|
Java™ Platform Standard Ed. 6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.