com.informix.jdbc

## Class IfxResultSetMetaData

- java.lang.Object
- - com.informix.jdbc.IfxResultSetMetaData

All Implemented Interfaces:
  IfmxResultSetMetaData, java.sql.ResultSetMetaData, java.sql.Wrapper

    public class IfxResultSetMetaData
    extends java.lang.Object
    implements IfmxResultSetMetaData

A ResultSetMetaData object can be used to find out about the types and properties of the columns in a ResultSet. ResultSetMetaData is a supplement of ResultSet to handle Column related information. Each ResultSet object can have either zero or one corresponding ResultSetMetaData object. Each ResultSetMetaData object will hold all column information in object instant variables. These instant variables got initialized by calling ResultSet object method getMetaData(). It will use protocal layer and issue an describe to database and get all column information. Fill these information into the ResultSetMetaData object. All the methods in ResultSetMetaData class just retrieve information from its instant variables and return to caller. One setColumnInfo(column) method for protocol layer to set these instant variables. Note: The only way to create ResultSetMetaData object is through calling ResultSet.getMetaData() method.

### Field Summary

Fields
`protected IfxConnection` `conn`
`protected boolean` `delimIdent`
`protected boolean` `hasVariableLengthCharColumns`
`protected boolean` `hasVariableLengthColumns`
`protected int` `rowidx`
`protected int` `serialidx`
`protected Trace` `trace`

### Fields inherited from interface java.sql.ResultSetMetaData

`columnNoNulls, columnNullable, columnNullableUnknown`

### Constructor Summary

Constructors
Constructor and Description
`IfxResultSetMetaData(int numcol, IfxConnection thisconn)` Constructor to allocate spaces

### Method Summary

