About iCash


The iCash application simulates the last step in an online shopping application, which involves the following actions:

  • Accept a credit card number and purchase amount from a web page
  • Validate three arguments--credit card number, expiration date, and available credit limit--to a back-end (financial) database
  • Write back a response page that indicates whether the transaction was successful or not

Database

The database schema used by iCash has a very simple table, CreditCard, which contains the following:

CCNUM EXPDATE LIMIT
0123456789(expired) 30-NOV-98 $8500.00
1234567890(insufficient fund) 01-DEC-99 $11.74
2345678901(success) 31-OCT-99 $9800.76

Two Development Approaches

The iCash application is created using two different approaches. The first implementation accesses a database directly from a servlet (via embedded JDBC).  The following diagram illustrates how the application works.  For details about the other implementation of iCash, which accesses databases from EJBs, refer to EJB Solution.


Click to start the animated tutorial!

The tutorial includes a squence of movies. The movies require the Shockwave Director plugin, which could be downloaded from the Macromedia web site at http://www.macromedia.com/shockwave/download/