de.fuberlin.wiwiss.d2rq.sql
Class QueryExecutionIterator
java.lang.Object
de.fuberlin.wiwiss.d2rq.sql.QueryExecutionIterator
- All Implemented Interfaces:
- ClosableIterator, Iterator
public class QueryExecutionIterator
- extends Object
- implements ClosableIterator
Executes an SQL query and delivers result rows as an iterator over arrays
of Strings. The query is executed lazily. This class logs all executed SQL queries.
- Version:
- $Id: QueryExecutionIterator.java,v 1.5 2006/09/13 14:06:23 cyganiak Exp $
- Author:
- Chris Bizer chris@bizer.de, Richard Cyganiak (richard@cyganiak.de)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
protocol
public static Collection protocol
QueryExecutionIterator
public QueryExecutionIterator(String sql,
List columns,
ConnectedDB db)
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator
next
public Object next()
- Delivers the next query result row.
- Specified by:
next
in interface Iterator
- Returns:
- An array of strings, each representing one cell of the row.
nextRow
public ResultRow nextRow()
- Returns:
- The next query ResultRow.
close
public void close()
- Make sure the SQL result set is closed and freed. Will auto-close when the
record-set is exhausted.
- Specified by:
close
in interface ClosableIterator
remove
public void remove()
- Specified by:
remove
in interface Iterator