|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.workingdogs.village.DataSet
public abstract class DataSet
The DataSet represents a table in the database. It is extended by QueryDataSet and TableDataSet and should not be used directly. A DataSet contains a Schema and potentially a collection of Records.
Field Summary | |
---|---|
protected static int |
ALL_RECORDS
indicates that all records should be retrieved during a fetch |
protected java.sql.Connection |
conn
this DataSet's connection object |
protected java.util.Vector |
records
this DataSet's collection of Record objects |
protected java.sql.ResultSet |
resultSet
the result set for this DataSet |
protected Schema |
schema
this DataSet's schema object |
protected java.lang.StringBuffer |
selectString
the select string that was used to build this DataSet |
protected java.sql.Statement |
stmt
the Statement for this DataSet |
Constructor Summary | |
---|---|
DataSet()
Private, not used |
Method Summary | |
---|---|
Record |
addRecord()
Calls addRecord(DataSet) |
Record |
addRecord(DataSet ds)
Creates a new Record within this DataSet |
boolean |
allRecordsRetrieved()
Check if all the records have been retrieve |
DataSet |
clearRecords()
Remove all records from the DataSet and nulls those records out and close() the DataSet. |
void |
close()
Releases the records, closes the ResultSet and the Statement, and nulls the Schema and Connection references. |
java.sql.Connection |
connection()
Gets the current database connection |
boolean |
containsRecord(int pos)
Check to see if the DataSet contains a Record at 0 based position |
DataSet |
fetchRecords()
Causes the DataSet to hit the database and fetch all the records. |
DataSet |
fetchRecords(int max)
Causes the DataSet to hit the database and fetch max records. |
DataSet |
fetchRecords(int start,
int max)
Causes the DataSet to hit the database and fetch max records, starting at start. |
Record |
getRecord(int pos)
Get Record at 0 based index position |
abstract java.lang.String |
getSelectString()
Classes extending this class must implement this method. |
KeyDef |
keydef()
gets the KeyDef object for this DataSet |
int |
lastFetchSize()
The number of records that were fetched with the last fetchRecords. |
DataSet |
releaseRecords()
Removes the records from the DataSet, but does not null the records out |
Record |
removeRecord(Record rec)
Remove a record from the DataSet's internal storage |
DataSet |
reset()
Essentially the same as releaseRecords, but it won't work on a QueryDataSet that has been created with a ResultSet |
java.sql.ResultSet |
resultSet()
Gets the ResultSet for this DataSet |
Schema |
schema()
Gets the Schema for this DataSet |
int |
size()
Gets the number of Records in this DataSet. |
java.lang.String |
tableName()
Gets the tableName defined in the schema |
java.lang.String |
toString()
This returns a represention of this DataSet |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int ALL_RECORDS
protected Schema schema
protected java.util.Vector records
protected java.sql.Connection conn
protected java.lang.StringBuffer selectString
protected java.sql.ResultSet resultSet
protected java.sql.Statement stmt
Constructor Detail |
---|
public DataSet() throws DataSetException, java.sql.SQLException
DataSetException
java.sql.SQLException
Method Detail |
---|
public java.sql.ResultSet resultSet() throws java.sql.SQLException, DataSetException
java.sql.SQLException
DataSetException
public Record addRecord() throws DataSetException, java.sql.SQLException
DataSetException
java.sql.SQLException
public Record addRecord(DataSet ds) throws DataSetException, java.sql.SQLException
ds
-
DataSetException
java.sql.SQLException
public boolean allRecordsRetrieved()
public Record removeRecord(Record rec) throws DataSetException
rec
-
DataSetException
public DataSet clearRecords()
public DataSet releaseRecords()
public void close() throws java.sql.SQLException, DataSetException
java.sql.SQLException
DataSetException
public DataSet reset() throws DataSetException, java.sql.SQLException
DataSetException
java.sql.SQLException
public java.sql.Connection connection() throws java.sql.SQLException
java.sql.SQLException
public Schema schema()
public Record getRecord(int pos) throws DataSetException
pos
-
DataSetException
public boolean containsRecord(int pos)
pos
-
public DataSet fetchRecords() throws java.sql.SQLException, DataSetException
java.sql.SQLException
DataSetException
public DataSet fetchRecords(int max) throws java.sql.SQLException, DataSetException
max
-
java.sql.SQLException
DataSetException
public DataSet fetchRecords(int start, int max) throws java.sql.SQLException, DataSetException
start
- max
-
java.sql.SQLException
DataSetException
public int lastFetchSize()
public KeyDef keydef()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String tableName() throws DataSetException
DataSetException
- TODO: DOCUMENT ME!public abstract java.lang.String getSelectString() throws DataSetException
DataSetException
- TODO: DOCUMENT ME!public int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |