Project:dool
Class List Class Hierarchy
Summary: Ctors Methods

Module dool.sql.dpq.DPQResult

Class DPQResult

Implemented interfaces:
ResultSet
public class DPQResult

DPQResult

Constructor Summary
(Statement statement, PGresult* result)
          Creates a new DPQResult from a PQresult

Methods Summary
public PGresult* getResult()
          
bit hasMore()
          
ExecStatusType status()
          /* Accessor functions for PGresult objects
static String resStatus(ExecStatusType status)
          get the resStatus message
String getStatusMessage()
          
String errorMessage()
          result error message
int nTuples()
          Returns the number of tuples (rows) in the query result.
int nFields()
          Returns the number of fields (columns) in each row of the query result.
int binaryTuples()
          Returns 1 if the PGresult contains binary tuple data, 0 if it contains ASCII data.
String fName(int field_num)
          Returns the number of fields (columns) in each row of the query result.
String getColumnName(int column)
          
int fNumber(char fieldName)
          Returns the field (column) index associated with the given field name.
Oid fType(int fieldNum)
          eturns the field type associated with the given field index.
int fSize(int fieldNum)
          Returns the size in bytes of the field associated with the given field index.
int fMod(int fieldNum)
          Returns the type-specific modification data of the field associated with the given field index.
String cmdStatus()
          Returns the command status string from the SQL command that generated the PGresult.
String oidStatus()
          Returns a string with the object ID of the inserted row, if the SQL command was an INSERT.
Oid oidValue()
          Returns the object ID of the inserted row, if the SQL command was an INSERT that inserted exactly one row into a table that has OIDs.
String cmdTuples()
          Returns the number of rows affected by the SQL command.
String getValue(int tup_num, int field_num)
          Returns a single field (column) value of one tuple (row) of a PGresult.
int getLength(int tup_num, int field_num)
          Returns the length of a field (attribute) value in bytes.
bit isNull(int tup_num, int field_num)
          Tests a field for a NULL entry.
void clear()
          /* Delete a PGresult Clear the result.
static DPQResult makeEmptyResult(DPQConnect connect, ExecStatusType status)
          Make an empty PGresult with given status (some apps find this useful).
String getFieldNames()
          Gets all the field names in an array of strings
bit valid()
          Check the status for any of the non-error values
DBMetaTuple getMetaTuple()
          
SQLType getType(int column)
          
int columnCount()
          
char getChar(int column)
          Get a field value as char
String getString(int column)
          Get a field value as String
bit getBit(int column)
          Get a field value as bit
long getInteger(int column)
          Get a field value as
double getDouble(int column)
          Get a field value as
void* getBlob(int column)
          Get a field value as blob (void*)
DBTuple getTuples(char statement, int maximum)
          
DBTuple getTuples(String statement, int maximum)
          
DBTuple getTuples(int maximum)
          
DBTuple getTuple(char statement)
          
DBTuple getTuple(String statement)
          
DBTuple getTuple()
          


public PGresult* getResult()

this (Statement statement, PGresult* result)
/** * Creates a new DPQResult from a PQresult * @param result the PQresult * \todo throw invalid PQresult */
bit hasMore()

ExecStatusType status()
/* Accessor functions for PGresult objects */
static String resStatus(ExecStatusType status)
/** * get the resStatus message * @param status * @return the message */
String getStatusMessage()

String errorMessage()
/** * result error message * @return the error message */
int nTuples()
/** * Returns the number of tuples (rows) in the query result. * @return the number of tuples */
int nFields()
/** * Returns the number of fields (columns) in each row of the query result. * @return the number of fileds for this result */
int binaryTuples()
/** * Returns 1 if the PGresult contains binary tuple data, 0 if it contains ASCII data. * Currently, binary tuple data can only be returned by a query that extracts data from a binary cursor. * @return */
String fName(int field_num)
/** * Returns the number of fields (columns) in each row of the query result. * @param field_num the field number * @return the field name */
String getColumnName(int column)

