com.ibm.as400.access
Class AS400JDBCResultSetMetaData

java.lang.Object
  extended bycom.ibm.as400.access.AS400JDBCResultSetMetaData
All Implemented Interfaces:
ResultSetMetaData

public class AS400JDBCResultSetMetaData
extends Object
implements ResultSetMetaData

The AS400JDBCResultSetMetaData class describes the columns in a result set.


Field Summary
 
Fields inherited from interface java.sql.ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown
 
Method Summary
 String getCatalogName(int columnIndex)
          Returns the catalog name of the table for a column.
 String getColumnClassName(int columnIndex)
          Returns the name of a Java class whose instances are created if ResultSet.getObject() is called to retrieve from the column.
 int getColumnCount()
          Returns the number of columns in the result set.
 int getColumnDisplaySize(int columnIndex)
          Returns the normal maximum width of a column.
 String getColumnLabel(int columnIndex)
          Returns the suggested label for use in printouts or displays for a column.
 String getColumnName(int columnIndex)
          Returns the name of a column.
 int getColumnType(int columnIndex)
          Returns the type of a column.
 String getColumnTypeName(int columnIndex)
          Returns the type name of a column.
 int getPrecision(int columnIndex)
          Returns the precision of a column.
 int getScale(int columnIndex)
          Returns the scale of a column.
 String getSchemaName(int columnIndex)
          Returns the schema name of the table for a column.
 String getTableName(int columnIndex)
          Returns the column's table name.
 boolean isAutoIncrement(int columnIndex)
          Indicates if the column is automatically numbered.
 boolean isCaseSensitive(int columnIndex)
          Indicates if the column is case sensitive.
 boolean isCurrency(int columnIndex)
          Indicates if the column is a currency value.
 boolean isDefinitelyWritable(int columnIndex)
          Indicates if a write on the column will definitely succeed.
 int isNullable(int columnIndex)
          Indicates if the column can contain an SQL NULL value.
 boolean isReadOnly(int columnIndex)
          Indicates if the column is read-only.
 boolean isSearchable(int columnIndex)
          Indicates if the column be used in a where clause.
 boolean isSigned(int columnIndex)
          Indicates if the column can contain a signed value.
 boolean isWritable(int columnIndex)
          Indicates if it is possible for a write on the column to succeed.
 String toString()
          Returns the name of the SQL cursor in use by this result set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCatalogName

public String getCatalogName(int columnIndex)
                      throws SQLException
Returns the catalog name of the table for a column.

Specified by:
getCatalogName in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
The catalog name.
Throws:
SQLException - If the column index is not valid.

getColumnClassName

public String getColumnClassName(int columnIndex)
                          throws SQLException
Returns the name of a Java class whose instances are created if ResultSet.getObject() is called to retrieve from the column. The actual class created may be a subclass of the returned class.

Specified by:
getColumnClassName in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
The class name.
Throws:
SQLException - If the column index is not valid.

getColumnCount

public int getColumnCount()
                   throws SQLException
Returns the number of columns in the result set.

Specified by:
getColumnCount in interface ResultSetMetaData
Returns:
The number of columns.
Throws:
SQLException - If an error occurs.

getColumnDisplaySize

public int getColumnDisplaySize(int columnIndex)
                         throws SQLException
Returns the normal maximum width of a column.

Specified by:
getColumnDisplaySize in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
The normal maximum width (in characters).
Throws:
SQLException - If the column index is not valid.

getColumnLabel

public String getColumnLabel(int columnIndex)
                      throws SQLException
Returns the suggested label for use in printouts or displays for a column.

Specified by:
getColumnLabel in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
The column label if the user set the driver property "extended metadata" to true and the server returns us a column label, otherwise the column name.
Throws:
SQLException - If the column index is not valid.

getColumnName

public String getColumnName(int columnIndex)
                     throws SQLException
Returns the name of a column.

Specified by:
getColumnName in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
The column name.
Throws:
SQLException - If the column index is not valid.

getColumnType

public int getColumnType(int columnIndex)
                  throws SQLException
Returns the type of a column. If the type is a distinct type, this returns the underlying type.

Specified by:
getColumnType in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
The SQL type code defined in java.sql.Types.
Throws:
SQLException - If the column index is not valid.

getColumnTypeName

