The Inventory Browser (IB) allows customers to view an inventory database, add items to a shopping cart, then checkout. IB also allows the merchant to view the inventory and order new supplies:
The Inventory Database consists of three tables:
You can create this table by starting the sql browser and pasting the following sql commands into the console's command prompt:
create table suppliers (sup int constraint pk_sup primary key,
company char(30) unique, address varchar(60))
create table inventory (item int constraint pk_item primary key, quantity
numeric(3, 1), units char(30))
create table products ( upc int constraint pk_upc primary key, name char(30) unique, description varchar(60), price numeric (8, 2), supplier int constraint fk_sup references suppliers, stock int constraint fk_stk references inventory)
insert into suppliers values (1, 'Acme', 'Sacramento')
insert into suppliers values (2, 'IBM', 'San Jose')
insert into suppliers values (3, 'Lame-O', 'LA')
insert into inventory values (1, 19, 'cans')
insert into inventory values (2, 8, 'qts')
insert into inventory values (3, 9, 'lbs')
insert into products values (1, 'Draino', 'drain cleaner', 2.45, 2, 1)
insert into products values (2, 'PU GO', 'kitty litter', 8.24, 1, 3)
insert into products values (3, 'J Walker', 'Burbon', 20.95, 3, 2)
Note: I have created these tables in the department's Oracle database. Please see Professor Sataye's notes on accessing this server:
http://www.mathcs.sjsu.edu/faculty/sathaye/Oracle_handbook.htm
See Dr. Hostmann's notes on connecting to Oracle from java (you can ignore pool.jar stuff):
http://www.cs.sjsu.edu/faculty/horstman/tomcat.html
IB uses the Model-View-Controller design patterns. There are two views of the inventory, the customer view, which displays a virtual table that shows information relevant to the customer, and the merchant view, which displays information relevant for the merchant.
The customer view allows the customer to add items to a shopping cart and to checkout.
The merchant view allows the merchant to add items to the inventory from selected suppliers.
Views and view helpers exchange value objects. A DAO encapsulates database access.
If you use Cloudscape, you must follow these steps:
1. Start the Cloudscape Server
1.1. set the class path in a DOS Console window using the script provided by
Cloudscape
1.2. start the server using the script provided by Cloudscape
2. Copy cloudscape.jar and rmijdbc.jar to the WEB-INF\lib directory of your test area.