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.


Method Summary
 int findColumnInsenstive(java.lang.String name)
          Return the position of the column matching the passed in names following the JDBC rules for ResultSet.getXXX and updateXXX.
 int getColumnCount()
          Returns the number of columns in the result set.
 ResultColumnDescriptor getColumnDescriptor(int position)
          Returns a ResultColumnDescriptor for the column, given the ordiinal position of the column.
 ResultColumnDescriptor[] getColumnInfo()
          Return information about all the columns.
 java.sql.ResultSetMetaData getMetaData()
          Get the saved JDBC ResultSetMetaData.
 java.lang.String getStatementType()
          Returns an identifier that tells what type of statement has been executed.
 void setMetaData(java.sql.ResultSetMetaData rsmd)
          Set the JDBC ResultSetMetaData for this ResultDescription.
 ResultDescription truncateColumns(int truncateFrom)
          Get a new result description that has been truncated from input column number.
 

Method Detail

getStatementType

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

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

Returns:
The number of columns in the result set.

getColumnInfo

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


getColumnDescriptor

ResultColumnDescriptor getColumnDescriptor(int position)
Returns a ResultColumnDescriptor for the column, given the ordiinal 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

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. The saved JDBC ResultSetMetaData will not be copied.

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

setMetaData

void setMetaData(java.sql.ResultSetMetaData rsmd)
Set the JDBC ResultSetMetaData for this ResultDescription. A ResultSetMetaData object can be saved in the statement plan using this method. This only works while the ResultSetMetaData api does not contain a getConnection() method or a close method.
If this object already has a saved meta data object this call will do nothing. Due to synchronization the saved ResultSetMetaData object may not be the one passed in, ie. if two threads call this concurrently, only one will be saved. It is assumed the JDBC layer passes in a ResultSetMetaData object based upon this.


getMetaData

java.sql.ResultSetMetaData getMetaData()
Get the saved JDBC ResultSetMetaData. Will return null if setMetaData() has not been called on this object. The caller then should manufacture a ResultSetMetaData object and pass it into setMetaData.


findColumnInsenstive

int findColumnInsenstive(java.lang.String name)
Return the position of the column matching the passed in names following the JDBC rules for ResultSet.getXXX and updateXXX. Rules are the matching is case insensitive and the insensitive name matches the first column found that matches (starting at postion 1).

Parameters:
name -
Returns:
Position of the column (1-based), -1 if no match.

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.