public String getColumnTypeName(int columnIndex)
                         throws SQLException
Returns the type name of a column. If the type is a distinct type, this returns the underlying type name.

Specified by:
getColumnTypeName in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
The column type name.
Throws:
SQLException - If the column index is not valid.

getPrecision

public int getPrecision(int columnIndex)
                 throws SQLException
Returns the precision of a column. This is the number of decimal digits the column may hold.

Specified by:
getPrecision in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
The precision.
Throws:
SQLException - If the column index is not valid.

getScale

public int getScale(int columnIndex)
             throws SQLException
Returns the scale of a column. This is number of digits to the right of the decimal point.

Specified by:
getScale in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
The scale.
Throws:
SQLException - If the column index is not valid.

getSchemaName

public String getSchemaName(int columnIndex)
                     throws SQLException
Returns the schema name of the table for a column. This method is supported only if the user has set the driver property "extended metadata" to true.

Specified by:
getSchemaName in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
The schema name if the user set the driver property "extended metadata" to true and the server returns us a schema name, otherwise "".
Throws:
SQLException - If the column index is not valid.

getTableName

public String getTableName(int columnIndex)
                    throws SQLException
Returns the column's table name. This method is supported only if the user has set the driver property "extended metadata" to true.

Specified by:
getTableName in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
The base table name if the user set the driver property "extended metadata" to true and the server returns us a table name, otherwise "".
Throws:
SQLException - If the column index is not valid.

isAutoIncrement

public boolean isAutoIncrement(int columnIndex)
                        throws SQLException
Indicates if the column is automatically numbered.

Specified by:
isAutoIncrement in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
Always false. DB2 UDB for iSeries does not support automatically numbered columns.
Throws:
SQLException - If the column index is not valid.

isCaseSensitive

public boolean isCaseSensitive(int columnIndex)
                        throws SQLException
Indicates if the column is case sensitive.

Specified by:
isCaseSensitive in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
true if the column is case sensitive; false otherwise.
Throws:
SQLException - If the column index is not valid.

isCurrency

public boolean isCurrency(int columnIndex)
                   throws SQLException
Indicates if the column is a currency value.

Specified by:
isCurrency in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
Always false. DB2 UDB for iSeries does not directly support currency values.
Throws:
SQLException - If the column index is not valid.

isDefinitelyWritable

public boolean isDefinitelyWritable(int columnIndex)
                             throws SQLException
Indicates if a write on the column will definitely succeed.

Specified by:
isDefinitelyWritable in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
Always false. The driver does not check if the user has the necessary authority to write to the column.
Throws:
SQLException - If the column index is not valid.

isNullable

public int isNullable(int columnIndex)
               throws SQLException
Indicates if the column can contain an SQL NULL value.

Specified by:
isNullable in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
true if the column is can contain an SQL NULL value; false otherwise.
Throws:
SQLException - If the column index is not valid.

isReadOnly

public boolean isReadOnly(int columnIndex)
                   throws SQLException
Indicates if the column is read-only.

Specified by:
isReadOnly in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
true if the column is read-only; false otherwise.
Throws:
SQLException - If the column index is not valid.

isSearchable

public boolean isSearchable(int columnIndex)
                     throws SQLException
Indicates if the column be used in a where clause.

Specified by:
isSearchable in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
If the user has set the "extended metadata" driver property to true, returns true if the column can be used in a where clause with any comparison operator except LIKE, returns false if the column cannot be used in a where clause. If the "extended metadata" driver property is set to false, true will always be returned.
Throws:
SQLException - If the column index is not valid.

isSigned

public boolean isSigned(int columnIndex)
                 throws SQLException
Indicates if the column can contain a signed value.

Specified by:
isSigned in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
true if the column is signed; false otherwise.
Throws:
SQLException - If the column index is not valid.

isWritable

public boolean isWritable(int columnIndex)
                   throws SQLException
Indicates if it is possible for a write on the column to succeed. The write may fail even if this method returns true. The accuracy of this method will be improved if the "extended metadata" property is set to true.

Specified by:
isWritable in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
true if it is possible for a write on the column to succeed; false otherwise.
Throws:
SQLException - If the column index is not valid.

toString

public String toString()
Returns the name of the SQL cursor in use by this result set.

Returns:
The cursor name.