|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.beans.AbleDBTable
This class describes and reads an SQL database table. It uses metadata from the result set to obtain the field name and type in order to create a Vector of AbleFields. It reads a block of records specified by bufferSize into a textData Vector where each element consists of an array of String objects.
Field Summary | |
---|---|
protected boolean |
allNumericData
A boolean indicating whether all fields in the data source are continuous. |
protected int |
bufferSize
An integer specifying the number of records to read from the database table and insert into the textData Vector. |
protected java.util.Vector |
fieldList
A Vector of AbleField elements in order of definition; ie, Vector index equals SQL column number. |
protected long |
numRecords
A long calculated to be the number of records in the database table. |
protected java.lang.String |
query
The Query to execute to obtain the resultSet. |
protected boolean |
ready
A boolean indicating whether the database table is ready for processing. |
protected java.sql.ResultSet |
resultSet
The result of the query. |
protected java.util.Vector |
textData
A Vector of String arrays containing records from the database table. |
Constructor Summary | |
---|---|
AbleDBTable(java.sql.Connection connection,
java.lang.String query)
Construct an AbleDBTable object for a given connection and query. |
Method Summary | |
---|---|
void |
close()
Close the Statement and ResultSet. |
static java.lang.String |
Copyright()
Determine the copyright of this class. |
protected AbleField |
createAbleField(AbleFieldDefinition definition)
Construct a corresponding AbleField from an AbleFieldDefinition. |
void |
displayVariables()
Display the fieldList and its values. |
int |
getBufferSize()
Return the number of records to place in the textData Vector each time a record block is read with readNextRecordBlock. |
java.util.Vector |
getFieldList()
Return a Vector of AbleField objects where each object describes a data column. |
int |
getNumFieldsPerRec()
Return the number of fields in each record. |
long |
getNumRecords()
Return the number of records in this database table. |
java.sql.ResultSet |
getResultSet()
Return the ResultSet object, which may be null. |
java.sql.Statement |
getStatement()
Return the Statement object, which may be null. |
java.util.Vector |
getTextData()
Returns a Vector of String[] objects representing all loaded text data. |
boolean |
isAllNumericData()
Returns true if all fields are "continuous", false if any are "discrete" or "categorical" (i.e. |
boolean |
isReady()
Return whether or not the database table is ready for processing. |
void |
loadDataFile()
Load the entire data file from a database table into the textData Vector. |
void |
loadMetaDataDefinition()
Read the meta data from the resultSet, and then construct corresponding AbleField objects. |
void |
open()
Execute the query, obtaining a ResultSet. |
void |
readNextRecordBlock()
Read the next n records from a database table into a vector of String arrays. |
void |
reopen()
Execute the query. |
void |
setBufferSize(int size)
Set the number of records to place in the textData Vector each time a record block is read with readNextRecordBlock. |
void |
setFieldList(java.util.Vector fieldList)
Set a Vector of AbleField objects where each object describes a data column. |
java.lang.String |
toString()
Return a formatted string describing the state of this DataSet. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String query
protected transient java.sql.ResultSet resultSet
protected java.util.Vector textData
protected java.util.Vector fieldList
protected int bufferSize
protected long numRecords
protected boolean ready
protected boolean allNumericData
Constructor Detail |
public AbleDBTable(java.sql.Connection connection, java.lang.String query) throws AbleException
connection
- A Connection object from which an SQL Statement will be
created.query
- A String containing the SQL statement text to be executed.Method Detail |
public boolean isReady()
isReady
in interface AbleImportData
public void displayVariables()
protected AbleField createAbleField(AbleFieldDefinition definition) throws AbleException
definition
- An AbleFieldDefinition.An
- exception if the AbleFieldDefinition provided is unsupported.public void loadMetaDataDefinition() throws AbleException
public int getNumFieldsPerRec()
getNumFieldsPerRec
in interface AbleImportData
public void open() throws AbleException
open
in interface AbleImportData
public void reopen() throws AbleException
public void close()
close
in interface AbleImportData
public void loadDataFile() throws AbleException
public void readNextRecordBlock() throws AbleException
readNextRecordBlock
in interface AbleImportData
public java.util.Vector getTextData()
getTextData
in interface AbleImportData
public boolean isAllNumericData()
isAllNumericData
in interface AbleImportData
public void setBufferSize(int size)
setBufferSize
in interface AbleImportData
public int getBufferSize()
getBufferSize
in interface AbleImportData
public java.util.Vector getFieldList()
getFieldList
in interface AbleImportData
public java.sql.ResultSet getResultSet() throws AbleException
public java.sql.Statement getStatement() throws AbleException
public void setFieldList(java.util.Vector fieldList)
setFieldList
in interface AbleImportData
public long getNumRecords()
getNumRecords
in interface AbleImportData
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String Copyright()
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |