Top Description Fields Constructors Methods
org.h2.jdbc

public final Class JdbcResultSetMetaData

extends TraceObject
implements ResultSetMetaData
Class Inheritance
All Implemented Interfaces
java.sql.ResultSetMetaData, java.sql.Wrapper
Imports
java.sql.ResultSetMetaData, .SQLException, org.h2.message.DbException, .Trace, .TraceObject, org.h2.result.ResultInterface, org.h2.util.MathUtils, org.h2.value.DataType, .ValueToObjectConverter

Represents the meta data for a ResultSet.

Field Summary

Modifier and TypeField and Description
private final String
private final int
private final JdbcPreparedStatement
private final ResultInterface
private final JdbcResultSet
Inherited from org.h2.message.TraceObject:
ARRAYBLOBCALLABLE_STATEMENTCLOBCONNECTIONDATA_SOURCEDATABASE_META_DATAPARAMETER_META_DATAPREPARED_STATEMENTRESULT_SETRESULT_SET_META_DATASAVEPOINTSQLXMLSTATEMENTtraceXA_DATA_SOURCEXID

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
public String

Returns:

the catalog name
getCatalogName
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.getCatalogName.

Returns the catalog name.

private int

Returns:

0-based column index
getColumn
(String
the called method name
methodName
,
int
1-based column index
columnIndex
)

Writes trace information and checks validity of this object and parameter.

public String

Returns:

the Java class name
getColumnClassName
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.getColumnClassName.

Gets the Java class name of the object that will be returned if ResultSet.getObject is called.

public int

Returns:

the number of columns
getColumnCount
()

Implements java.sql.ResultSetMetaData.getColumnCount.

Returns the number of columns.

public int

Returns:

the display size
getColumnDisplaySize
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.getColumnDisplaySize.

Gets the maximum display size for this column.

public String

Returns:

the column label
getColumnLabel
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.getColumnLabel.

Returns the column label.

public String

Returns:

the column name
getColumnName
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.getColumnName.

Returns the column name.

public int

Returns:

the data type
getColumnType
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.getColumnType.

Returns the data type of a column.

public String

Returns:

the data type name
getColumnTypeName
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.getColumnTypeName.

Returns the data type name of a column.

public int

Returns:

the precision
getPrecision
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.getPrecision.

Gets the precision for this column.

public int

Returns:

the scale
getScale
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.getScale.

Gets the scale for this column.

public String

Returns:

the schema name, or "" (an empty string) if not applicable
getSchemaName
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.getSchemaName.

Returns the schema name.

public String

Returns:

the table name
getTableName
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.getTableName.

Returns the table name.

public boolean

Returns:

false
isAutoIncrement
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.isAutoIncrement.

Checks if this an autoincrement column.

public boolean

Returns:

true
isCaseSensitive
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.isCaseSensitive.

Checks if this column is case sensitive.

public boolean

Returns:

false
isCurrency
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.isCurrency.

Checks if this is a currency column.

public boolean

Returns:

false
isDefinitelyWritable
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.isDefinitelyWritable.

Checks whether a write on this column will definitely succeed.

public int

Returns:

ResultSetMetaData.column*
isNullable
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.isNullable.

Checks if this is nullable column.

public boolean

Returns:

false
isReadOnly
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.isReadOnly.

Checks if this column is read only.

public boolean

Returns:

true
isSearchable
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.isSearchable.

Checks if this column is searchable.

public boolean

Returns:

true for numeric columns
isSigned
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.isSigned.

Checks if this column is signed.

public boolean

Returns:

whether or not the interface is assignable from this class
isWrapperFor
(Class<?>
the class
iface
)

Implements java.sql.Wrapper.isWrapperFor.

Checks if unwrap can return an object of this class.

public boolean

Returns:

true
isWritable
(int
the column index (1,2,...)
column
)

Implements java.sql.ResultSetMetaData.isWritable.

Checks whether it is possible for a write on this column to succeed.

public String
toString()

Overrides java.lang.Object.toString.

INTERNAL

public <T> T

Returns:

this
unwrap
(Class<T>
the class
iface
)

Implements java.sql.Wrapper.unwrap.

Return an object of this class if possible.

Inherited from org.h2.message.TraceObject:
debugCodedebugCodeAssigndebugCodeCalldebugCodeCalldebugCodeCallgetNextIdgetTraceIdgetTraceObjectNameisDebugEnabledisInfoEnabledlogAndConvertquotequoteArrayquoteBigDecimalquoteBytesquoteDatequoteIntArrayquoteMapquoteTimequoteTimestampsetTraceunsupported

Field Detail

catalogback to summary
private final String catalog
columnCountback to summary
private final int columnCount
prepback to summary
private final JdbcPreparedStatement prep
resultback to summary
private final ResultInterface result
rsback to summary
private final JdbcResultSet rs

Constructor Detail

JdbcResultSetMetaDataback to summary
pack-priv JdbcResultSetMetaData(JdbcResultSet rs, JdbcPreparedStatement prep, ResultInterface result, String catalog, Trace trace, int id)

Method Detail

checkClosedback to summary
private void checkClosed()
getCatalogNameback to summary
public String getCatalogName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getCatalogName.

Returns the catalog name.

Parameters
column:int

the column index (1,2,...)

Returns:String

the catalog name

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
getColumnback to summary
private int getColumn(String methodName, int columnIndex)