Methods
`void` `cloneColumnInfo(int colnum, IfxColumnInfo from)`
`protected int` `findrowid()` Used by ResultSet() in order to support updatable cursors.
`protected java.lang.String` `findserial()` Used by ResultSet() in order to support updatable cursors.
`int` `getAlignment(int column)` What's the Column's alignment?
`java.lang.String` `getCatalogName(int column)` What's a column's table's catalog name? Not supported!
`IfmxResultSetMetaData` `getChild(int column)` What's the Column's child complex type information for a nested complex type.
`java.lang.String` `getColumnClassName(int column)` JDBC 2.0
`int` `getColumnCount()`
`int` `getColumnDisplaySize(int column)`
`int` `getColumnExtendedId(int column)` What's the Column's extended id?
`java.util.Vector<IfxColumnInfo>` `getColumnInfoVector()`
`java.lang.String` `getColumnLabel(int column)`
`int` `getColumnLength(int column)` What's the Column Length for this column?
`java.lang.String` `getColumnName(int column)`
`int` `getColumnStartPosition(int column)` What's the Column's starting position in the tuple?
`int` `getColumnType(int column)` What's a column's SQL type?
`java.lang.String` `getColumnTypeName(int column)` What's a column's data source specific type name?
`IfxConnection` `getConnection()`
`boolean` `getDelimIdent()`
`int` `getEncodedLength(int column)` Gets the column's encoded Length
`java.lang.String` `getExtendedName(int column)` What's the Column's extended name?
`java.lang.String` `getExtendedOwnerName(int column)` What's the Column's extended type's owner name?
`short` `getFieldNo(int column)` What's the Column's Field number?
`int` `getIfxColumnType(int column)` What's a column's Informix SQL type?
`short` `getLevelNo(int column)` What's the Column's Level number?
`protected int` `getMode(int colnum)`
`short` `getParentNo(int column)` What's the Column's Parent number?
`int` `getPrecision(int column)`
`short` `getReference(int column)` What's the Column's reference type?
`int` `getScale(int column)`
`java.lang.String` `getSchemaName(int column)`
`short` `getSeqNo(int column)` What's the Column's Sequence number?
`int` `getSourceType(int column)` What's the Column's SourceType?
`java.lang.String` `getTableName(int column)`
`protected short` `getTupleSize()` Return the size of one row
`boolean` `isAutoIncrement(int column)` Is the column automatically numbered, thus read-only? If it is Informix SERIAL data type ? Examine SQLtype of the column.
`boolean` `isCaseSensitive(int column)`
`boolean` `isCurrency(int column)`
`boolean` `isDefinitelyWritable(int column)`
`boolean` `isDistinct(int column)` Is the column a distinct type?
`boolean` `isNamedRow(int column)` Is the column a named row type?
`int` `isNullable(int column)`
`boolean` `isReadOnly(int column)`
`boolean` `isSearchable(int column)`
`boolean` `isSigned(int column)`
`boolean` `isVariableLengthType(int colnum)`
`boolean` `isWrapperFor(java.lang.Class<?> iface)`
`boolean` `isWritable(int column)`
`void` `parseSetTableName(java.lang.String command)`
`static java.lang.String` `parseTableName(java.lang.String command)` parseTableName Given the command string, get the table name out of it by looking for the identifier after certain words.
`void` `setAutoIncrement(int colnum, short ai)`
`void` `setColumnCount(int numcol)`
`void` `setColumnInfo(int colnum, java.lang.String name, int type, int length)`
`IfxResultSetMetaData` `setColumnName(int colnum, java.lang.String Xname)`
`IfxResultSetMetaData` `setDataSourceName(int colnum, java.lang.String Xstype)`
`IfxResultSetMetaData` `setDecimalDigits(int colnum, int Xdigits)`
`void` `setDelimIdent(boolean value)`
`void` `setEncodedLength(int colnum, int len)`
`IfxResultSetMetaData` `setIfxColumnType(int colnum, int Xtype)`
`protected void` `setMode(int colnum, int modeVal)`
`void` `setNullable(int colnum, int Xnull)`
`IfxResultSetMetaData` `setRightDecimal(int colnum, int Xright)`
`IfxResultSetMetaData` `setTableName(int colnum, java.lang.String Xtname)`
`void` `setTextByteColumnCount()`
`protected void` `setTupleSize(short size)` Store the size of one row returned by the server
`static boolean` `setTypeBooleanFields(IfxColumnInfo cinfo, int Xtype)`
`<T> T` `unwrap(java.lang.Class<T> iface)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### hasVariableLengthColumns

    protected boolean hasVariableLengthColumns

#### hasVariableLengthCharColumns

    protected boolean hasVariableLengthCharColumns

#### delimIdent

    protected boolean delimIdent

#### conn

    protected IfxConnection conn

#### trace

    protected Trace trace

#### serialidx

    protected int serialidx

#### rowidx

    protected int rowidx

### Constructor Detail

#### IfxResultSetMetaData

    public IfxResultSetMetaData(int numcol,
                        IfxConnection thisconn)

Constructor to allocate spaces

### Method Detail

#### getColumnInfoVector

    public java.util.Vector<IfxColumnInfo> getColumnInfoVector()
                                                        throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getColumnCount

    public int getColumnCount()
                       throws java.sql.SQLException

Specified by:
  `getColumnCount` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### getColumnLength

    public int getColumnLength(int column)
                        throws java.sql.SQLException

What's the Column Length for this column?

Throws:
  `java.sql.SQLException`

#### getColumnStartPosition

    public int getColumnStartPosition(int column)
                               throws java.sql.SQLException

What's the Column's starting position in the tuple?

Specified by:
  `getColumnStartPosition` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  The column's start position.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### getColumnExtendedId

    public int getColumnExtendedId(int column)
                            throws java.sql.SQLException

What's the Column's extended id?

Specified by:
  `getColumnExtendedId` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  The extended id.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### getExtendedName

    public java.lang.String getExtendedName(int column)
                                     throws java.sql.SQLException

What's the Column's extended name?

Specified by:
  `getExtendedName` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  The extended type name.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### getExtendedOwnerName

    public java.lang.String getExtendedOwnerName(int column)
                                          throws java.sql.SQLException

What's the Column's extended type's owner name?

Specified by:
  `getExtendedOwnerName` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  The owner name.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### getReference

    public short getReference(int column)
                       throws java.sql.SQLException

What's the Column's reference type?

Specified by:
  `getReference` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  The reference type.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### getAlignment

    public int getAlignment(int column)
                     throws java.sql.SQLException

What's the Column's alignment?

Specified by:
  `getAlignment` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  The alignment.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### getSourceType

    public int getSourceType(int column)
                      throws java.sql.SQLException

What's the Column's SourceType?

Specified by:
  `getSourceType` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  The source type.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### isAutoIncrement

    public boolean isAutoIncrement(int column)
                            throws java.sql.SQLException

Is the column automatically numbered, thus read-only? If it is Informix SERIAL data type ? Examine SQLtype of the column.

Specified by:
  `isAutoIncrement` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  true if so
Throws:
  `java.sql.SQLException`

#### isCaseSensitive

    public boolean isCaseSensitive(int column)
                            throws java.sql.SQLException

Specified by:
  `isCaseSensitive` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### isSearchable

    public boolean isSearchable(int column)
                         throws java.sql.SQLException

Specified by:
  `isSearchable` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### isCurrency

    public boolean isCurrency(int column)
                       throws java.sql.SQLException

Specified by:
  `isCurrency` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### isNullable

    public int isNullable(int column)
                   throws java.sql.SQLException

Specified by:
  `isNullable` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### isSigned

    public boolean isSigned(int column)
                     throws java.sql.SQLException

Specified by:
  `isSigned` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### getColumnDisplaySize

    public int getColumnDisplaySize(int column)
                             throws java.sql.SQLException

Specified by:
  `getColumnDisplaySize` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### getColumnLabel

    public java.lang.String getColumnLabel(int column)
                                    throws java.sql.SQLException

Specified by:
  `getColumnLabel` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### getColumnName

    public java.lang.String getColumnName(int column)
                                   throws java.sql.SQLException

Specified by:
  `getColumnName` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### getSchemaName

    public java.lang.String getSchemaName(int column)
                                   throws java.sql.SQLException

Specified by:
  `getSchemaName` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### getPrecision

    public int getPrecision(int column)
                     throws java.sql.SQLException

Specified by:
  `getPrecision` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### getEncodedLength

    public int getEncodedLength(int column)
                         throws java.sql.SQLException

Description copied from interface: `IfmxResultSetMetaData`

Gets the column's encoded Length

Specified by:
  `getEncodedLength` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  The column's encoded length.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### getScale

    public int getScale(int column)
                 throws java.sql.SQLException

Specified by:
  `getScale` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### getTableName

    public java.lang.String getTableName(int column)
                                  throws java.sql.SQLException

Specified by:
  `getTableName` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### getCatalogName

    public java.lang.String getCatalogName(int column)
                                    throws java.sql.SQLException

What's a column's table's catalog name? Not supported!

Specified by:
  `getCatalogName` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  column name or "" if not applicable.
Throws:
  `java.sql.SQLException`

#### getColumnType

    public int getColumnType(int column)
                      throws java.sql.SQLException

What's a column's SQL type?

Specified by:
  `getColumnType` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  SQL type
Throws:
  `java.sql.SQLException`
See Also:
  `Types`

#### getIfxColumnType

    public int getIfxColumnType(int column)
                         throws java.sql.SQLException

What's a column's Informix SQL type?

Specified by:
  `getIfxColumnType` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  SQL type
Throws:
  `java.sql.SQLException` - if a database access error occurs
See Also:
  `Types`

#### getColumnTypeName

    public java.lang.String getColumnTypeName(int column)
                                       throws java.sql.SQLException

What's a column's data source specific type name?

Specified by:
  `getColumnTypeName` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  type name
Throws:
  `java.sql.SQLException`

#### isReadOnly

    public boolean isReadOnly(int column)
                       throws java.sql.SQLException

Specified by:
  `isReadOnly` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### isWritable

    public boolean isWritable(int column)
                       throws java.sql.SQLException

Specified by:
  `isWritable` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### isDefinitelyWritable

    public boolean isDefinitelyWritable(int column)
                                 throws java.sql.SQLException

Specified by:
  `isDefinitelyWritable` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### isDistinct

    public boolean isDistinct(int column)
                       throws java.sql.SQLException

Is the column a distinct type?

Specified by:
  `isDistinct` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  true if so
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### isNamedRow

    public boolean isNamedRow(int column)
                       throws java.sql.SQLException

Is the column a named row type?

Specified by:
  `isNamedRow` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  true if so
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### getChild

    public IfmxResultSetMetaData getChild(int column)
                                   throws java.sql.SQLException

What's the Column's child complex type information for a nested complex type.

Specified by:
  `getChild` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  The child.
Throws:
  `java.sql.SQLException`

#### getLevelNo

    public short getLevelNo(int column)
                     throws java.sql.SQLException

What's the Column's Level number?

Specified by:
  `getLevelNo` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  level no.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### getSeqNo

    public short getSeqNo(int column)
                   throws java.sql.SQLException

What's the Column's Sequence number?

Specified by:
  `getSeqNo` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  seq no.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### getParentNo

    public short getParentNo(int column)
                      throws java.sql.SQLException

What's the Column's Parent number?

Specified by:
  `getParentNo` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  parent no.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### getFieldNo

    public short getFieldNo(int column)
                     throws java.sql.SQLException

What's the Column's Field number?

Specified by:
  `getFieldNo` in interface `IfmxResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  field no.
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### setEncodedLength

    public void setEncodedLength(int colnum,
                        int len)
                          throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### setNullable

    public void setNullable(int colnum,
                   int Xnull)
                     throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### setAutoIncrement

    public void setAutoIncrement(int colnum,
                        short ai)
                          throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### setColumnName

    public IfxResultSetMetaData setColumnName(int colnum,
                                     java.lang.String Xname)
                                       throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### setDecimalDigits

    public IfxResultSetMetaData setDecimalDigits(int colnum,
                                        int Xdigits)
                                          throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### setRightDecimal

    public IfxResultSetMetaData setRightDecimal(int colnum,
                                       int Xright)
                                         throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### setTableName

    public IfxResultSetMetaData setTableName(int colnum,
                                    java.lang.String Xtname)
                                      throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### isVariableLengthType

    public boolean isVariableLengthType(int colnum)
                                 throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### setIfxColumnType

    public IfxResultSetMetaData setIfxColumnType(int colnum,
                                        int Xtype)
                                          throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### setTypeBooleanFields

    public static boolean setTypeBooleanFields(IfxColumnInfo cinfo,
                               int Xtype)

