Budgeting.Com

This website allows users to compare their expenditure against budget amount in each category of the current month.

It allows user to do the following:

Architecture Of the Project

This project uses Struts 2.0 to build the interface. Action classes talk to DAO (Data Access Objects), which talk to database using JDBC.

So overall architecture is - Struts 2.0 UI Components -> Action Classes -> DAO -> JDBC -> Oracle Database.

It also uses a filter (Intercepting Filter design pattern) to ensure only authenticated users access secured pages.

It uses JavaMail to send mail to user with password in forgot password page.

Products and frameworks used in this project

Steps to download and deploy this project

  1. Download budgeting.rar. The .rar file contains the entire source code for the project. Unzip the file into c:\ so that c:\budgeting folder is created with all the components of the project.
  2. However, in order to keep the download small, the project does not contain .jar files related to Struts 2.0, Oracle and Java Mail. So you need to add them by taking the following steps.
  3. Open the project in NetBeans 7.0
  4. Go to properties of the project using popup menu. Select libraries node and delete existing libraries using  Remove button. Then add - Oracle - ojdbc14.jar and mail.jar (assuming you have downloaded JavaMail API) for Java Mail. You have to add these .jar files to the project using Add Jar/Folder button.
  5. Add the .jar files related to Struts 2.0 listed below from lib folder of  Struts 2.2.3 download.
  6. Create budgeting account with password budgeting in Oracle10g Express Edition. This must be done after you log in as SYSTEM user. Then create tables and sequences listed below after connecting to Oracle as budgeting. These commands are also present in tables.sql file in your project source code.
    create user budgeting identified by budgeting;
    grant connect, resource to budgeting;
    
    connect budgeting/budgeting;
    
    create table users 
    ( userid  number(5) primary key,
      username varchar2(10) not null unique,
      password varchar2(10) not null,
      email    varchar2(50) not null unique
    );
    
    create sequence  userid_sequence nocache;
    
    insert into users values( userid_sequence.nextval, 'abc','abc','abc@classroom.com');
    
    create table categories
    ( catcode  number(2) primary key,
      catname  varchar2(20) not null
    );
    
    insert into categories values(1,'Health');
    insert into categories values(2,'Education');
    insert into categories values(3,'Sports');
    insert into categories values(4,'Food');
    insert into categories values(5,'Entertainment');
    insert into categories values(6,'Transport');
    
    
    create table budgets
    ( budgetid  number(5)  primary key,
      userid    number(5)  references users (userid),
      month     number(2)  check ( month between 1 and 12),
      year      number(4),
      catcode   number(2)  references categories (catcode),
      amount    number(5),
      unique(userid,month,year,catcode)
    );
    
    create sequence budgetid_sequence nocache;
    
    insert into budgets values ( budgetid_sequence.nextval, 1,12,2011,2,5000);
    insert into budgets values ( budgetid_sequence.nextval, 1,12,2011,6,1000);
    insert into budgets values ( budgetid_sequence.nextval, 1,12,2011,3,500);
    
    create table expenditures 
    ( expid       number(5) primary key,
      userid      number(5)  references users (userid),
      exp_date    date,
      exp_details varchar2(100),
      exp_amount  number(5),
      catcode     number(2)  references categories (catcode)
    );
    
    create sequence expid_sequence nocache;
    
    insert into expenditures values ( expid_sequence.nextval,
       1,'1-dec-2011','Course Fee For Java',2000,2);
    
    insert into expenditures values ( expid_sequence.nextval,
       1,'3-dec-2011','Auto Charge',50,6);
    
  7. Run login.jsp. You can login as user abc. Also use registration link and register as a new user. Test the rest of the pages in the website.