agonism.dovetail.site
Class JDBCQueryResult

java.lang.Object
  |
  +--agonism.dovetail.site.JDBCQueryResult
All Implemented Interfaces:
IQueryResult

public class JDBCQueryResult
extends java.lang.Object
implements IQueryResult


Constructor Summary
JDBCQueryResult(java.sql.ResultSet rs, java.lang.String queryString)
          Iterate through the ResultSet, which was created by executing the SQL query queryString.
JDBCQueryResult(java.sql.ResultSet rs, java.lang.String queryString, int maxRecords)
           
 
Method Summary
 void free()
           
 int getNumRecordsScrolled()
           
 java.lang.String getQueryString()
          Get the SQL query string that was executed to create this JDBCQueryResult.
 java.lang.Object getValue(java.lang.String name)
           
 java.lang.Object getValue(java.lang.String name, boolean advanceToFirst)
           
 boolean hasMoreRecords()
          Once the next() method has returned false, this method may be used to determine if the query could be executed with a higher LIMIT (or TOP) clause.
 boolean next()
           
 void setNumRecordsScrolled(int scrolled)
          Tell the JDBCQueryResult how many records the ResultSet was scrolled forward by, so that it can pass that information on to other clients.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCQueryResult

public JDBCQueryResult(java.sql.ResultSet rs,
                       java.lang.String queryString)
Iterate through the ResultSet, which was created by executing the SQL query queryString.

JDBCQueryResult

public JDBCQueryResult(java.sql.ResultSet rs,
                       java.lang.String queryString,
                       int maxRecords)
Parameters:
maxRecords - maximum number of records to return before next() should return false. Once maxRecords records have been returned, hasMoreRecords() may still return true if there is more available data in the database for the query that was executed.
See Also:
hasMoreRecords()
Method Detail

setNumRecordsScrolled

public void setNumRecordsScrolled(int scrolled)
Tell the JDBCQueryResult how many records the ResultSet was scrolled forward by, so that it can pass that information on to other clients.

getNumRecordsScrolled

public int getNumRecordsScrolled()
Returns:
how many records in the ResultSet were scrolled through before the JDBCQueryResult was initialized.

getQueryString

public java.lang.String getQueryString()
Get the SQL query string that was executed to create this JDBCQueryResult.

next

public boolean next()
Specified by:
next in interface IQueryResult
Returns:
true if there is another value in the result set.
See Also:
getValue(java.lang.String)

hasMoreRecords

public boolean hasMoreRecords()
Once the next() method has returned false, this method may be used to determine if the query could be executed with a higher LIMIT (or TOP) clause. For example, if the SQL query only returned the TOP 10 rows, but there are 20 rows in the database, the JDBCQueryResult would only return 10 of those rows, but hasMoreRecords would return true.

getValue

public java.lang.Object getValue(java.lang.String name)
Specified by:
getValue in interface IQueryResult

getValue

public java.lang.Object getValue(java.lang.String name,
                                 boolean advanceToFirst)
Specified by:
getValue in interface IQueryResult
Following copied from interface: agonism.dovetail.site.IQueryResult
Parameters:
advanceToFirst - advance the IQueryResult to the first result if it is before the beginning of the result set.

free

public void free()
Specified by:
free in interface IQueryResult