IBM DB2 Information Integrator
Java API Reference
for Developing Wrappers

com.ibm.db2.wrapper
Class ColumnInfo

java.lang.Object
  extended bycom.ibm.db2.wrapper.CatalogInfo
      extended bycom.ibm.db2.wrapper.ColumnInfo

public final class ColumnInfo
extends CatalogInfo

The ColumnInfo class encapsulates catalog information for a column of a nickname. This class includes column-statistical information.

The ColumnInfo class is one of the catalog classes for the Java API.

Usage:
The ColumnInfo class is instantiated by the DB2 federated server to contain information from a CREATE NICKNAME or an ALTER NICKNAME statement or to contain information from the federated server's system catalog. This class is instantiated by the wrapper when information is added during CREATE NICKNAME or ALTER NICKNAME statement operations.

Since:
IBM DB2 Information Integrator Version 8.2

Constructor Summary
ColumnInfo()
          Construct a default (empty) column information object.
 
Method Summary
 void addOption(java.lang.String optionName, java.lang.String optionValue, int action)
          Add an option to the options chain.
 int getAvgLength()
          Retrieve the average length of the column.
 short getCodepage1()
          Retrieve the single-byte character set (SBCS) code page for the column.
 short getCodepage2()
          Retrieve the double-byte character set (DBCS) code page for the column.
 long getColCard()
          Retrieve the cardinality of the column.
 short getColumnID()
          Retrieve the column ID.
 java.lang.String getColumnName()
          Retrieve the name of the column.
 java.lang.String getColumnType()
          Retrieve the type of the column.
 java.lang.String getDefault()
          Retrieve the default value for the column.
 boolean getForBitData()
          Retrieve the FOR BIT DATA flag for the column.
 java.lang.String getHigh2Key()
          Retrieve the second-highest value for the column.
 java.lang.String getLow2Key()
          Retrieve the second-lowest value for the column.
 java.lang.String getNewColumnName()
          Retrieve the new column name that is specified in an ALTER COLUMN statement that includes an ALTER (or SET) COLUMN clause to rename the column.
 ColumnInfo getNextColumn()
          Retrieve the next column in the columns chain.
 boolean getNulls()
          Retrieve the nulls-allowed flag.
 int getOrgLength()
          Retrieve the maximum length (in bytes) for the column.
 short getOrgScale()
          Retrieve the numeric scale of the column.
 java.lang.String getTypeName()
          Retrieve the name of the local column type.
 java.lang.String getTypeSchema()
          Retrieve the schema of the local column type.
 boolean isAvgLengthValid()
          Verify whether an average length is specified for the column.
 boolean isCodepage1Valid()
          Verify whether a single-byte character set (SBCS) code page is specified for the column.
 boolean isCodepage2Valid()
          Verify whether a double-byte character set (DBCS) code page is specified for the column.
 boolean isColCardValid()
          Verify whether a cardinality value is specified for the column.
 boolean isColumnIDValid()
          Verify whether a column ID (position) is specified for the column.
 boolean isColumnNameValid()
          Verify whether a name is specified for the column.
 boolean isColumnTypeValid()
          Verify whether a local type is specified for the column.
 boolean isDefaultValid()
          Verify whether a default value is specified for the column.
 boolean isForBitDataValid()
          Verify whether a FOR BIT DATA flag is specified for the column.
 boolean isHigh2KeyValid()
          Verify whether a second-highest value is specified for the column.
 boolean isLow2KeyValid()
          Verify whether a second-lowest value is specified for the column.
 boolean isNewColumnNameValid()
          Verify whether a new name is specified for the column.
 boolean isNullsValid()
          Verify whether a nulls-allowed flag is specified for the column.
 boolean isOrgLengthValid()
          Verify whether an original length is specified for the column.
 boolean isOrgScaleValid()
          Verify whether an original scale is specified for the column.
 boolean isTypeNameValid()
          Verify whether a local type name is specified for the column.
 boolean isTypeSchemaValid()
          Verify whether a local type schema is specified for the column.
 void setAvgLength(int avgLength)
          Set the average length of the column.
 void setCodepage1(short codepage1)
          Set the single-byte character set (SBCS) code page for the column.
 void setCodepage2(short codepage2)
          Set the double-byte character set (DBCS) code page for the column.
 void setColCard(long colCard)
          Set the cardinality of the column.
 void setColumnID(short columnID)
          Set the column ID, which represents the position of he column.
 void setColumnName(java.lang.String columnName)
          Set the name of the column.
 void setColumnType(java.lang.String columnType)
          Set the type of the column.
 void setDefault(java.lang.String defaultValue)
          Set the default value for the column.
 void setForBitData(boolean forBitData)
          Set the FOR BIT DATA flag for the column.
 void setHigh2Key(java.lang.String high2Key)
          Set the second-highest value for the column.
 void setLow2Key(java.lang.String low2Key)
          Set the second-lowest value for the column.
 void setNewColumnName(java.lang.String newColumnName)
          Set the new name for the column.
 void setNulls(boolean nulls)
          Set the nulls-allowed flag.
 void setOrgLength(int orgLength)
          Set the maximum length (in bytes) for the column.
 void setOrgScale(short orgScale)
          Set the numeric scale of the column.
 void setTypeName(java.lang.String typeName)
          Set the name of the local column type.
 void setTypeSchema(java.lang.String typeSchema)
          Set the schema of the local column type.
 
