|
EspressChart v 5.5 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This interface is used to read data in a tabular form. This is similar to the java.sql.ResultSet interface used to read from a JDBC data source. (However, it is much simpler). The interface can be implemented over data from any data source such as a database, a data file, or data in memory. The following are some sample implementations :
The information about the table structure, such as the number, names, and data types of the columns are provided by the IRSMetaData interface.
import quadbase.util.*;
...// other code
////// Print the given result set ///////
public void printResultSet(IResultSet rs) throws Exception {
IRSMetaData md = rs.getMetaData();
int nCol = md.getColumnCount();
int nRow = 0;
// Print the column names and data type constants :
for(int i=1; i<=nCol; i++) {
System.out.print("\t"
+ md.getColumnName(i) +"["+ md.getColumnType(i) +"]");
}
// Get records :
while(rs.next()) {
System.out.println(++nRow);
for(int i=1; i<=nCol; i++)
System.out.print("\t" + rs.getObject(i));
System.out.println("");
}
rs.close();
}
...
IRSMetaData,
StreamResultSet,
QueryResultSet,
DbData| Method Summary | |
void |
close()
Closes the cursor |
IRSMetaData |
getMetaData()
Gets the meta data object |
boolean |
next()
Advances cursor to next row |
| Methods inherited from interface quadbase.util.IRow |
getObject |
| Method Detail |
public boolean next()
throws java.lang.Exception
public void close()
throws java.lang.Exception
public IRSMetaData getMetaData()
throws java.lang.Exception
|
EspressChart v 5.5 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||