All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class postgresql.ResultSet

java.lang.Object
   |
   +----postgresql.ResultSet

public abstract class ResultSet
extends Object
This class implements the common internal methods used by both JDBC 1 and JDBC 2 specifications.


Constructor Index

 o ResultSet(Connection, Field[], Vector, String, int)
Create a new ResultSet - Note that we create ResultSets to represent the results of everything.

Method Index

 o append(ResultSet)
This following method allows us to add a ResultSet object to the end of the current chain.
 o close()
This is part of the JDBC API, but is required by postgresql.Field
 o getColumnCount()
getColumnCount returns the number of columns
 o getColumnOID(int)
returns the OID of a field.

It is used internally by the driver.

 o getNext()
Since ResultSets can be chained, we need some method of finding the next one in the chain.
 o getResultCount()
If we are just a place holder for results, we still need to get an updateCount.
 o getStatusString()
Returns the status message from the backend.

It is used internally by the driver.

 o getString(int)
 o getTupleCount()
We also need to provide a couple of auxiliary functions for the implementation of the ResultMetaData functions.
 o next()
 o reallyResultSet()
We at times need to know if the resultSet we are working with is the result of an UPDATE, DELETE or INSERT (in which case, we only have a row count), or of a SELECT operation (in which case, we have multiple fields) - this routine tells us.

Constructors

 o ResultSet
 public ResultSet(Connection conn,
                  Field fields[],
                  Vector tuples,
                  String status,
                  int updateCount)
Create a new ResultSet - Note that we create ResultSets to represent the results of everything.

Parameters:
fields - an array of Field objects (basically, the ResultSet MetaData)
tuples - Vector of the actual data
status - the status string returned from the back end
updateCount - the number of rows affected by the operation
cursor - the positioned update/delete cursor name

Methods

 o reallyResultSet
 public boolean reallyResultSet()
We at times need to know if the resultSet we are working with is the result of an UPDATE, DELETE or INSERT (in which case, we only have a row count), or of a SELECT operation (in which case, we have multiple fields) - this routine tells us.

Returns:
true if we have tuples available
 o getNext
 public ResultSet getNext()
Since ResultSets can be chained, we need some method of finding the next one in the chain. The method getNext() returns the next one in the chain.

Returns:
the next ResultSet, or null if there are none
 o append
 public void append(ResultSet r)
This following method allows us to add a ResultSet object to the end of the current chain.

Parameters:
r - the resultset to add to the end of the chain.
 o getResultCount
 public int getResultCount()
If we are just a place holder for results, we still need to get an updateCount. This method returns it.

Returns:
the updateCount
 o getTupleCount
 public int getTupleCount()
We also need to provide a couple of auxiliary functions for the implementation of the ResultMetaData functions. In particular, we need to know the number of rows and the number of columns. Rows are also known as Tuples

Returns:
the number of rows
 o getColumnCount
 public int getColumnCount()
getColumnCount returns the number of columns

Returns:
the number of columns
 o getStatusString
 public String getStatusString()
Returns the status message from the backend.

It is used internally by the driver.

Returns:
the status string from the backend
 o getColumnOID
 public int getColumnOID(int field)
returns the OID of a field.

It is used internally by the driver.

Parameters:
field - field id
Returns:
the oid of that field's type
 o close
 public abstract void close() throws SQLException
This is part of the JDBC API, but is required by postgresql.Field

 o next
 public abstract boolean next() throws SQLException
 o getString
 public abstract String getString(int i) throws SQLException

All Packages  Class Hierarchy  This Package  Previous  Next  Index