ocvolume.database
Class database

java.lang.Object
  |
  +--ocvolume.database.database

public class database
extends java.lang.Object

last updated on June 15, 2002
description: class used to manipulate database
calls: none
called by: volume
input: data to be stored in database
output: data read from database


Field Summary
static java.lang.String DOUBLE
          data type DOUBLE
 
Constructor Summary
database(java.lang.String dataSourceName)
          constructor to load database
calls: none
called by: volume, chgToDB
 
Method Summary
 void close()
          close connection to database
calls: none
called by: volume, chgToDB
 void createTable(java.lang.String tableName, java.lang.String[] columns, java.lang.String[] dataTypes)
          creates a table in database
calls: none
called by: chgToDB
 int getRowCount(java.lang.String tableName)
          get number of rows in a table
calls: none
called by: volume
 void insertRow(java.lang.String tableName, double[] values)
          inserts a row to the specified table
calls: none
called by: chgToDB
 java.sql.ResultSet retrieve(java.lang.String tableName)
          retrieve data from entire table
calls: none
called by: volume
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOUBLE

public static final java.lang.String DOUBLE
data type DOUBLE

See Also:
Constant Field Values
Constructor Detail

database

public database(java.lang.String dataSourceName)
constructor to load database
calls: none
called by: volume, chgToDB

Parameters:
dataSourceName - database source
Method Detail

getRowCount

public int getRowCount(java.lang.String tableName)
get number of rows in a table
calls: none
called by: volume

Parameters:
tableName - table to get row count from
Returns:
number of rows

retrieve

public java.sql.ResultSet retrieve(java.lang.String tableName)
retrieve data from entire table
calls: none
called by: volume

Parameters:
tableName - table to get data from
Returns:
result set

insertRow

public void insertRow(java.lang.String tableName,
                      double[] values)
inserts a row to the specified table
calls: none
called by: chgToDB

Parameters:
tableName - table to add the new row to
values - values for all the columns in the table

createTable

public void createTable(java.lang.String tableName,
                        java.lang.String[] columns,
                        java.lang.String[] dataTypes)
creates a table in database
calls: none
called by: chgToDB

Parameters:
tableName - name of table to be created
columns - column names
dataTypes - data types for the columns

close

public void close()
close connection to database
calls: none
called by: volume, chgToDB