org.d2rq.db
Class SQLIterator

java.lang.Object
  extended by org.d2rq.db.SQLIterator
All Implemented Interfaces:
com.hp.hpl.jena.util.iterator.ClosableIterator<ResultRow>, Iterator<ResultRow>

public class SQLIterator
extends Object
implements com.hp.hpl.jena.util.iterator.ClosableIterator<ResultRow>

Executes an SQL query and delivers result rows as an iterator over ResultRows. The query is executed lazily. This class logs all executed SQL queries.

Author:
Chris Bizer chris@bizer.de, Richard Cyganiak (richard@cyganiak.de)

Constructor Summary
SQLIterator(String sql, List<ProjectionSpec> columns, SQLConnection db)
           
 
Method Summary
 void cancel()
           
 void close()
          Make sure the SQL result set is closed and freed.
 boolean hasNext()
           
 ResultRow next()
           
 ResultRow nextRow()
          Deprecated. Use next() instead
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLIterator

public SQLIterator(String sql,
                   List<ProjectionSpec> columns,
                   SQLConnection db)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<ResultRow>

next

public ResultRow next()
Specified by:
next in interface Iterator<ResultRow>
Returns:
The next query ResultRow.

nextRow

public ResultRow nextRow()
Deprecated. Use next() instead


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 com.hp.hpl.jena.util.iterator.ClosableIterator<ResultRow>

cancel

public void cancel()

remove

public void remove()
Specified by:
remove in interface Iterator<ResultRow>