Methods inherited from class com.ibm.db2.wrapper.CatalogInfo
addOption, dropOption, getFirstOption, getNextOption, getOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnInfo

public ColumnInfo()
Construct a default (empty) column information object.

Since:
IBM DB2 Information Integrator Version 8.2
Method Detail

addOption

public void addOption(java.lang.String optionName,
                      java.lang.String optionValue,
                      int action)
               throws WrapperException
Add an option to the options chain.

Parameters:
optionName - The name of the option.
optionValue - The value of the option.
action - The action flag for the option. Valid actions for the options are specified in CatalogOption class.
Throws:
WrapperException - if the option already exists in the chain or if the action is invalid.
Since:
IBM DB2 Information Integrator Version 8.2

getAvgLength

public int getAvgLength()
Retrieve the average length of the column.

Returns:
The average column length.
Since:
IBM DB2 Information Integrator Version 8.2

getCodepage1

public short getCodepage1()
Retrieve the single-byte character set (SBCS) code page for the column.

Returns:
The single-byte character set (SBCS) code page.
Since:
IBM DB2 Information Integrator Version 8.2

getCodepage2

public short getCodepage2()
Retrieve the double-byte character set (DBCS) code page for the column.

Returns:
The double-byte character set (DBCS) code page.
Since:
IBM DB2 Information Integrator Version 8.2

getColCard

public long getColCard()
Retrieve the cardinality of the column.

Returns:
The column cardinality.
Since:
IBM DB2 Information Integrator Version 8.2

getColumnID

public short getColumnID()
Retrieve the column ID. Represents the position of the column. The first column is at position 0.

Returns:
The column ID (position).
Since:
IBM DB2 Information Integrator Version 8.2

getColumnName

public java.lang.String getColumnName()
Retrieve the name of the column.

Returns:
The column name.
Since:
IBM DB2 Information Integrator Version 8.2

getColumnType

public java.lang.String getColumnType()
Retrieve the type of the column.

Returns:
The column type.
Since:
IBM DB2 Information Integrator Version 8.2

getDefault

public java.lang.String getDefault()
Retrieve the default value for the column.

Returns:
The default value.
Since:
IBM DB2 Information Integrator Version 8.2

getForBitData

public boolean getForBitData()
Retrieve the FOR BIT DATA flag for the column.

Returns:
The value that indicates if the column has the FOR BIT DATA flag set.
Since:
IBM DB2 Information Integrator Version 8.2

getHigh2Key

public java.lang.String getHigh2Key()
Retrieve the second-highest value for the column.

Returns:
The high2Key value.
Since:
IBM DB2 Information Integrator Version 8.2

