com.agimatec.sql.query
Class StringResultBuilder

java.lang.Object
  extended by com.agimatec.sql.query.StringResultBuilder
All Implemented Interfaces:
JdbcResultBuilder

public class StringResultBuilder
extends java.lang.Object
implements JdbcResultBuilder

Description: QueryResultVisitor that can be used for queries that return an answer set with one String column, e.g. useful for SELECT Name ... statements with one or multiple result rows.

Author:
Roman Stumm

Field Summary
protected  java.util.List<java.lang.String> result
           
 
Constructor Summary
StringResultBuilder()
           
 
Method Summary
 void afterExecute(java.sql.ResultSetMetaData data, java.lang.Object queryObject, java.util.List resultList)
          The init() method is called once after the SQL statement has been executed and the result set is known.
 void close(boolean isComplete)
          The close() method is invoked, just BEFORE all associated resources (e.g. resultSet) are closed by the caller.
 void fetch(java.sql.ResultSet row)
          fetch the next row that contains one String column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

result

protected java.util.List<java.lang.String> result
Constructor Detail

StringResultBuilder

public StringResultBuilder()
Method Detail

afterExecute

public void afterExecute(java.sql.ResultSetMetaData data,
                         java.lang.Object queryObject,
                         java.util.List resultList)
Description copied from interface: JdbcResultBuilder
The init() method is called once after the SQL statement has been executed and the result set is known.

Specified by:
afterExecute in interface JdbcResultBuilder
Parameters:
data - JDBC result set meta data.
resultList - The List where the result objects are added to.

fetch

public void fetch(java.sql.ResultSet row)
           throws java.sql.SQLException
fetch the next row that contains one String column.

Specified by:
fetch in interface JdbcResultBuilder
Parameters:
row - the ResultSet where the cursor is located on the current row
Throws:
java.sql.SQLException

close

public void close(boolean isComplete)
Description copied from interface: JdbcResultBuilder
The close() method is invoked, just BEFORE all associated resources (e.g. resultSet) are closed by the caller. The close() method is the last callback to the visitor that allows to add pending results to the result list and to close own resources.

Specified by:
close in interface JdbcResultBuilder


Copyright © 2008-2012. All Rights Reserved.