com.sap.aii.mapping.lookup

Interface DataBaseResultMetaData


public interface DataBaseResultMetaData

Meta data of the database result. You get information about the types and properties of the columns in a DataBaseResult. If the corresponding database result does not contain rows, the metadata object is empty, which means that no metadata information is provided.

The following code fragment shows, how to make a database lookup, to determine the number of retrieved columns and the column names, and how to use the column names to get values from the column map. Further, the column type is determined from the meta data.

Since:
SAP NetWeaver '04 SPS 13
See Also:
DataBaseResult

Method Summary
 String getCatalogName(String columnName)
          Returns the table's catalog name for the designated column.
 String getColumnClassName(String columnName)
          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.
 int getColumnDisplaySize(String columnName)
          Returns the designated column's normal maximum width in characters.
 String getColumnLabel(String columnName)
          Returns the designated column's suggested title for use in printouts and displays.
 String[] getColumnNames()
          Returns all column names.
 int getColumnType(String columnName)
          Returns the given column's SQL type.
 String getColumnTypeName(String columnName)
          Returns the designated column's database specific type name.
 int getPrecision(String columnName)
          Returns the designated column's number of decimal digits.
 int getScale(String columnName)
          Returns the designated column's number of decimal places.
 String getSchemaName(String columnName)
          Returns the designated column's table's schema.
 String getTableName(String columnName)
          Returns the designated column's table name.
 boolean isAutoIncrement(String columnName)
          Indicates whether the designated column is automatically numbered, thus read-only.
 boolean isCaseSensitive(String columnName)
          Indicates whether a column's case matters.
 boolean isCurrency(String columnName)
          Indicates whether the designated column is a cash value.
 boolean isDefinitelyWritable(String columnName)
          Indicates whether a write on the designated column will definitely succeed.
 int isNullable(String columnName)
          Indicates the nullability of values in the designated column.
 boolean isReadOnly(String columnName)
          Indicates whether the designated column is definitely not writable.
 boolean isSearchable(String columnName)
          Indicates whether the designated column can be used in a where clause.
 boolean isSigned(String columnName)
          Indicates whether values in the designated column are signed numbers.
 boolean isWritable(String columnName)
          Indicates whether it is possible for a write on the designated column to succeed.
 

Method Detail

getColumnNames

String[] getColumnNames()
Returns all column names. An empty array is retuned, if there are no column names, or the corresponding database result does not contain any rows.

Returns:
column names

getColumnClassName

String getColumnClassName(String columnName)
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.

Parameters:
columnName - column name
Returns:
the fully qualified name of the class in the Java programming language that would be used by the method Map.get([columnName]) to retrieve the value in the specified column. This is the class name used for custom mapping.
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

getColumnType

int getColumnType(String columnName)
Returns the given column's SQL type.

Parameters:
columnName - column name
Returns:
SQL type from java.sql.Types
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

isAutoIncrement

boolean isAutoIncrement(String columnName)
Indicates whether the designated column is automatically numbered, thus read-only.

Parameters:
columnName - column name
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

isCaseSensitive

boolean isCaseSensitive(String columnName)
Indicates whether a column's case matters.

Parameters:
columnName - column name
Returns:
true if so; false otherwise
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

isSearchable

boolean isSearchable(String columnName)
Indicates whether the designated column can be used in a where clause.

Parameters:
columnName - column name
Returns:
true if so; false otherwise
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

isCurrency

boolean isCurrency(String columnName)
Indicates whether the designated column is a cash value.

Parameters:
columnName - column name
Returns:
true if so; false otherwise
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

isNullable

int isNullable(String columnName)
Indicates the nullability of values in the designated column.

Parameters:
columnName - column name
Returns:
the nullability status of the given column; one of java.sql.ResultSetMetaData.columnNoNulls, java.sql.ResultSetMetaData.columnNullable, or java.sql.ResultSetMetaData.columnNullableUnknown
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

isSigned

boolean isSigned(String columnName)
Indicates whether values in the designated column are signed numbers.

Parameters:
columnName - column name
Returns:
true if so; false otherwise
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

getColumnDisplaySize

int getColumnDisplaySize(String columnName)
Returns the designated column's normal maximum width in characters.

Parameters:
columnName -
Returns:
the normal maximum number of characters allowed as the width of the designated column

getColumnLabel

String getColumnLabel(String columnName)
Returns the designated column's suggested title for use in printouts and displays.

Parameters:
columnName - column name
Returns:
the suggested column title
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

getSchemaName

String getSchemaName(String columnName)
Returns the designated column's table's schema.

Parameters:
columnName - column name
Returns:
schema name or "" if not applicable
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

getPrecision

int getPrecision(String columnName)
Returns the designated column's number of decimal digits.

Parameters:
columnName - column name
Returns:
precision
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

getScale

int getScale(String columnName)
Returns the designated column's number of decimal places.

Parameters:
columnName -
Returns:
scale
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

getTableName

String getTableName(String columnName)
Returns the designated column's table name.

Parameters:
columnName - column name
Returns:
table name or "" if not applicable
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

getCatalogName

String getCatalogName(String columnName)
Returns the table's catalog name for the designated column.

Parameters:
columnName -
Returns:
the name of the catalog for the table in which the given column appears or "" if not applicable

getColumnTypeName

String getColumnTypeName(String columnName)
Returns the designated column's database specific type name.

Parameters:
columnName - column name
Returns:
type name used by the database. If the column type is a user-defined type, then a fully qualified type name is returned.
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

isReadOnly

boolean isReadOnly(String columnName)
Indicates whether the designated column is definitely not writable.

Parameters:
columnName - column name
Returns:
true if so; false otherwise
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

isWritable

boolean isWritable(String columnName)
Indicates whether it is possible for a write on the designated column to succeed.

Parameters:
columnName -
Returns:
true if so; false otherwise
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()

isDefinitelyWritable

boolean isDefinitelyWritable(String columnName)
Indicates whether a write on the designated column will definitely succeed.

Parameters:
columnName -
Returns:
true if so; false otherwise
Throws:
NullPointerException - if columnName is null,
IllegalArgumentException - if columnName is not part of getColumnNames()


Copyright 2007 SAP AG Complete Copyright Notice