getLow2Key

public java.lang.String getLow2Key()
Retrieve the second-lowest value for the column.

Returns:
The low2Key value.
Since:
IBM DB2 Information Integrator Version 8.2

getNewColumnName

public java.lang.String getNewColumnName()
Retrieve the new column name that is specified in an ALTER COLUMN statement that includes an ALTER (or SET) COLUMN clause to rename the column.

Returns:
The new column name.
Since:
IBM DB2 Information Integrator Version 8.2

getNextColumn

public ColumnInfo getNextColumn()
Retrieve the next column in the columns chain.

Returns:
The next column in the chain or null if there are no more columns.
Since:
IBM DB2 Information Integrator Version 8.2

getNulls

public boolean getNulls()
Retrieve the nulls-allowed flag.

Returns:
The nulls-allowed flag.
Since:
IBM DB2 Information Integrator Version 8.2

getOrgLength

public int getOrgLength()
Retrieve the maximum length (in bytes) for the column.

Returns:
The column length.
Since:
IBM DB2 Information Integrator Version 8.2

getOrgScale

public short getOrgScale()
Retrieve the numeric scale of the column.

Returns:
The column scale.
Since:
IBM DB2 Information Integrator Version 8.2

getTypeName

public java.lang.String getTypeName()
Retrieve the name of the local column type.

Returns:
The local type name of the column.
Since:
IBM DB2 Information Integrator Version 8.2

getTypeSchema

public java.lang.String getTypeSchema()
Retrieve the schema of the local column type.

Returns:
The local type schema name of the column.
Since:
IBM DB2 Information Integrator Version 8.2

isAvgLengthValid

public boolean isAvgLengthValid()
Verify whether an average length is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isCodepage1Valid

public boolean isCodepage1Valid()
Verify whether a single-byte character set (SBCS) code page is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isCodepage2Valid

public boolean isCodepage2Valid()
Verify whether a double-byte character set (DBCS) code page is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isColCardValid

public boolean isColCardValid()
Verify whether a cardinality value is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isColumnIDValid

public boolean isColumnIDValid()
Verify whether a column ID (position) is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isColumnNameValid

public boolean isColumnNameValid()
Verify whether a name is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isColumnTypeValid

public boolean isColumnTypeValid()
Verify whether a local type is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isDefaultValid

public boolean isDefaultValid()
Verify whether a default value is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isForBitDataValid

public boolean isForBitDataValid()
Verify whether a FOR BIT DATA flag is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isHigh2KeyValid

public boolean isHigh2KeyValid()
Verify whether a second-highest value is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isLow2KeyValid

public boolean isLow2KeyValid()
Verify whether a second-lowest value is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isNewColumnNameValid

public boolean isNewColumnNameValid()
Verify whether a new name is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isNullsValid

public boolean isNullsValid()
Verify whether a nulls-allowed flag is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isOrgLengthValid

public boolean isOrgLengthValid()
Verify whether an original length is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isOrgScaleValid

public boolean isOrgScaleValid()
Verify whether an original scale is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isTypeNameValid

public boolean isTypeNameValid()
Verify whether a local type name is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

isTypeSchemaValid

public boolean isTypeSchemaValid()
Verify whether a local type schema is specified for the column.

Returns:
true if a value is specified, false otherwise.
Since:
IBM DB2 Information Integrator Version 8.2

setAvgLength

public void setAvgLength(int avgLength)
Set the average length of the column.

Parameters:
avgLength - The length to be set.
Since:
IBM DB2 Information Integrator Version 8.2

setCodepage1

public void setCodepage1(short codepage1)
Set the single-byte character set (SBCS) code page for the column.

Parameters:
codepage1 - The single-byte character set (SBCS) code page.
Since:
IBM DB2 Information Integrator Version 8.2

setCodepage2

public void setCodepage2(short codepage2)
Set the double-byte character set (DBCS) code page for the column.

Parameters:
codepage2 - The double-byte character set (DBCS) code page.
Since:
IBM DB2 Information Integrator Version 8.2

setColCard