Writes trace information and checks validity of this object and parameter.

Parameters
methodName:String

the called method name

columnIndex:int

1-based column index

Returns:int

0-based column index

getColumnClassNameback to summary
public String getColumnClassName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getColumnClassName.

Gets the Java class name of the object that will be returned if ResultSet.getObject is called.

Parameters
column:int

the column index (1,2,...)

Returns:String

the Java class name

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
getColumnCountback to summary
public int getColumnCount() throws SQLException

Implements java.sql.ResultSetMetaData.getColumnCount.

Returns the number of columns.

Returns:int

the number of columns

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
getColumnDisplaySizeback to summary
public int getColumnDisplaySize(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getColumnDisplaySize.

Gets the maximum display size for this column.

Parameters
column:int

the column index (1,2,...)

Returns:int

the display size

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
getColumnLabelback to summary
public String getColumnLabel(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getColumnLabel.

Returns the column label.

Parameters
column:int

the column index (1,2,...)

Returns:String

the column label

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
getColumnNameback to summary
public String getColumnName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getColumnName.

Returns the column name.

Parameters
column:int

the column index (1,2,...)

Returns:String

the column name

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
getColumnTypeback to summary
public int getColumnType(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getColumnType.

Returns the data type of a column. See also java.sql.Type.

Parameters
column:int

the column index (1,2,...)

Returns:int

the data type

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
getColumnTypeNameback to summary
public String getColumnTypeName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getColumnTypeName.

Returns the data type name of a column.

Parameters
column:int

the column index (1,2,...)

Returns:String

the data type name

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
getPrecisionback to summary
public int getPrecision(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getPrecision.

Gets the precision for this column.

Parameters
column:int

the column index (1,2,...)

Returns:int

the precision

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
getScaleback to summary
public int getScale(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getScale.

Gets the scale for this column.

Parameters
column:int

the column index (1,2,...)

Returns:int

the scale

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
getSchemaNameback to summary
public String getSchemaName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getSchemaName.

Returns the schema name.

Parameters
column:int

the column index (1,2,...)

Returns:String

the schema name, or "" (an empty string) if not applicable

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
getTableNameback to summary
public String getTableName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getTableName.

Returns the table name.

Parameters
column:int

the column index (1,2,...)

Returns:String

the table name

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
isAutoIncrementback to summary
public boolean isAutoIncrement(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isAutoIncrement.

Checks if this an autoincrement column.

Parameters
column:int

the column index (1,2,...)

Returns:boolean

false

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
isCaseSensitiveback to summary
public boolean isCaseSensitive(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isCaseSensitive.

Checks if this column is case sensitive. It always returns true.

Parameters
column:int

the column index (1,2,...)

Returns:boolean

true

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
isCurrencyback to summary
public boolean isCurrency(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isCurrency.

Checks if this is a currency column. It always returns false.

Parameters
column:int

the column index (1,2,...)

Returns:boolean

false

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
isDefinitelyWritableback to summary
public boolean isDefinitelyWritable(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isDefinitelyWritable.

Checks whether a write on this column will definitely succeed. It always returns false.

Parameters
column:int

the column index (1,2,...)

Returns:boolean

false

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
isNullableback to summary
public int isNullable(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isNullable.

Checks if this is nullable column. Returns ResultSetMetaData.columnNullableUnknown if this is not a column of a table. Otherwise, it returns ResultSetMetaData.columnNoNulls if the column is not nullable, and ResultSetMetaData.columnNullable if it is nullable.

Parameters
column:int

the column index (1,2,...)

Returns:int

ResultSetMetaData.column*

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
isReadOnlyback to summary
public boolean isReadOnly(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isReadOnly.

Checks if this column is read only. It always returns false.

Parameters
column:int

the column index (1,2,...)

Returns:boolean

false

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
isSearchableback to summary
public boolean isSearchable(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isSearchable.

Checks if this column is searchable. It always returns true.

Parameters
column:int

the column index (1,2,...)

Returns:boolean

true

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
isSignedback to summary
public boolean isSigned(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isSigned.

Checks if this column is signed. Returns true for numeric columns.

Parameters
column:int

the column index (1,2,...)

Returns:boolean

true for numeric columns

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
isWrapperForback to summary
public boolean isWrapperFor(Class<?> iface) throws SQLException

Implements java.sql.Wrapper.isWrapperFor.

Checks if unwrap can return an object of this class.

Parameters
iface:Class<?>

the class

Returns:boolean

whether or not the interface is assignable from this class

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.Wrapper.isWrapperFor.

if an error occurs while determining whether this is a wrapper for an object with the given interface.

isWritableback to summary
public boolean isWritable(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isWritable.

Checks whether it is possible for a write on this column to succeed. It always returns true.

Parameters
column:int

the column index (1,2,...)

Returns:boolean

true

Annotations
@Override
Exceptions
SQLException:
if the result set is closed or invalid
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

INTERNAL

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override
unwrapback to summary
public <T> T unwrap(Class<T> iface) throws SQLException

Implements java.sql.Wrapper.unwrap.

Return an object of this class if possible.

Parameters
<T>

Doc from java.sql.Wrapper.unwrap. the type of the class modeled by this Class object

iface:Class<T>

the class

Returns:T

this

Annotations
@Override
@SuppressWarnings:unchecked
Exceptions
SQLException:

Doc from java.sql.Wrapper.unwrap.

If no object found that implements the interface