com.ibm.as400.access

Class AS400JDBCResultSetMetaData

  • java.lang.Object
    • com.ibm.as400.access.AS400JDBCResultSetMetaData
  • All Implemented Interfaces:
    java.sql.ResultSetMetaData, java.sql.Wrapper


    public class AS400JDBCResultSetMetaData
    extends java.lang.Object
    implements java.sql.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

      Methods 
      Modifier and Type Method and Description
      java.lang.String getCatalogName(int columnIndex)
      Returns the catalog name of the table for a column.
      int getColumnCCSID(int columnIndex)
      Returns the CCSID of a character column.
      java.lang.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.
      java.lang.String getColumnLabel(int columnIndex)
      Returns the suggested label for use in printouts or displays for a column.
      java.lang.String getColumnName(int columnIndex)
      Returns the name of a column.
      int getColumnType(int columnIndex)
      Returns the type of a column.
      java.lang.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.
      java.lang.String getSchemaName(int columnIndex)
      Returns the schema name of the table for a column.
      java.lang.String getTableName(int columnIndex)
      Returns the column's table name.
      protected java.lang.String[] getValidWrappedList() 
      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.
      java.lang.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
      • Methods inherited from interface java.sql.Wrapper

        isWrapperFor, unwrap
    • Method Detail

      • getCatalogName

        public java.lang.String getCatalogName(int columnIndex)
                                        throws java.sql.SQLException
        Returns the catalog name of the table for a column.
        Specified by:
        getCatalogName in interface java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        The catalog name.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • getColumnClassName

        public java.lang.String getColumnClassName(int columnIndex)
                                            throws java.sql.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 java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        The class name.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • getColumnCount

        public int getColumnCount()
                           throws java.sql.SQLException
        Returns the number of columns in the result set.
        Specified by:
        getColumnCount in interface java.sql.ResultSetMetaData
        Returns:
        The number of columns.
        Throws:
        java.sql.SQLException - If an error occurs.
      • getColumnDisplaySize

        public int getColumnDisplaySize(int columnIndex)
                                 throws java.sql.SQLException
        Returns the normal maximum width of a column.
        Specified by:
        getColumnDisplaySize in interface java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        The normal maximum width (in characters).
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • getColumnLabel

        public java.lang.String getColumnLabel(int columnIndex)
                                        throws java.sql.SQLException
        Returns the suggested label for use in printouts or displays for a column.
        Specified by:
        getColumnLabel in interface java.sql.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 system returns us a column label, otherwise the column name.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • getColumnName

        public java.lang.String getColumnName(int columnIndex)
                                       throws java.sql.SQLException
        Returns the name of a column.
        Specified by:
        getColumnName in interface java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        The column name.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • getColumnType

        public int getColumnType(int columnIndex)
                          throws java.sql.SQLException
        Returns the type of a column. If the type is a distinct type, this returns the underlying type.
        Specified by:
        getColumnType in interface java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        The SQL type code defined in java.sql.Types.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • getColumnCCSID

        public int getColumnCCSID(int columnIndex)
                           throws java.sql.SQLException
        Returns the CCSID of a character column. Returns 0 if the column is not a character column.
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        CCSID of a character column, otherwise 0.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • getColumnTypeName

        public java.lang.String getColumnTypeName(int columnIndex)
                                           throws java.sql.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 java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        The column type name.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • getPrecision

        public int getPrecision(int columnIndex)
                         throws java.sql.SQLException
        Returns the precision of a column. This is the number of decimal digits the column may hold.
        Specified by:
        getPrecision in interface java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        The precision.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • getScale

        public int getScale(int columnIndex)
                     throws java.sql.SQLException
        Returns the scale of a column. This is number of digits to the right of the decimal point.
        Specified by:
        getScale in interface java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        The scale.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • getSchemaName

        public java.lang.String getSchemaName(int columnIndex)
                                       throws java.sql.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 java.sql.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 system returns us a schema name, otherwise "".
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • getTableName

        public java.lang.String getTableName(int columnIndex)
                                      throws java.sql.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 java.sql.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 system returns us a table name, otherwise "".
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • isAutoIncrement

        public boolean isAutoIncrement(int columnIndex)
                                throws java.sql.SQLException
        Indicates if the column is automatically numbered.
        Specified by:
        isAutoIncrement in interface java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        True if column is autoincrement, false otherwise.
        Throws:
        java.sql.SQLException - If the column index is not valid. Note: connection property "extended metadata" must be true for this method to be return accurate information. If the "extended metadata" connection property is not set to true, then this method will always return false.
      • isCaseSensitive

        public boolean isCaseSensitive(int columnIndex)
                                throws java.sql.SQLException
        Indicates if the column is case sensitive.
        Specified by:
        isCaseSensitive in interface java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        true if the column is case sensitive; false otherwise.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • isCurrency

        public boolean isCurrency(int columnIndex)
                           throws java.sql.SQLException
        Indicates if the column is a currency value.
        Specified by:
        isCurrency in interface java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        Always false. DB2 for IBM i does not directly support currency values.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • isDefinitelyWritable

        public boolean isDefinitelyWritable(int columnIndex)
                                     throws java.sql.SQLException
        Indicates if a write on the column will definitely succeed.
        Specified by:
        isDefinitelyWritable in interface java.sql.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:
        java.sql.SQLException - If the column index is not valid.
      • isNullable

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

        public boolean isReadOnly(int columnIndex)
                           throws java.sql.SQLException
        Indicates if the column is read-only.
        Specified by:
        isReadOnly in interface java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        true if the column is read-only; false otherwise.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • isSearchable

        public boolean isSearchable(int columnIndex)
                             throws java.sql.SQLException
        Indicates if the column be used in a where clause.
        Specified by:
        isSearchable in interface java.sql.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:
        java.sql.SQLException - If the column index is not valid.
      • isSigned

        public boolean isSigned(int columnIndex)
                         throws java.sql.SQLException
        Indicates if the column can contain a signed value.
        Specified by:
        isSigned in interface java.sql.ResultSetMetaData
        Parameters:
        columnIndex - The column index (1-based).
        Returns:
        true if the column is signed; false otherwise.
        Throws:
        java.sql.SQLException - If the column index is not valid.
      • isWritable

        public boolean isWritable(int columnIndex)
                           throws java.sql.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 java.sql.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:
        java.sql.SQLException - If the column index is not valid.
      • toString

        public java.lang.String toString()
        Returns the name of the SQL cursor in use by this result set.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The cursor name.
      • getValidWrappedList

        protected java.lang.String[] getValidWrappedList()