eShopper
Class eShopperDB

java.lang.Object
  extended byeShopper.eShopperDB

public class eShopperDB
extends java.lang.Object

This class provides database access to eShopper. When eShopper is started, an instance of an eShopperDB should be created, and all database interaction should go through that instance. This uses hsqldb (http://hsqldb.sourceforge.net/) for the database, and the hsqldb.jar must be in the classpath or in the eShopper jar. The eShopper database files must be in the db subdirectory of eShopper.

Author:
Adam Goforth

Constructor Summary
eShopperDB()
           
 
Method Summary
 java.sql.ResultSet query(java.lang.String expression)
          This method is used for executing the SQL commands CREATE and SELECT.
 void shutdown()
          If there are no other open connections, the database is written out to files and shuts down.
 boolean update(java.lang.String expression)
          This method is used for executing the SQL commands DROP, INSERT and UPDATE.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

eShopperDB

public eShopperDB()
Method Detail

shutdown

public void shutdown()
              throws java.sql.SQLException
If there are no other open connections, the database is written out to files and shuts down. This happens anyway at garbage collection when eShopper ends.

Throws:
java.sql.SQLException

update

public boolean update(java.lang.String expression)
               throws java.sql.SQLException
This method is used for executing the SQL commands DROP, INSERT and UPDATE.

Parameters:
expression - The SQL command to be executed.
Returns:
true if the query ran correctly, false if not.
Throws:
java.sql.SQLException - If there is a database error.

query

public java.sql.ResultSet query(java.lang.String expression)
                         throws java.sql.SQLException
This method is used for executing the SQL commands CREATE and SELECT.

Throws:
java.sql.SQLException