OpMath

com.opmath.util.db
Class DBTest

java.lang.Object
  |
  +--com.opmath.util.db.DBTest

public class DBTest
extends Object

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.

Since:
J2SE 1.3.0
Version:
utilities-v011
Author:
Bruno Beloff bruno.beloff@opmath.com

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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBTest

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.

Since:
J2SE 1.3
Method Detail

appendRow

protected void appendRow(String id,
                         String state)
                  throws SQLException

Appends a row of test data to the current table.

Throws:
SQLException - if the database access fails.
SQLException
Since:
J2SE 1.3

getRows

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.

Returns:
A ResultSet carrying data from a SELECT * FROM query.
Throws:
SQLException - if the database access fails.
SQLException
Since:
J2SE 1.3

main

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.

Since:
J2SE 1.3

OpMath

Submit a bug or feature to Open Math
Copyright © 2002 Open Math Company Limited, Brighton, UK