#### setDataSourceName

    public IfxResultSetMetaData setDataSourceName(int colnum,
                                         java.lang.String Xstype)
                                           throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### setColumnCount

    public void setColumnCount(int numcol)

#### setColumnInfo

    public void setColumnInfo(int colnum,
                     java.lang.String name,
                     int type,
                     int length)
                       throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### setDelimIdent

    public void setDelimIdent(boolean value)

#### getDelimIdent

    public boolean getDelimIdent()

#### getConnection

    public IfxConnection getConnection()

#### cloneColumnInfo

    public void cloneColumnInfo(int colnum,
                       IfxColumnInfo from)
                         throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getColumnClassName

    public java.lang.String getColumnClassName(int column)
                                        throws java.sql.SQLException

JDBC 2.0

Return the fully qualified name of the Java class whose instances are manufactured if ResultSet.getObject() is called to retrieve a value from the column. ResultSet.getObject() may return a subClass of the class returned by this method.

Specified by:
  `getColumnClassName` in interface `java.sql.ResultSetMetaData`
Throws:
  `java.sql.SQLException`

#### setTextByteColumnCount

    public void setTextByteColumnCount()
                                throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### parseTableName

    public static java.lang.String parseTableName(java.lang.String command)

parseTableName Given the command string, get the table name out of it by looking for the identifier after certain words. Note that if the user has a database object called 'from', this parser is not smart enough to figure that out and eventually may cause ambiguity problems. We'll need to document this. Conforming to JDBC API reference manual, in case of select queries involving joins or in case of queries where no table name is involved we return an empty string. Also , if we can not determine table name for any reason , we return an empty string. If server implements FEA#165847 we may not have to parse the query at client end any more. Following are known cases (as of now !) which are not handled correctly by this method " UPDATE ONLY(super_tab) WHERE ....." "SELECT * FROM ONLY(super_tab)" Table name returned is "ONLY(super_tab)" "SELECT part_number, COUNT(*) * 100 AS how_many FROM 1000000 SAMPLES OF parts_sold GROUP BY part_number;" Table name returned is "1000000"