int fNumber(char[] fieldName)
/** * Returns the field (column) index associated with the given field name. * @param fieldName * @return the fields number */
Oid fType(int fieldNum)
/** * eturns the field type associated with the given field index. * The integer returned is an internal coding of the type. Field indices start at 0. * @param fieldNum * @return the fields type */
int fSize(int fieldNum)
/** * Returns the size in bytes of the field associated with the given field index. Field indices start at 0. * @param fieldNum * @return the field size */
int fMod(int fieldNum)
/** * Returns the type-specific modification data of the field associated with the given field index. Field indices start at 0. * @param fieldNum * @return */
String cmdStatus()
/** * Returns the command status string from the SQL command that generated the PGresult. * @return the command status description ??? */
String oidStatus()
/** * Returns a string with the object ID of the inserted row, if the SQL command was an INSERT. * (The string will be 0 if the INSERT did not insert exactly one row, * or if the target table does not have OIDs.) * If the command was not an INSERT, returns an empty string. * old and ugly * @return */
Oid oidValue()
/** * Returns the object ID of the inserted row, if the SQL command was an INSERT * that inserted exactly one row into a table that has OIDs. * Otherwise, returns InvalidOid. * The type Oid and the constant InvalidOid will be defined if you include the libpq header file. * They will both be some integer type. * new and improved * @return */
String cmdTuples()
/** * Returns the number of rows affected by the SQL command. * If the SQL command that generated the PGresult was INSERT, UPDATE or DELETE, * this returns a string containing the number of rows affected. * If the command was anything else, it returns the empty string. * @return */
String getValue(int tup_num, int field_num)
/** * Returns a single field (column) value of one tuple (row) of a PGresult. * For most queries, the value returned by PQgetvalue is a null-terminated * character string representation of the attribute value. * But if PQbinaryTuples() is 1, the value returned by PQgetvalue is the * binary representation of the type in the internal format of the backend server * (but not including the size word, if the field is variable-length). * It is then the programmer's responsibility to cast and convert the * data to the correct C type. The pointer returned by PQgetvalue points * to storage that is part of the PGresult structure. * One should not modify it, and one must explicitly copy the value into other * storage if it is to be used past the lifetime of the PGresult structure itself. * Tuple and field indices start at 0. * @param tup_num * @param field_num */
int getLength(int tup_num, int field_num)
/** * Returns the length of a field (attribute) value in bytes. Tuple and field indices start at 0. * This is the actual data length for the particular data value, * that is the size of the object pointed to by PQgetvalue. * Note that for character-represented values, this size has little to do with * the binary size reported by PQfsize. * @param tup_num * @param field_num * @return the length */
bit isNull(int tup_num, int field_num)
/** * Tests a field for a NULL entry. Tuple and field indices start at 0. * This function returns 1 if the field contains a NULL, 0 if it contains a non-null value. * (Note that PQgetvalue will return an empty string, not a null pointer, for a NULL field.) * @param tup_num * @param field_num * @return true if value is null */
void clear()
/* Delete a PGresult */ /** * Clear the result. * always clear to avoid memory leaks */
static DPQResult makeEmptyResult(DPQConnect connect, ExecStatusType status)
/** * Make an empty PGresult with given status (some apps find this * useful). If conn is not NULL and status indicates an error, the * conn's errorMessage is copied. */
String [] getFieldNames()
/** * Gets all the field names in an array of strings * @return an array of string with all the fields names */
bit valid()
/** * Check the status for any of the non-error values * @return true if ok */
DBMetaTuple getMetaTuple()

SQLType getType(int column)

int columnCount()

char getChar(int column)
/** * Get a field value as char */
String getString(int column)
/** * Get a field value as String */
bit getBit(int column)
/** * Get a field value as bit */
long getInteger(int column)
/** * Get a field value as */
double getDouble(int column)
/** * Get a field value as */
void* getBlob(int column)
/** * Get a field value as blob (void*) */
DBTuple [] getTuples(char[] statement, int maximum)

DBTuple [] getTuples(String statement, int maximum)

DBTuple [] getTuples(int maximum)

DBTuple getTuple(char[] statement)

DBTuple getTuple(String statement)

DBTuple getTuple()