Package java.sql
Interface ResultSetMetaData
- All Superinterfaces:
Wrapper
- All Known Subinterfaces:
RowSetMetaData
- All Known Implementing Classes:
JDBCResultSetMetaData
public interface ResultSetMetaData extends Wrapper
Provides information about the columns returned in a
ResultSet.-
Field Summary
Fields Modifier and Type Field Description static intcolumnNoNullsIndicates that a column cannot containNULLvalues.static intcolumnNullableIndicates that a column can containNULLvalues.static intcolumnNullableUnknownIndicates that it is unknown whether a column can containNULLs or not. -
Method Summary
Modifier and Type Method Description StringgetCatalogName(int column)Returns the title of an indexed column's catalog.StringgetColumnClassName(int column)Returns the fully-qualified type of the class that is produced when invokingResultSet.getObjectto recover this column's value.intgetColumnCount()Returns number of columns contained in the associated result set.intgetColumnDisplaySize(int column)Returns the indexed column's standard maximum width, expressed in number of characters.StringgetColumnLabel(int column)Returns a recommended title for the indexed column, to be used when the title needs to be displayed.StringgetColumnName(int column)Returns the title of the indexed column.intgetColumnType(int column)Returns the type of the indexed column as SQL type code.StringgetColumnTypeName(int column)Returns the type name of the indexed column.intgetPrecision(int column)Returns the decimal precision of the indexed column.intgetScale(int column)Returns the number of digits to the right of the decimal point of the indexed column.StringgetSchemaName(int column)Returns the name of the indexed columns schema.StringgetTableName(int column)Returns the title of the indexed columns table.booleanisAutoIncrement(int column)Returns an indication of whether the indexed column is automatically incremented and is therefore read-only.booleanisCaseSensitive(int column)Returns an indication of whether the case of the indexed column is important.booleanisCurrency(int column)Returns whether the indexed column contains a monetary amount.booleanisDefinitelyWritable(int column)Returns an indication of whether writing to the indexed column is guaranteed to be successful.intisNullable(int column)Returns whether the indexed column is nullable.booleanisReadOnly(int column)Returns an indication of whether writing to the indexed column is guaranteed to be unsuccessful.booleanisSearchable(int column)Returns an indication of whether the indexed column is searchable.booleanisSigned(int column)Returns an indication of whether the values contained in the indexed column are signed.booleanisWritable(int column)Returns an indication of whether writing to the indexed column is possible.Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Field Details
-
columnNoNulls
static final int columnNoNullsIndicates that a column cannot containNULLvalues.- See Also:
- Constant Field Values
-
columnNullable
static final int columnNullableIndicates that a column can containNULLvalues.- See Also:
- Constant Field Values
-
columnNullableUnknown
static final int columnNullableUnknownIndicates that it is unknown whether a column can containNULLs or not.- See Also:
- Constant Field Values
-
-
Method Details
-
getCatalogName
Returns the title of an indexed column's catalog.- Parameters:
column- the column index, starting at 1.- Returns:
- the catalog title.
- Throws:
SQLException- if there is a database error.
-
getColumnClassName
Returns the fully-qualified type of the class that is produced when invokingResultSet.getObjectto recover this column's value.- Parameters:
column- the column index, starting at 1.- Returns:
- the fully-qualified class name.
- Throws:
SQLException- if there is a database error.- See Also:
ResultSet.getObject(int)
-
getColumnCount
Returns number of columns contained in the associated result set.- Returns:
- the column count.
- Throws:
SQLException- if there is a database error.
-
getColumnDisplaySize
Returns the indexed column's standard maximum width, expressed in number of characters.- Parameters:
column- the column index, starting at 1.- Returns:
- the column's max width.
- Throws:
SQLException- if there is a database error.
-
getColumnLabel
Returns a recommended title for the indexed column, to be used when the title needs to be displayed.- Parameters:
column- the column index, starting at 1.- Returns:
- the column's title.
- Throws:
SQLException- if there is a database error.
-
getColumnName
Returns the title of the indexed column.- Parameters:
column- the column index, starting at 1.- Returns:
- the column title.
- Throws:
SQLException- if there is a database error.
-
getColumnType
Returns the type of the indexed column as SQL type code.- Parameters:
column- the column index, starting at 1.- Returns:
- the column type code.
- Throws:
SQLException- if there is a database error.- See Also:
Types
-
getColumnTypeName
Returns the type name of the indexed column.- Parameters:
column- the column index, starting at 1.- Returns:
- the type name.
- Throws:
SQLException- if there is a database error.
-
getPrecision
Returns the decimal precision of the indexed column.- Parameters:
column- the column index, starting at 1.- Returns:
- the precision.
- Throws:
SQLException- if there is a database error.
-
getScale
Returns the number of digits to the right of the decimal point of the indexed column.- Parameters:
column- the column index, starting at 1.- Returns:
- number of decimal places.
- Throws:
SQLException- if there is a database error.
-
getSchemaName
Returns the name of the indexed columns schema.- Parameters:
column- the column index, starting at 1.- Returns:
- the name of the columns schema.
- Throws:
SQLException- if there is a database error.
-
getTableName
Returns the title of the indexed columns table.- Parameters:
column- the column index, starting at 1.- Returns:
- the table title.
- Throws:
SQLException- if there is a database error.
-
isAutoIncrement
Returns an indication of whether the indexed column is automatically incremented and is therefore read-only.- Parameters:
column- the column index, starting at 1.- Returns:
trueif it is automatically numbered,falseotherwise.- Throws:
SQLException- if there is a database error.
-
isCaseSensitive
Returns an indication of whether the case of the indexed column is important.- Parameters:
column- the column index, starting at 1.- Returns:
trueif case matters,falseotherwise.- Throws:
SQLException- if there is a database error.
-
isCurrency
Returns whether the indexed column contains a monetary amount.- Parameters:
column- the column index, starting at 1.- Returns:
trueif it is a monetary value,falseotherwise.- Throws:
SQLException- if there is a database error.
-
isDefinitelyWritable
Returns an indication of whether writing to the indexed column is guaranteed to be successful.- Parameters:
column- the column index, starting at 1.- Returns:
trueif the write is guaranteed,falseotherwise.- Throws:
SQLException- if there is a database error.
-
isNullable
Returns whether the indexed column is nullable.- Parameters:
column- the column index, starting at 1.- Returns:
trueif it is nullable,falseotherwise.- Throws:
SQLException- if there is a database error.
-
isReadOnly
Returns an indication of whether writing to the indexed column is guaranteed to be unsuccessful.- Parameters:
column- the column index, starting at 1.- Returns:
trueif the column is read-only,falseotherwise.- Throws:
SQLException- if there is a database error.
-
isSearchable
Returns an indication of whether the indexed column is searchable.- Parameters:
column- the column index, starting at 1.- Returns:
trueif the indexed column is searchable,falseotherwise.- Throws:
SQLException- if there is a database error.
-
isSigned
Returns an indication of whether the values contained in the indexed column are signed.- Parameters:
column- the column index, starting at 1.- Returns:
trueif they are signed,falseotherwise.- Throws:
SQLException- if there is a database error.
-
isWritable
Returns an indication of whether writing to the indexed column is possible.- Parameters:
column- the column index, starting at 1.- Returns:
trueif it is possible to write,falseotherwise.- Throws:
SQLException- if there is a database error.
-