#### parseSetTableName

    public void parseSetTableName(java.lang.String command)
                           throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### findrowid

    protected int findrowid()
                     throws java.sql.SQLException

Used by ResultSet() in order to support updatable cursors. This method returns the index of the column name 'rowid' if used specifically by the user in their query. This method also sets the local variable 'rowidx' to the index of the column within the resultset.

Throws:
  `java.sql.SQLException`

#### findserial

    protected java.lang.String findserial()
                                   throws java.sql.SQLException

Used by ResultSet() in order to support updatable cursors. This method returns the column name when the column type of serial or serial8 is used specifically by the user in their query. It also sets the local variable serialidx to the index of the serial column within the resultset.

Throws:
  `java.sql.SQLException`

#### setTupleSize

    protected void setTupleSize(short size)

Store the size of one row returned by the server

#### getTupleSize

    protected short getTupleSize()

Return the size of one row

#### getMode

    protected int getMode(int colnum)
                   throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### setMode

    protected void setMode(int colnum,
               int modeVal)
                    throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### isWrapperFor

    public boolean isWrapperFor(java.lang.Class<?> iface)
                         throws java.sql.SQLException

Specified by:
  `isWrapperFor` in interface `java.sql.Wrapper`
Throws:
  `java.sql.SQLException`

#### unwrap

    public <T> T unwrap(java.lang.Class<T> iface)
             throws java.sql.SQLException

Specified by:
  `unwrap` in interface `java.sql.Wrapper`
Throws:
  `java.sql.SQLException`