edu.udo.cs.yale.example
Class DatabaseDataRowReader

java.lang.Object
  extended by edu.udo.cs.yale.example.DatabaseDataRowReader
All Implemented Interfaces:
DataRowReader, java.util.Iterator<DataRow>

public class DatabaseDataRowReader
extends java.lang.Object
implements DataRowReader

Unlike a FileDataRowReader that reads examples from a file, objects of this class read examples from a ResultSet, a data structure that is returned from a database query.

Version:
$Id: DatabaseDataRowReader.java,v 2.15 2006/03/21 15:35:39 ingomierswa Exp $
Author:
Simon Fischer, Ingo Mierswa
See Also:
DatabaseHandler, DatabaseExampleSource, KDBExampleSource

Field Summary
private static int DONT_KNOW_YET
           
private  int hasNext
           
private static int NO
           
private  java.sql.ResultSet resultSet
           
private static int YES
           
 
Constructor Summary
DatabaseDataRowReader(java.sql.ResultSet resultSet)
          Creates a datarow reader from a ResultSet.
 
Method Summary
 boolean hasNext()
           
 DataRow next()
           
 void remove()
          Will throw a new UnsupportedOperationException since DataRowReader does not have to implement remove.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resultSet

private java.sql.ResultSet resultSet

DONT_KNOW_YET

private static final int DONT_KNOW_YET
See Also:
Constant Field Values

YES

private static final int YES
See Also:
Constant Field Values

NO

private static final int NO
See Also:
Constant Field Values

hasNext

private int hasNext
Constructor Detail

DatabaseDataRowReader

public DatabaseDataRowReader(java.sql.ResultSet resultSet)
Creates a datarow reader from a ResultSet. The column meta data must be tranformed to an Attribute array.

Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<DataRow>

next

public DataRow next()
Specified by:
next in interface java.util.Iterator<DataRow>

remove

public void remove()
Will throw a new UnsupportedOperationException since DataRowReader does not have to implement remove.

Specified by:
remove in interface java.util.Iterator<DataRow>



Copyright © 2001-2006