org.apache.derby.iapi.sql
Interface ResultDescription

All Known Implementing Classes:
GenericResultDescription

public interface ResultDescription

The ResultDescription interface provides methods to get metadata on the results returned by a statement.

Author:
Jeff Lichtman

Method Summary
 int getColumnCount()
          Returns the number of columns in the result set.
 ResultColumnDescriptor getColumnDescriptor(int position)
          Returns a ResultColumnDescriptor for the column, given the oridinal position of the column.
 ResultColumnDescriptor[] getColumnInfo()
          Return information about all the columns.
 java.lang.String getStatementType()
          Returns an identifier that tells what type of statement has been executed.
 ResultDescription truncateColumns(int truncateFrom)
          Get a new result description that has been truncated from input column number.
 

Method Detail

getStatementType

public java.lang.String getStatementType()
Returns an identifier that tells what type of statement has been executed. This can be used to determine what other methods to call to get the results back from a statement. For example, a SELECT statement returns rows and columns, while other statements don't, so you would only call getColumnCount() or getColumnType() for SELECT statements.

Returns:
A String identifier telling what type of statement this is.

getColumnCount

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

Returns:
The number of columns in the result set.

getColumnInfo

public ResultColumnDescriptor[] getColumnInfo()
Return information about all the columns.


getColumnDescriptor

public ResultColumnDescriptor getColumnDescriptor(int position)
Returns a ResultColumnDescriptor for the column, given the oridinal position of the column. NOTE - position is 1-based.

Parameters:
position - The oridinal position of a column in the ResultSet.
Returns:
A ResultColumnDescriptor describing the column in the ResultSet.

truncateColumns

public ResultDescription truncateColumns(int truncateFrom)
Get a new result description that has been truncated from input column number. If the input column is 5, then columns 5 to getColumnCount() are removed. The new ResultDescription points to the same ColumnDescriptors (this method performs a shallow copy.

Parameters:
truncateFrom - the starting column to remove, 1-based.
Returns:
a new ResultDescription


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.