net.sf.log4jdbc
Interface ResultSetCollector

All Known Implementing Classes:
DefaultResultSetCollector

public interface ResultSetCollector

Collect a result set, ultimately available from getRow(). A ResultSetSpy instance may call a ResultSetCollector instance's methodReturned and preMethod as and when appropriate. The ResultSetCollector is then expected to build a simple representation of the rows and columns in getRow()/getColumnCount()/getColumnName().

Author:
Tim Azzopardi

Method Summary
 int getColumnCount()
           
 String getColumnName(int column)
           
 List<List<Object>> getRows()
           
 boolean methodReturned(ResultSetSpy resultSetSpy, String methodCall, Object returnValue, Object targetObject, Object... methodParams)
          Expected to be called by a ResultSetSpy for all jdbc methods.
 void preMethod(ResultSetSpy resultSetSpy, String methodCall, Object... methodParams)
          Expected to be called by a ResultSetSpy for prior to the execution of all jdbc methods.
 void reset()
          Clear the result set so far.
 

Method Detail

methodReturned

boolean methodReturned(ResultSetSpy resultSetSpy,
                       String methodCall,
                       Object returnValue,
                       Object targetObject,
                       Object... methodParams)
Expected to be called by a ResultSetSpy for all jdbc methods.

Returns:
true if the result set is complete (next() returns false)

preMethod

void preMethod(ResultSetSpy resultSetSpy,
               String methodCall,
               Object... methodParams)
Expected to be called by a ResultSetSpy for prior to the execution of all jdbc methods.


getRows

List<List<Object>> getRows()
Returns:
the result set objects

getColumnCount

int getColumnCount()
Returns:
the result set column count

getColumnName

String getColumnName(int column)
Returns:
the result set column name for a given column number via the result set meta data

reset

void reset()
Clear the result set so far.



Copyright © 2012. All Rights Reserved.