org.opennms.netmgt.utils
Class Querier

java.lang.Object
  extended by org.opennms.netmgt.utils.JDBCTemplate
      extended by org.opennms.netmgt.utils.Querier
All Implemented Interfaces:
RowProcessor
Direct Known Subclasses:
SingleResultQuerier

public class Querier
extends JDBCTemplate
implements RowProcessor

Querier class.

Version:
$Id: $
Author:
ranger

Constructor Summary
Querier(DataSource db, String sql)
          Constructor for Querier.
Querier(DataSource db, String sql, RowProcessor rowProcessor)
          Constructor for Querier.
 
Method Summary
protected  void executeStmt(PreparedStatement stmt)
          
 int getCount()
          getCount
 void processRow(ResultSet rs)
          processRow
 
Methods inherited from class org.opennms.netmgt.utils.JDBCTemplate
execute, reproduceStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Querier

public Querier(DataSource db,
               String sql,
               RowProcessor rowProcessor)

Constructor for Querier.

Parameters:
db - a DataSource object.
sql - a String object.
rowProcessor - a RowProcessor object.

Querier

public Querier(DataSource db,
               String sql)

Constructor for Querier.

Parameters:
db - a DataSource object.
sql - a String object.
Method Detail

getCount

public int getCount()

getCount

Returns:
a int.

executeStmt

protected void executeStmt(PreparedStatement stmt)
                    throws SQLException

Throws:
SQLException

processRow

public void processRow(ResultSet rs)
                throws SQLException

processRow

Specified by:
processRow in interface RowProcessor
Parameters:
rs - a ResultSet object.
Throws:
SQLException - if any.


Copyright © 2011. All Rights Reserved.