An object that can be used to get information about the types
and properties of the columns in a
ResultSet
object.
The following code fragment creates the
ResultSet
object rs,
creates the
ResultSetMetaData
object rsmd, and uses rsmd
to find out how many columns rs has and whether the first column in rs
can be used in a
WHERE
clause.
ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
ResultSetMetaData rsmd = rs.getMetaData();
int numberOfColumns = rsmd.getColumnCount();
boolean b = rsmd.isSearchable(1);
The constant indicating that a
column does not allow NULL
values.
The constant indicating that a
column allows NULL
values.
The constant indicating that the
nullability of a column's values is unknown.
Gets the designated column's table's catalog name.
Returns the fully-qualified name of the Java class whose instances
are manufactured if the method ResultSet.getObject
is called to retrieve a value
from the column. ResultSet.getObject
may return a subclass of the
class returned by this method.
Returns the number of columns in this ResultSet
object.
Indicates the designated column's normal maximum width in characters.
Gets the designated column's suggested title for use in printouts and
displays.
Get the designated column's name.
Retrieves the designated column's SQL type.
Retrieves the designated column's database-specific type name.
Get the designated column's number of decimal digits.
Gets the designated column's number of digits to right of the decimal point.
Get the designated column's table's schema.
Gets the designated column's table name.
Indicates whether the designated column is automatically numbered, thus read-only.
Indicates whether a column's case matters.
Indicates whether the designated column is a cash value.
Indicates whether a write on the designated column will definitely succeed.
Indicates the nullability of values in the designated column.
Indicates whether the designated column is definitely not writable.
Indicates whether the designated column can be used in a where clause.
Indicates whether values in the designated column are signed numbers.
Indicates whether it is possible for a write on the designated column to succeed.