avignon.handlers.database
Class DCountQuery

java.lang.Object
  extended byavignon.handlers.database.DLookupQuery
      extended byavignon.handlers.database.DCountQuery

public class DCountQuery
extends DLookupQuery

Helpers class for getting the number of records matching some criteria in a table or view.


Field Summary
 
Fields inherited from class avignon.handlers.database.DLookupQuery
fieldName, tableName, whereCondition
 
Constructor Summary
DCountQuery(java.lang.String tableName)
          Construct a DCountQuery that will returns total number of rows in the table or view.
DCountQuery(java.lang.String tableName, java.lang.String whereCondition)
          Construct a DCountQuery that will returns number of rows matching the given criteria in the table or view.
 
Method Summary
 int getCount(java.sql.Connection database)
          Runs a count query against the given database and returns the result.
 
Methods inherited from class avignon.handlers.database.DLookupQuery
getObject, getWhereClause, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DCountQuery

public DCountQuery(java.lang.String tableName)
Construct a DCountQuery that will returns total number of rows in the table or view.

Parameters:
tableName - Name of a table or view that the query will operate on.

DCountQuery

public DCountQuery(java.lang.String tableName,
                   java.lang.String whereCondition)
Construct a DCountQuery that will returns number of rows matching the given criteria in the table or view.

Parameters:
tableName - Name of a table or view that the query will operate on.
whereCondition - SQL where expression.
Method Detail

getCount

public int getCount(java.sql.Connection database)
             throws java.sql.SQLException
Runs a count query against the given database and returns the result.

Parameters:
database -
Returns:
Throws:
java.sql.SQLException

SourceForge.net Logo