acedb
Class Result

java.lang.Object
  extended byacedb.Result
All Implemented Interfaces:
Constants

public class Result
extends java.lang.Object
implements Constants

provide a pointer iteration through the result. resultProperty controls the type of iterator. Empty field is represented as "" empty string (for null).


Field Summary
protected  int resultProperty
          to mark the type of result, currently RESULT_FORWARD, RESULT_RANDOM.
 
Fields inherited from interface acedb.Constants
ACESERV_MSGDATA, ACESERV_MSGENCORE, ACESERV_MSGFAIL, ACESERV_MSGKILL, ACESERV_MSGOK, ACESERV_MSGREQ, RESULT_BACKWARD, RESULT_FORWARD, RESULT_RANDOM
 
Constructor Summary
protected Result()
          construct an empty Result object if return 0 objects.
protected Result(java.lang.String r)
          the String r should be the whole message body obtained from the Ace or Aceclient class Should not be used outside the package.
protected Result(java.lang.String r, Aceconnect db)
          Construct a new Result object from String r.
protected Result(java.lang.String r, boolean random)
          Construct a random access result from a complete query result.
 
Method Summary
 boolean absolute(int row)
           
 void close()
           
 boolean first()
          for random access only.
 int getColumnCount()
          returns number of columns returns by AQL
 java.lang.String getColumnType(int cnum)
          returns column type at cnum as a String.
 int getCurrentRow()
          return the rows that have been accessed through next().
 double getDouble(int col)
           
 float getFloat(int col)
           
 int getInt(int col)
          retruns the column at col as an integer.
 java.lang.String[] getRowArray()
          returns row as an array of Strings
 int getRowCount()
          return the total rows in this result only if Result is set to be random access.
 java.lang.String getRowString()
          return the whole row as a single String object.
 java.lang.String getString(int col)
          return unquoted String.
 boolean isEmpty()
          Simply inform you whether you have obtained some results or not.
 boolean last()
           
 boolean next()
          if there is more results, after calling next you can retrieve the result with getXXXX methods.
 boolean nextForward()
          move pointer to the next item in result; this is a FORWARD_ONLY iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resultProperty

protected int resultProperty
to mark the type of result, currently RESULT_FORWARD, RESULT_RANDOM.

Constructor Detail

Result

protected Result()
construct an empty Result object if return 0 objects.


Result

protected Result(java.lang.String r)
the String r should be the whole message body obtained from the Ace or Aceclient class Should not be used outside the package. Only execQuery() methods from the Ace class produces Result objects.


Result

protected Result(java.lang.String r,
                 Aceconnect db)
Construct a new Result object from String r.

Parameters:
db - indicates whether more encore is needed. when the db argument is given, we assume more segments of results are needed to be obtained from the database.

Result

protected Result(java.lang.String r,
                 boolean random)
Construct a random access result from a complete query result. private member Random == true. resultProperty set to RESULT_RANDOM.

Method Detail

next

public boolean next()
             throws AceException
if there is more results, after calling next you can retrieve the result with getXXXX methods. If returned 0 objects, then next() will return false.

Throws:
AceException

nextForward

public boolean nextForward()
                    throws AceException
move pointer to the next item in result; this is a FORWARD_ONLY iterator. Cannot go backward. After calling this method, you can retrieve results with one of those getxxx() methods. If the result is empty, it simply returns false.

Returns:
true if has more items in the result
Throws:
AceException

first

public boolean first()
for random access only.


last

public boolean last()

absolute

public boolean absolute(int row)

getRowString

public java.lang.String getRowString()
return the whole row as a single String object.


isEmpty

public boolean isEmpty()
Simply inform you whether you have obtained some results or not.

Returns:
true if AQL returned // 0 active objects

getColumnCount

public int getColumnCount()
returns number of columns returns by AQL


getColumnType

public java.lang.String getColumnType(int cnum)
returns column type at cnum as a String.

Parameters:
cnum - column number, 1-based

getRowArray

public java.lang.String[] getRowArray()
returns row as an array of Strings


getInt

public int getInt(int col)
retruns the column at col as an integer.

Parameters:
col - column number starting from 1.

getString

public java.lang.String getString(int col)
return unquoted String. If null, then returns ""


getFloat

public float getFloat(int col)

getDouble

public double getDouble(int col)

getRowCount

public int getRowCount()
return the total rows in this result only if Result is set to be random access. For sequential access, use getCurrentRow after reaching the end of the Result. When next() has no more data. this method is only valid for Random Access Results.


getCurrentRow

public int getCurrentRow()
return the rows that have been accessed through next().


close

public void close()