|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.opmath.util.db.DBTest
A test application for any implementation of the com.opmath.util.db.DB
interface.
Copyright: (c) 2002 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
| Constructor Summary | |
DBTest(String dbName,
String fileName,
String tableName)
Constructs a new DBTest object. |
|
| Method Summary | |
protected void |
appendRow(String id,
String state)
Appends a row of test data to the current table. |
protected ResultSet |
getRows()
Returns a ResultSet object that contains all of the data
in the current table. |
static void |
main(String[] args)
The test application for classes implementing the DB implementation. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public DBTest(String dbName,
String fileName,
String tableName)
throws ClassNotFoundException
Constructs a new DBTest object.
This object is constructed and used only by the main(String[])
method of this class.
dbName - a String identifying the class
implementing the com.opmath.util.db.DB interface.fileName - a String identifying the name
of the database file used for the test (the path is hard coded).tableName - a String identifying the
database table used for the test.| Method Detail |
protected void appendRow(String id,
String state)
throws SQLException
Appends a row of test data to the current table.
id - a String carrying data for the ID
field of the table.id - a String carrying data for the STATE
field of the table.SQLException - if the database access fails.
protected ResultSet getRows()
throws SQLException
Returns a ResultSet object that contains all of the data
in the current table.
WARNING: getRows() creates a new ResultSet object,
but does not close it. The caller of getRows() must therefore
close the object returned by this method (with. eg. rs.close())
before getRows() can be called again. If this is not done,
then getRows() may throw an exception, depending on the database
driver class being tested.
ResultSet carrying data from a SELECT * FROM query.SQLException - if the database access fails.public static void main(String[] args)
The test application for classes implementing the DB implementation.
Refer to the source code of this application to see what's going on.
String[] - the String command line arguments
for the application: arg[0] is the name of the
implementing class; arg[1] is the name of the database
file or directory (the path is hard wired); arg[2]
is the name of the table.
|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||