org.objectweb.medor.datasource.rdb.lib
Class JDBCTupleCollection
java.lang.Object
org.objectweb.medor.datasource.rdb.lib.JDBCTupleCollection
- TupleCollection
public class JDBCTupleCollection
extends java.lang.Object
This class encapsulates a resultset as a TupleCollection.
- S.Chassande-Barrioz
JDBCTupleCollection
public JDBCTupleCollection(TupleStructure tupleStructure,
ResultSet rs,
PreparedStatement ps,
RdbAdapter adapter,
Logger logger)
throws MedorException,
ExpressionException,
SQLException
tupleStructure
- is the TupleStructure describing the struture
of the TupleCollection.rs
- is the encapsulated ResultSet. The resultset is already
positioned on the first element.ps
- is the PreparedStatement which must be closed in same time than
this tuple collection and the ResultSet.adapter
- is the RdbAdapter to uselogger
-
isLast
public boolean isLast()
throws MedorException
Checks whether the current row is the last row.
This method relies on the resultSet.next() method, and not on the
resultSet.isLast() method, since isLast is not supported by all JDBC
drivers. Method next() of this class first checks whether
resultSet.next() has already been called by isLast before calling it.
- isLast in interface TupleCollection
- true if it was the last row, false otherwise
MedorException
- if there is a SQL exception
next
public boolean next()
throws MedorException
Moves the cursor down one row from its current position to the next
row.
Note that nothing is done in the case resultSet.next() was already
called when calling isLast().
- next in interface TupleCollection
- true if there was a next row, false if there is no next row.
MedorException
- if there is a SQL Exception.