| java.lang.Object com.workingdogs.village.DataSet com.workingdogs.village.QueryDataSet
QueryDataSet | public class QueryDataSet extends DataSet (Code) | | This class is used for doing SQL select statements on the database. It should not be used for doing modifications via
update/delete/insert statements. If you would like to perform those functions, please use a TableDataSet.
Here is some example code for using a QueryDataSet.
QueryDataSet qds = new QueryDataSet ( connection, "SELECT * from my_table" );
qds.fetchRecords(10); // fetch the first 10 records
for ( int i = 0; i < qds.size(); i++ )
{
Record rec = qds.getRecord(i);
int value = rec.getValue("column").asInt();
System.out.println ( "The value is: " + value );
}
qds.close();
It is important to always remember to close() a QueryDataSet in order to free the allocated resources.
author: Jon S. Stevens version: $Revision: 564 $ |
getSelectString | public String getSelectString()(Code) | | get the Select String that was used to create this QueryDataSet
a select string |
Methods inherited from com.workingdogs.village.DataSet | public Record addRecord() throws DataSetException, SQLException(Code)(Java Doc) public Record addRecord(DataSet ds) throws DataSetException, SQLException(Code)(Java Doc) public boolean allRecordsRetrieved()(Code)(Java Doc) public DataSet clearRecords()(Code)(Java Doc) public void close() throws SQLException, DataSetException(Code)(Java Doc) public Connection connection() throws SQLException(Code)(Java Doc) public boolean containsRecord(int pos)(Code)(Java Doc) public DataSet fetchRecords() throws SQLException, DataSetException(Code)(Java Doc) public DataSet fetchRecords(int max) throws SQLException, DataSetException(Code)(Java Doc) public DataSet fetchRecords(int start, int max) throws SQLException, DataSetException(Code)(Java Doc) Record findRecord(int pos) throws DataSetException(Code)(Java Doc) String getColumns()(Code)(Java Doc) public Record getRecord(int pos) throws DataSetException(Code)(Java Doc) abstract public String getSelectString() throws DataSetException(Code)(Java Doc) public KeyDef keydef()(Code)(Java Doc) public int lastFetchSize()(Code)(Java Doc) public int[] maxColumnWidths(boolean with_heading) throws DataSetException, SQLException(Code)(Java Doc) public DataSet releaseRecords()(Code)(Java Doc) public Record removeRecord(Record rec) throws DataSetException(Code)(Java Doc) public DataSet reset() throws DataSetException, SQLException(Code)(Java Doc) public ResultSet resultSet() throws SQLException, DataSetException(Code)(Java Doc) public Schema schema()(Code)(Java Doc) void setAllRecordsRetrieved(boolean set)(Code)(Java Doc) public int size()(Code)(Java Doc) public String tableName() throws DataSetException(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
|
|