|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.medor.datasource.rdb.lib.JDBCTupleCollection
This class encapsulates a resultset as a TupleCollection.
Constructor Summary | |
---|---|
JDBCTupleCollection(TupleStructure tupleStructure,
java.sql.ResultSet rs,
java.sql.PreparedStatement ps,
RdbAdapter adapter,
Logger logger)
|
Method Summary | |
---|---|
void |
close()
It closes the TupleCollection, relaeases used resources (example : ResultSet). |
void |
first()
Moves the cursor to the first Tuple of this TupleCollection |
TupleStructure |
getMetaData()
Retrieves the number,types and stors properties of the data sources of this TupleCollection Object. |
int |
getRow()
Retrieves the current row Number of this TupleCollection |
Tuple |
getTuple()
Returns the Tuple value of the current row of this TupleCollection object. |
Tuple |
getTuple(int row)
Returns the Tuple value of the designeted row of this TupleCollection object. |
boolean |
isEmpty()
Tell whether the current TupleCollection Object is empty or no. |
boolean |
isLast()
Checks whether the current row is the last row. |
boolean |
next()
Moves the cursor down one row from its current position to the next row. |
boolean |
row(int i)
Moves the cursor to the given row number in this TupleCollection object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JDBCTupleCollection(TupleStructure tupleStructure, java.sql.ResultSet rs, java.sql.PreparedStatement ps, RdbAdapter adapter, Logger logger) throws MedorException, ExpressionException, java.sql.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
- Method Detail |
public TupleStructure getMetaData() throws MedorException
TupleCollection
getMetaData
in interface TupleCollection
MedorException
- if a data source access error occurspublic boolean isLast() throws MedorException
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
MedorException
- if there is a SQL exceptionpublic void close() throws MedorException
TupleCollection
close
in interface TupleCollection
MedorException
public boolean next() throws MedorException
Note that nothing is done in the case resultSet.next() was already called when calling isLast().
next
in interface TupleCollection
MedorException
- if there is a SQL Exception.public void first() throws MedorException
first
in interface TupleCollection
MedorException
- if data source access errorpublic int getRow() throws MedorException
getRow
in interface TupleCollection
MedorException
- if data source access error.public Tuple getTuple() throws MedorException
TupleCollection
getTuple
in interface TupleCollection
MedorException
- if data source access error.public Tuple getTuple(int row) throws MedorException
TupleCollection
getTuple
in interface TupleCollection
row
- :int
MedorException
- if data source access error.public boolean isEmpty() throws MedorException
TupleCollection
isEmpty
in interface TupleCollection
MedorException
- if data source access error.public boolean row(int i) throws MedorException
TupleCollection
row
in interface TupleCollection
MedorException
- if row number is invelid or data source access error
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |