maito.integration
Class RecordReader

java.lang.Object
  extended by maito.integration.RecordReader

public class RecordReader
extends java.lang.Object

RecordReader.java

Author:
Kalle Pyykkönen, OSaarekas This software is released under the GNU GPL license

Constructor Summary
RecordReader(java.sql.Connection con)
          Initializes Record reader.
 
Method Summary
 void close()
          Releases the objects for database handling
 void getRecords(DataSourceDescription source)
          Initialize this datasource to get records.
 Record nextRecord()
          Gets the next record from the resultset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordReader

public RecordReader(java.sql.Connection con)
Initializes Record reader.

Parameters:
con - Connection object to the database. The class will not work if the object is invalid database connection.
Method Detail

getRecords

public void getRecords(DataSourceDescription source)
Initialize this datasource to get records. If source parameter is changed after last query executes a new query. Otherwise just resets the cursor to the first row.

Parameters:
source - DataSourceDescription object.

nextRecord

public Record nextRecord()
Gets the next record from the resultset. If ResultSet is at end, returns null;

Returns:
Record record object created from rs rows. If ResultSet is null or is at end, returns null.

close

public void close()
Releases the objects for database handling