public void setColCard(long colCard)
Set the cardinality of the column. The wrapper sets the column cardinality (if known) during CREATE NICKNAME or ALTER NICKNAME statement processing. The DB2 optimizer uses this information when it generates an optimal performance plan. For columns with distinct values (no duplicates), the column cardinality must be the same as the nickname cardinality. The DB2 optimizer generates an error if the column cardinality is greater than the nickname cardinality.

Parameters:
colCard - The column cardinality.
Since:
IBM DB2 Information Integrator Version 8.2

setColumnID

public void setColumnID(short columnID)
Set the column ID, which represents the position of he column. The first column is at position 0.

Parameters:
columnID - The ID (position) of the column.
Since:
IBM DB2 Information Integrator Version 8.2

setColumnName

public void setColumnName(java.lang.String columnName)
Set the name of the column.

Parameters:
columnName - The name to be set.
Since:
IBM DB2 Information Integrator Version 8.2

setColumnType

public void setColumnType(java.lang.String columnType)
Set the type of the column.

Parameters:
columnType - The column type.
Since:
IBM DB2 Information Integrator Version 8.2

setDefault

public void setDefault(java.lang.String defaultValue)
Set the default value for the column.

Parameters:
defaultValue - The default value.
Since:
IBM DB2 Information Integrator Version 8.2

setForBitData

public void setForBitData(boolean forBitData)
Set the FOR BIT DATA flag for the column.

Parameters:
forBitData - The FOR BIT DATA flag.
Since:
IBM DB2 Information Integrator Version 8.2

setHigh2Key

public void setHigh2Key(java.lang.String high2Key)
Set the second-highest value for the column. The wrapper can set the second-highest value of a column during CREATE NICKNAME or ALTER NICKNAME statement processing. The DB2 optimizer can use this second-highest value or the highest value when the optimizer develops an optimized query plan.

Parameters:
high2Key - The high2Key value.
Since:
IBM DB2 Information Integrator Version 8.2

setLow2Key

public void setLow2Key(java.lang.String low2Key)
Set the second-lowest value for the column. The wrapper can set the second-lowest value of a column during CREATE NICKNAME or ALTER NICKNAME statement processing. The DB2 optimizer can use this second-lowest value or the lowest value when the optimizer develops an optimized query plan.

Parameters:
low2Key - The low2Key value.
Since:
IBM DB2 Information Integrator Version 8.2

setNewColumnName

public void setNewColumnName(java.lang.String newColumnName)
Set the new name for the column. Set the new column name that is specified in an ALTER COLUMN statement that includes an ALTER or SET COLUMN clause to rename the column.

Parameters:
newColumnName - The new column name to be set.
Since:
IBM DB2 Information Integrator Version 8.2

setNulls

public void setNulls(boolean nulls)
Set the nulls-allowed flag.

Parameters:
nulls - True to allow null values. False to disallow null values.
Since:
IBM DB2 Information Integrator Version 8.2

setOrgLength

public void setOrgLength(int orgLength)
Set the maximum length (in bytes) for the column.

Parameters:
orgLength - The length to be set.
Since:
IBM DB2 Information Integrator Version 8.2

setOrgScale

public void setOrgScale(short orgScale)
Set the numeric scale of the column.

Parameters:
orgScale - The scale to be set.
Since:
IBM DB2 Information Integrator Version 8.2

setTypeName

public void setTypeName(java.lang.String typeName)
Set the name of the local column type.

Parameters:
typeName - The local type name of the column.
Since:
IBM DB2 Information Integrator Version 8.2

setTypeSchema

public void setTypeSchema(java.lang.String typeSchema)
Set the schema of the local column type.

Parameters:
typeSchema - The local type schema name of the column.
Since:
IBM DB2 Information Integrator Version 8.2

IBM DB2 Information Integrator
Java API Reference
for Developing Wrappers

(C)Copyright IBM Corp. 2002. All rights reserved.

Links on this page are made available for your convenience and may take you to non-IBM sites. IBM does not warrant any sample code provided on these sites.