edu.udo.cs.yale.example
Class DatabaseDataRow

java.lang.Object
  extended by edu.udo.cs.yale.example.DatabaseDataRow
All Implemented Interfaces:
DataRow

public class DatabaseDataRow
extends java.lang.Object
implements DataRow

Reads datarows from a data base.

Version:
$Id: DatabaseDataRow.java,v 2.17 2006/09/29 10:59:41 ingomierswa Exp $
Author:
Ingo Mierswa, Simon Fischer

Field Summary
private  java.sql.ResultSet resultSet
          The result set which backs this data row.
private  int row
          The current row of the result set.
 
Constructor Summary
DatabaseDataRow(java.sql.ResultSet resultSet)
          Creates a data row from the given result set.
 
Method Summary
 void ensureNumberOfColumns(int numberOfColumns)
          Does nothing.
private  void ensureRowCorrect()
          Ensures that the current row is the current row of the result set.
 double get(Attribute attribute)
          Returns the desired data for the given attribute.
static double readColumn(java.sql.ResultSet resultSet, Attribute attribute)
          Reads the data for the given attribute from the result set.
 void set(Attribute attribute, double value)
          Sets the given data for the given attribute.
 void trim()
          Does nothing.
 
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
The result set which backs this data row.


row

private int row
The current row of the result set.

Constructor Detail

DatabaseDataRow

public DatabaseDataRow(java.sql.ResultSet resultSet)
                throws java.sql.SQLException
Creates a data row from the given result set. The current row of the result set if used as data source.

Throws:
java.sql.SQLException

Method Detail

ensureRowCorrect

private void ensureRowCorrect()
                       throws java.sql.SQLException
Ensures that the current row is the current row of the result set.

Throws:
java.sql.SQLException


get

public double get(Attribute attribute)
Returns the desired data for the given attribute.

Specified by:
get in interface DataRow


set

public void set(Attribute attribute,
                double value)
Sets the given data for the given attribute.

Specified by:
set in interface DataRow


ensureNumberOfColumns

public void ensureNumberOfColumns(int numberOfColumns)
Does nothing.

Specified by:
ensureNumberOfColumns in interface DataRow


trim

public void trim()
Does nothing.

Specified by:
trim in interface DataRow


readColumn

public static double readColumn(java.sql.ResultSet resultSet,
                                Attribute attribute)
                         throws java.sql.SQLException
Reads the data for the given attribute from the result set.

Throws:
java.sql.SQLException



Copyright © 2001-2006