0% found this document useful (0 votes)
80 views128 pages

File Report

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views128 pages

File Report

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 128

PROJECT REPORT ON

ONLINE SHOPPING CART

1|Page
ACKNOWLEDGEMENT
Thank you lord for everything. With every passing day we feel more and more of your presence,
your protection and your love.
We never have words to say to you what we want to say. But thank you very much.

It is a great pleasure for us to acknowledge the assistance and contributions of large number of
individuals to this effort. First of all, we would like to pay our grateful and sincere thanks to our
honorable teacher. who in the real sense inspired, motivated and guided us to accomplish this task.

Our special thanks to Dr. Anamika Bhargava for giving us to encouragement and valuable
suggestions.

We appreciate the help rendered by all the member of non-teaching staff of the department.

Throughout our study period they all have remained a source of inspiration for us.

Last, but not least we would gratefully acknowledge the support, encouragement and patience of
our family member.

Developed By: -

2|Page
INDEX
S.no Particulars Page no. Signature Remarks
Abstract 6
1 Introduction 7-9
1.1 Purpose
1.2 Scope
1.3 Project Overview
1.4 Project Description
2 System Analysis 10-13
2.1 Existing system
2.2 Proposed
system 2.3User
classes and
characteristic
2.4 Operating Environment
2.5 Design and Implementation
Constraints
2.6 User Documentation
2.7 Module Description
2.8 Hardware and Software
Requirements
3 Feasibility study 14-15
3.1 Technical Feasibility
3.2 Operational Feasibility
3.3 Economics Feasibility
4 System Design 16-29
4.1 Data Flow Diagram (DFD)
4.2 UML Diagram
4.3 Database Design
4.4 ER- Diagram
5 Input Output design 30-31
6 Implementation 32 to 61
6.1 HTML
6.2 Java Script
6.3 My Sql
6.4 Java Server Page (JSP)
6.5 JAKARTA TOMCAT
7 Testing 62 to 66
7.1 Testing Objective
7.2 Test Case Design
8 Output Screen 67 to 81

Source Code 82 to 100

3|Page
9 Conclusion 101

Appendix 102

Bibliography 103

4|Page
5|Page
Abstract

Shopping has evolved with the growth of technology. In recent years online shopping has
become popular and one who has a computer with Internet and a bank account can shop
from their home. Shopping online offers lots of benefits that one cannot find shopping in a
store or by mail. The Internet is always open — seven days a week, 24 hours a day. With a
click of a mouse, one can buy an airline ticket, book a hotel, send flowers to a friend, or
purchase your favorite fashions.

A shopping cart is a software application that typically runs the Web server, and allows
customers to do things such as searching for a product in a store catalog, adding a selected
product to a basket, and placing an order for it. Once a particular product has been found on
the web site of the seller, most online retailers use shopping cart software to allow the
consumer to accumulate multiple items and to adjust quantities, just like filling a physical
shopping cart or basket in a conventional store.

Features:
 User-friendly interface
 Effective Product Search
 Billing Report

Functionalities:
Store Front Module
Administration
Module Product
Search Module Billing
Module

6|Page
7|Page
INTRODUCTION

8|Page
INTRODUCTION

1.1 Purpose

The Shopping Cart application allows visitors to shop on-line to collect items in a virtual
shopping cart. They may view the contents of their shopping cart at any time. The program
automatically calculates the grand total. When a visitor decides to check-out, the order
information including the buyer's name, address and billing instruction is recorded.

1.2 Scope

The scope of the project is very vast, as it targets large no of people residing over the
world. Anyone having the access to the internet can shop for their desired items. It gained
maximum users over the world.

1.3 PROJECT OVERVIEW

Shopping has evolved with the growth of technology. In recent years online shopping has
become popular and one who has a computer with Internet and a bank account can shop
from their home. Shopping online offers lots of benefits that one cannot find shopping in a
store or by mail. The Internet is always open — seven days a week, 24 hours a day. With a
click of a mouse, one can buy an airline ticket, book a hotel, send flowers to a friend, or
purchase your favorite fashions.

A shopping cart is a software application that typically runs the Web server, and allows
customers to do things such as searching for a product in a store catalog, adding a selected
product to a basket, and placing an order for it. Once a particular product has been found on

9|Page
the web site of the seller, most online retailers use shopping cart software to allow the
consumer to accumulate multiple items and to adjust quantities, just like filling a physical
shopping cart or basket in a conventional store.

The Shopping Cart application allows visitors to shop on-line to collect items in a virtual
shopping cart. They may view the contents of their shopping cart at any time. The program
automatically calculates the grand total. When a visitor decides to check-out, the order
information including the buyer's name, address and billing instruction is recorded.

1.4 PROJECT DESCRIPTION

Our Shopping Cart application allows visitors to shop on-line to collect items in a virtual
shopping cart over multiple product web pages without losing the items ordered. Our cart
keeps track of what the shopper has ordered with a UID (User I.D). There are no cookies used,
so our software will work through a firewall and with older browsers.

In order for a shopping cart is to be useful, customers need to be able to add items to
their shopping carts as they browse web site. Shopping cart need to have a link next to each
product you sell that allows customers to add that particular product to their shopping carts.

If any of the above-specified functions fail the corresponding error message will be
displayed which makes the project friendlier to the user. The application software is
developed with MySql database and GUI based front- end tool J2EE. The information about
the users is stored in the database in the related tables. All designing of pages are done with
JSP’s and Java. Using Java Technologies makes our project more robust and importantly
portability over different systems. Java Server Pages have both HTML and Java Code
Technologies included and can use both of it.

10 | P a g e
System Analysis

PROBLEM DEFINITION

2.1 Existing System

The first step of preliminary study in the system analysis process involves the identification
of needs for computerization. The motivation behind this project is to overcome all the
defects in the existing system.

Some defects in existing system are:

• Customers need to go shop for purchasing items


• Customers can view a limited range of products
• Cannot compare prices with the other stores
• Limited customer reach. Customers from a certain area go for shopping

2.2 Proposed System

Cart application allows visitors to shop on-line to collect items. Shoppers may view the
contents of their shopping cart at any time. The program automatically calculates the subtotal
and grand total. When a visitor decides to checkout, the order information including the
buyer's name, address and billing instruction is recorded in the system for future references.

11 | P a g e
Features of proposed system:

• Customers can shop from their home


• Customers can view a large number of products available in a store
• Customer reach for a shop is wider and customers around the globe can visit the
store and purchase products

2.3 User Classes and Characteristics


This project targets two kinds of users, Normal visitors and managers. Manager is the
administration of the store who frequently adds new products to the stock. These products
are grouped into various categories which make searching easy for customer. Normal users
are who visits shop online and buy products online. Before buy any product they should get
registered in to the site.

2.4 Operating Environment:

Software Requirements are Windows as Operating System. HTML, Cascading Style


Sheets and JavaScript as Front-End designing tools. MySql is used as Database Server.
Tomcat
6.0 server is the Web server. Java, JSP and Servlets are used as server side languages.

Hardware Requirements are P2 above processor, 128MB+ of main memory (RAM)


and 100MB hard disk and data base memory.

2.5 Design and Implementation Constraints


This project will be developed using the technologies like Java, JSP, Servlets, HTML,
CSS, JavaScript, SQL and Web for all which I need to fetch knowledge on all of them in order
to code for the project. Also I’ll be learning clearly about Software Development Life Cycle.

12 | P a g e
13 | P a g e
2.6 User Documentation
This document also includes a user manual which assists the new user to go about the
project, he can even get the online help which caters the needs of a new user and makes this
project more user friendly, a step by step approach online makes it easy to use software for a
naïve user.

2.7 Module Description


Modules in the Shopping Cart

system Store Front Module

Administration Module

Product Search Module

Billing Module

Store Front and Administration Module:

In this module the store administrator will add new products to the site. Here the products
will be grouped into various categories. Administrator will enter all the information about
product including its brand, price, discount, manufacture date and its category. The admin
can update already added products.

Product Search Module:

In this module products are grouped into various categories. Products from a particular
category will be displayed when the user clicks a particular category. Here this categorization

14 | P a g e
is made at the time of product entry by admin. He will insert a product into its category.
The result of this search is the list of products from a selected category.

Billing Module:

This is the cart module where it contains all the products which the user has shopped. As
the customer browse through the products he can add products to the cart. The cart
contains product information and its billing information along with discount. And these
details will be present to the user for check out. The cart contents will be saved into the
database once the user checks out.

2.8 HARDWARE AND SOFTWARE

REQUIREMENTS Hard Ware Requirements

 Processor:: Pentium-III (or) Higher


 Ram:: 64MB (or) Higher
 Cache:: 512MB
 Hard disk:: 10GB

Soft Ware Requirements

 Tools:: Micro Soft Front


 Operating System:: WindowsNT/2000
 Server Side:: JSP with Tomcat Server
 Client Side:: HTML ,JavaScript
 Services:: JDBC
 Database:: My SQL
 Integrated Development Environment: NetBeans 6.5

15 | P a g e
FEASIBILITY STUDY

3. FEASIBILITY STUDY:

The next step in analysis is to verify the feasibility of the proposed system. “All
projects are feasible given unlimited resources and infinite time“. But in reality both
resources and time are scarce. Project should confirm to time bounce and should be optimal
in there consumption of resources. This place a constant is approval of any project.

Feasibility has applied to Shopping Cart pertains to the following areas:

 Technical feasibility
 Operational feasibility
 Economical feasibility

3.1 TECHNICAL FEASIBILITY:

To determine whether the proposed system is technically feasible, we should take


into consideration the technical issues involved behind the system.

Shopping Cart uses the web technologies, which is rampantly employed these
days worldwide. The world without the web is incomprehensible today. That goes to
proposed system is technically feasible.

16 | P a g e
3.2 OPERATIONAL FEASIBILITY:

To determine the operational feasibility of the system we should take into


consideration the awareness level of the users. This system is operational feasible since the
users are familiar with the technologies and hence there is no need to gear up the
personnel to use system. Also the system is very friendly and to use.

3.3. ECONOMIC FEASIBILITY

To decide whether a project is economically feasible, we have to consider various factors as:

 Cost benefit analysis


 Long-term returns
 Maintenance costs

The proposed Shopping Cart is computer based. It requires average


computing capabilities and access to internet, which are very basic requirements hence it
doesn’t incur additional economic overheads, which renders the system economically
feasible.

17 | P a g e
18 | P a g e
SYSTEM DESIGN

SYSTEM DESIGN

System design is transition from a user oriented document to programmers or data


base personnel. The design is a solution, how to approach to the creation of a new system.
This is composed of several steps. It provides the understanding and procedural details
necessary for implementing the system recommended in the feasibility study. Designing goes
through logical and physical stages of development, logical design reviews the present
physical system, prepare input and output specification, details of implementation plan and
prepare a logical design walkthrough.

The database tables are designed by analyzing functions involved in the


system and format of the fields is also designed. The fields in the database tables should
define their role in the system. The unnecessary fields should be avoided because it affects
the storage areas of the system. Then in the input and output screen design, the design should
be made user friendly. The menu should be precise and compact.

SOFTWARE DESIGN

In designing the software following principles are followed:

1. Modularity and partitioning: software is designed such that, each system should

consists of hierarchy of modules and serve to partition into separate function.

2. Coupling: modules should have little dependence on other modules of a system.

3. Cohesion: modules should carry out in a single processing function.

4. Shared use: avoid duplication by allowing a single module is called by other that need

the function it provides

19 | P a g e
4.1 DATA FLOW DIAGRAMS

Level 0 DFD for

customer Level 0 DFD

for Manager

Shopping Cart

Manager

Level
1 DFD for Manager:

Edit
product
Product db

View
sales report
Sales db

Level 1 DFD for Customer:

20 | P a g e
21 | P a g e
Customer:

View products

Product DB
CUSTOME
r

Add product to cart

Cart db

View
Cart db
cart

Check
out

Sales db

22 | P a g e
4.2 UML Diagrams

Use Case:

reguster

login

add products

view products

customer
manager

edit products
add product to cart

view cart view sales

checkout

23 | P a g e
Login Sequence:

:Browser :WebServer
:Database

User

login()

sendDetails() forward details

forwardPage() response()

viewpage()

24 | P a g e
Manager Adding new Product:

:Browser :WebServer
:Database

Manager

addProduct()

sendProductDetails() forward details

forwardPage() response()

viewpage()

25 | P a g e
View Products:

:Browser :WebServer
:Database

Customer

viewProducts()

sendRequest() fetchData()

forwardDetails() response()

viewProducts()

26 | P a g e
Cart:

:Browser :WebServer :Database

Customer

addtoCart()

insertintocart() insertData()

forwardDetails() response()

viewpage()

checkout()
sendCartDetails()
insertCartDetails()

viewPage() sendResponsePage() response()

27 | P a g e
Activity Diagram:

Login

if admin
if customer

Manager

Customer

manage products
view products

addtocart view sales

checkout

logout

28 | P a g e
29 | P a g e
Class Diagram:

Cart Customer
cartid:int subtotal:float total:float cid:int cname:String address:String phno:String paymenttype:String
login() viewProducts() addtoCart() checkout() logout()

addItem() checkout()

Sales

pid:int uid:int
pname:String price:String total:float

Product
pid:int pname:String mrp: float discount:String mdate:date
add()
view()

Manager
uid:int username:String password:String

addProduct() editProduct() deleteProduct()


add() delete()

30 | P a g e
31 | P a g e
4.3 DATABASE DESIGN:

TABLE: USERS

Field Name Data type Constraints

Uid Int Primary key

Fname Varchar(30) Not null

Lname Varchar(20)

Uname Varchar(30) Not Null

Password Varchar(30) Not Null

Contact Varchar(20)

Address Varchar(500) Not Null

Email Varchar(100)

Payment_option Varchar(200) Not Null

Dob Date

Type Varchar(1) Not Null

Gender Varchar(6) Not Null

Phno Varchar(20)

32 | P a g e
TABLE: CATEGORIES

Field Name Data type Constraints

cid Int Primary key

Cname Varchar(20) Not Null

TABLE: PRODUCTS

Field Name Data type Constraints

Pid Int Primary Key

cid Int Reference Key

Pname Varchar(30) Not Null

Mrp Varchar(10)

Discount Varchar(4)

Imagename Varchar(100)

Brand Varchar(20)

Mfd Date

33 | P a g e
TABLE: CART

Field Name Data type Constraints

Pid Int Reference Key

Uid Int Reference Key

Pname Varchar(50) Not Null

Price Varchar(30) Not Null

Qty Int Not Null

Total Varchar(30) Not Null

TABLE: SALES_REPORT

Pid Int Reference Key

Uid Int Reference Key

Pname Varchar(50) Not Null

Price Varchar(30) Not Null

Qty Int Not Null

Total Varchar(30) Not Null

34 | P a g e
ER Diagram

uid lname Uname


cid cname
fname

Users password
email categories

address contact
phno Belongs to
Payment_option
pid pname
mrp

places
products discount
contains
pid uid
Image
mfd brand name

cart pname

total price

qty

Added to

pid
qty
Sales report
total

uid P name

29 | P a g e
5 INPUT/OUTPUT DESIGN

Input design: considering the requirements, procedures to collect the necessary input data
in most efficiently designed. The input design has been done keeping in view that, the
interaction of the user with the system being the most effective and simplified way.

Also the measures are taken for the following

 Controlling the amount of input


 Avoid unauthorized access to the Shopping Cart
 Eliminating extra steps
 Keeping the process simple
 At this stage the input forms and screens are designed.

Output design: All the screens of the system are designed with a view to provide the user
with easy operations in simpler and efficient way, minimum key strokes possible.
Instructions and important information is emphasized on the screen. Almost every screen is
provided with no error and important messages and option selection facilitates. Emphasis is
given for speedy processing and speedy transaction between the screens. Each screen

30 | P a g e
assigned to make it as much user friendly as possible by using interactive procedures. So to
say user can operate the system without much help from the operating manual.

31 | P a g e
IMPLEMENTATION

OVERVIEW OF SOFTWARE DEVELOPMENT TOOLS

6.1 HTML

Html is a language which is used to create web pages with html marking up a page to indicate
its format, telling the web browser where you want a new line to begin or how you want text
or images aligned and more are possible.

We used the following tags in our project.

TABLE:

Tables are so popular with web page authors is that they let you arrange the elements of a
web page in such a way that the browser won’t rearrange them web page authors frequently
use tables to structure web pages.

<TR>:

<TR> is used to create a row in a table encloses <TH> and


<TD> elements. <TR> contain many attributes. Some of them are,

 ALIGN: specifies the horizontal alignment of the text in the table row.
 BGCOLOR: Specifies the background color for the row.
 BORDERCOLOR: Sets the external border color for the row.
 VALIGN: Sets the vertical alignment of the data in this row.
<TH>:

<TH> is used to create table heading.

32 | P a g e
 ALIGN: Sets the horizontal alignment of the content in the table
cell. Sets LEFT, RIGHT, CENTER.
 BACKGROUND: Species the back ground image for the table cell.
 BGCOLOR: Specifies the background color of the table cell
 VALIGN: Sets the vertical alignment of the data. Sets to TOP,
MIDDLE, BOTTOM or BASELINE.
 WIDTH: Specifies the width of the cell. Set to a pixel width or a
percentage of the display area.
<TD>:

<TD> is used to create table data that appears in the cells of a table.

 ALIGN: Species the horizontal alignment of content in the table


cell. Sets to LEFT, CENTER, RIGHT.
 BGCOLOR: Specifies the background image for the table cell.
 BGCOLOR: sets the background color of the table cells.
 WIDTH: Species the width of the cell

FRAMES:

Frames are used for either run off the page or display only small slices
of what are supposed to be shown and to configure the frame we can use <FRAMESET>there
are two important points to consider when working with <FRAMESET>.

 <FRAMESET> element actually takes the place of the <BODY> element in a


document.
 Specifying actual pixel dimensions for frames.

<FRAME> Elements are used to create actual frames.

From the frameset point of view dividing the browser into tow vertical frames
means creating two columns using the <FRAMESET> elements COLS attribute.

The syntax for vertical fragmentation is,

<FRAMESET COLS =”50%, 50%”>

33 | P a g e
</FRAMESET>

Similarly if we replace COLS with ROWS then we get horizontal

fragmentation. The syntax for horizontal fragmentation is,

<FRAMESET ROWS=”50%, 50%”>

</FRAMESET>

FORM:

The purpose of FORM is to create an HTML form; used to enclose HTML controls, like
buttons and text fields.

ATTRIBUTES:

 ACTION: Gives the URL that will handle the form data.

 NAME: Gives the name to the form so you can reference it in code set to an
alphanumeric string.

 METHOD: method or protocol is used to sending data to the target action URL. The
GET method is the default, it is used to send all form name/value pair information in an URL.
Using the POST method, the content of the form are encoded as with the GET method, but are
sent in environment variables.

CONTROLS IN HTML

<INPUT TYPE =BUTTON>:

Creates an html button in a form.

34 | P a g e
ATTRIBUTES:

 NAME: gives the element a name. Set to alphanumeric characters.


 SIZE: sets the size.
 VALUE: sets the caption of the element.

<INPUT TYPE = PASSWORD>:

Creates a password text field, which makes typed

input. ATTRIBUTES:

 NAME: gives the element a name, set to alphanumeric characters.


 VALUE: sets the default content of the element.

<INPUT TYPE=RADIO>:

Creates a radio button in a

form. ATTRIBUTE:

 NAME: Gives the element a name. Set to alphanumeric character.


 VALUE: Sets the default content of the element.

<INPUT TYPE=SUBMIT>:

Creates a submit button that the user can click to send data in the form back to the web
server.

ATTRIBUTES:

NAME: Gives the element a name. Set to alphanumeric characters.

VALUE: Gives this button another label besides the default, Submit Query. Set to alphanumeric
characters.

<INPUT TYPE=TEXT>:

Creates a text field that the user can enter or edit text in.

35 | P a g e
ATTRIBUTES:

NAME: Gives the element a name. Set to alphanumeric characters.

VALUE: Holds the initial text in the text field. Set to alphanumeric characters.

6.2 JAVA SCRIPT

Java script originally supported by Netscape navigator is the most popular


web scripting language today. Java script lets you embedded programs right in your web
pages and run these programs using the web browser. You place these programs in a
<SCRIPT> element, usually with in the <HEAD> element. If you want the script to write
directly to the web page, place it in the <BODY> element.

JAVASCRIPT METHODS:

Writeln:

Document.writeln() is a method, which is used to write


some text to the current web page.

onClick:

Occurs when an element is clicked.

onLoad:

Occurs when the page loads.

onMouseDown:

36 | P a g e
Occurs when a mouse button goes down.

onMouseMove:

Occurs when the mouse moves.

onUnload:

Occurs when a page is unloaded.

37 | P a g e
6.3 MySQL

The database has become an integral part of almost every human's life. Without it,
many things we do would become very tedious, perhaps impossible tasks. Banks,
universities, and libraries are three examples of organizations that depend heavily on some
sort of database system. On the Internet, search engines, online shopping , and even the
website naming convention (http://www...) would be impossible without the use of a
database. A database that is implemented and interfaced on a computer is often termed a
database server.

One of the fastest SQL (Structured Query Language) database servers currently on the
market is the MySQL server.MySQL, available for download, offers the database programmer
with an array of options and capabilities rarely seen in other database servers. What's more,
MySQL is free of charge for those wishing to use it for private and commercial use. Those
wishing to develop applications specifically using MySQL should consult MySQL's licensing
section, as there is a charge for licensing the product.

These capabilities range across a number of topics, including the following:

 Ability to handle an unlimited number of simultaneous users.


 Capacity to handle 50,000,000+ records.
 Very fast command execution, perhaps the fastest to be found on the market.
 Easy and efficient user privilege system.

A database is really nothing more than a hierarchy of increasingly complex data structures. In
MySQL, the acknowledged structure for holding blocks (or records) of information is called
the table.

These records, in turn, are made up of the smallest object that can be manipulated by the
user, known as the data type. Together, one or more of these data types form a record. A
table holds the collection of records that make up part of the database. We can consider the
hierarchy of a database to be that of the following:

Database < Table < Record < Datatype

38 | P a g e
39 | P a g e
Datatypes come in several forms and sizes, allowing the programmer to create tables
suited for the scope of the project. The decisions made in choosing proper datatypes
greatly influence the performance of a database, so it is wise to have a detailed
understanding of these concepts.

MySQL Datatypes

MySQL is capable of many of the datatypes that even the novice programmer has probably
already been exposed to. Some of the more commonly used include:

CHAR (M)
CHAR's are used to represent fixed length strings. A CHAR string can range from 1-255
characters. In later table creation, an example CHAR datatype would be declared as follows:

ex.
car_model CHAR(10);

VARCHAR (M)
VARCHAR is a more flexible form of the CHAR data type. It also represents data of type String,
yet stores this data in variable length format. Again, VARCHAR can hold 1-255 characters.
VARCHAR is usually a wiser choice than CHAR, due to it's variable length format
characteristic. Although, keep in mind that CHAR is much faster than VARCHAR, sometimes
up to 50%.
(A CHAR stores the whole length of the declared variable, regardless of the size of the data
contained within, whereas a VARCHAR only stores the length of the data, thus reducing size
of the database file.)

ex.
car_model VARCHAR(10);

INT (M) [Unsigned]


The INT datatype stores integers ranging from -2147483648 to 2147483647. An optional
"unsigned" can be denoted with the declaration, modifying the range to be 0 to 4294967295

ex.
light_years INT;
Valid integer: '-24567'. Invalid integer: '3000000000'.

40 | P a g e
ex.
light_years INT unsigned;
Valid integer: '3000000000'. Invalid integer: '-24567'.

FLOAT [(M,D)]
A FLOAT represents small decimal numbers, used when a somewhat more precise
representation of a number is required.

ex.
rainfall FLOAT (4,2);
This could be used to represent rainfall average in centimeters per year, which could be a
decimal value. More specifically, FLOAT (4,2) states the fact that rainfall can hold up to
four characters and two decimal places. Thus,

42.35 is valid, accurately represented.


324.45 is invalid, rounded to 324.5.
2.2 is valid, accurately represented.
34.542 is invalid, rounded to 34.54.

Note: Due to the fact that FLOAT is rounded, those wishing to represent money values
would find it wise to use DECIMAL, a datatype found within MySQL that does not round
values.
Consult the documentation for a complete explanation.

DATE
Stores date related information. The default format is 'YYYY-MM-DD', and ranges from
'0000- 00-00' to '9999-12-31'. MySQL provides a powerful set of date formatting and
manipulation commands, too numerous to be covered within this article. However, one can
find these functions covered in detail within the MySQL documentation.

the_date DATE;

TEXT / BLOB
The text and blob datatypes are used when a string of 255 - 65535 characters is required to
be stored. This is useful when one would need to store an article such as the one you are
reading. However, there is no end space truncation as with VARCHAR AND CHAR. The only
difference between BLOB and TEXT is that TEXT is compared case insensitively, while BLOB

41 | P a g e
is compared case sensitively.

42 | P a g e
SET
A datatype of type string that allows one to choose from a designated set of values, be it one
value or several values. One can designate up to 64 values.

ex.
transport SET ("truck", "wagon") NOT NULL;

From the above declaration, the following values can be held by

transport: ""
"truck"
"wagon"
"truck,wagon
"

ENUM
A datatype of type string that has the same characteristics as the SET datatype, but only one
set of allowed values may be chosen. Usually only takes up one byte of space, thus saving
time and space within a table.

ex.
transport ENUM ("truck", "wagon") NOT NULL;

From the above declaration, the following values can be held by

transport: ""
"truck"
"wagon
"

Records

Together, a group of declared datatypes form what is known as a record. A record can be as
small as one data variable, or as many as deemed needed. One or more records form the
structure of a table.

The Bigger Picture: Tables

Before we can execute commands on the database, we must first create a table in which
data can be stored. This is accomplished in the following manner:
43 | P a g e
44 | P a g e
mysql> CREATE TABLE test (
> name VARCHAR (15),
> email VARCHAR (25),
> phone_number INT,
> ID INT NOT NULL AUTO_INCREMENT,
> PRIMARY KEY (ID));

Ensuing output:

Query OK, 0 rows affected (0.10


sec) mysql>

The first table in your database has now been created. Note: no two tables can have the same
name.
Note(2): Each dataspace is more often referred to as a

column. Column Characteristics:

 A name may not be made up of strictly numbers.


 A name may start with a number.
 A name may be up to 64 characters.

Other table options:

The following options can be placed after any datatype, adding other characteristics and
capabilities to them.

 Primary Key. Used to differentiate one record from another. No two records can
have the same primary key. This is obviously useful when it is imperative that no
two records are mistaken to be the other.
 Auto_Increment. A column with this function is automatically incremented one value
(previous + 1) when an insertion is made into the record. The datatype is
automatically incremented when 'NULL' is inserted into the column.
 NOT NULL. Signifies that the column can never be assigned a NULL value.

45 | P a g e
ex.
soc_sec_number INT PRIMARY KEY;
No two soc_sec_number records can hold the same value.

ID_NUMBER INT AUTO_INCREMENT;

Insertion of records

Note: The originally created table, test, created in the last section will be used to illustrate the
examples in this section. Here it is again, for quick reference:

mysql> CREATE TABLE test (

> name VARCHAR (15),

> email VARCHAR (25),

> phone_number INT,

> ID INT NOT NULL AUTO_INCREMENT,

> PRIMARY KEY (ID));

Insertion of data into the table is accomplished, logically enough, using the INSERT command.

mysql> INSERT INTO test VALUES

mysql> ('Bugs Bunny',

'[email protected]', mysql> 5554321,

NULL);

Result, assuming the command was correctly entered:

46 | P a g e
Query OK, 1 row affected (0.02 sec)

47 | P a g e
mysql>

Selection

A database would not be much use if one was not able to search and extract data from it. In
MySql terms, this is accomplished through the SELECT statement.

mysql> SELECT * FROM test

mysql> WHERE (name = "Bugs Bunny");

Result:

name Email phone ID

Bugs Bunny [email protected] 5554321 1

Let's assume we have inserted four differing records, all bearing the same name of "Bugs
Bunny", yet having different email addresses and phone numbers. The table test, would look
somewhat like the following:

name Email Phone ID

Bugs Bunny [email protected] 5554321 1

Bugs Bunny [email protected] 5554331 2

Bugs Bunny [email protected] 5554341 3

Bugs Bunny [email protected] 5554351 4

Deletion

One can also delete records inserted into the table. This is accomplished through the
DELETE command.

48 | P a g e
mysql> DELETE FROM test

mysql> WHERE (name = "Bugs Bunny");

Result:
This would result in the deletion of all records within the table test containing name "Bugs
Bunny".

Another example:

mysql> DELETE FROM test

mysql> WHERE (phone_number = 5554321);

Result: (Using the previously illustrated example)

name Email Phone ID

Bugs Bunny [email protected] 5554331 2

Bugs Bunny [email protected] 5554341 3

Bugs Bunny [email protected] 5554351 4

Modification

MySQL also has the capability of modifying data already entered into the table. This is
accomplished through the UPDATE command.

mysql> UPDATE test SET name = 'Daffy

Duck' mysql> WHERE name = "Bugs Bunny";

49 | P a g e
name Email Phone ID

Daffy Duck [email protected] 5554331 2

Daffy Duck [email protected] 5554341 3

Daffy Duck [email protected] 5554351 4

This section, we covered the core MySQL database manipulation functions, basic
insertion, deletion, modification, and search. The next section will elaborate on these
capabilities, providing extended functioning and flexibility when manipulating the
database.

What we have covered so far is but a small part of what MySQL is capable of. Let's delve a
little deeper into the language, exploring some of the more advanced commands of the
language.

Logical Operations

MySQL includes full support of all basic logical operations.

AND (&&)

mysql> SELECT * FROM test

WHERE mysql> (name = "Bugs

Bunny") AND mysql>

(phone_number = 5554321);

Result:
All records containing the name "Bugs Bunny" AND the phone number '5554321' will
be displayed to the screen.

OR ( || )

mysql> SELECT * FROM test


50 | P a g e
WHERE mysql> (name = "Bugs

Bunny") OR

51 | P a g e
mysql> (phone_number = 5554321);

Result:
All records containing the name "Bugs Bunny" OR the phone number '5554321' will
be displayed to the screen.

NOT ( ! )

mysql> SELECT * FROM test

WHERE mysql> (name != "Bugs

Bunny");

Result:
All records NOT containing the name "Bugs Bunny" will be displayed to the screen.

Order By

mysql> SELECT * FROM test WHERE

mysql> (name = "Bugs Bunny") ORDER

BY mysql> phone_number;

Result:
All records containing the name "Bugs Bunny" will be displayed to the screen, ordered
in respect to the phone_number.

Search functions

MySQL offers the user the ability to perform both general and specific searches on data.

52 | P a g e
mysql> SELECT * FROM test WHERE

53 | P a g e
mysql> (name LIKE "%gs Bunny");

Result:
All records containing the partial string "gs Bunny" will be displayed to the screen. This
would include such names as: "Bugs Bunny", "ags Bunny", "gs Bunny", and "234rtgs Bunny".

Notice that "LIKE" has been used instead of the equals sign (=). "LIKE" signifies that one is
searching for an estimate of the data requested, and not necessarily an exact copy.

The '%' sign could be placed anywhere within the string. The method in which the
server searches for a string is dependent upon where one places the '%' sign.

mysql> SELECT * FROM test WHERE

mysql> (name LIKE "Bugs Bunny%");

Result:
All records containing the partial string "Bugs Bunny" will be displayed to the screen. This
would include such names as: "Bugs Bunnys", "Bugs Bunnyyyy453", "Bugs
Bunnytrtrtrtrtr", but not "gs Bunny".

Focused Search Results

One can also perform searches and display only certain columns.

mysql> SELECT name FROM test

WHERE mysql> (name = "Bugs Bunny");

Result:

name

54 | P a g e
Bugs Bunny

Alter table

Another very important function of MySQL is the ability to modify previously created tables.
This is accomplished via the ALTER statement. This function allows one to add, modify, and
delete columns, as well as rename the table, among other functions.

Example: Rename the table

mysql> ALTER table test RENAME mytest;

Example: Add a column

mysql> ALTER table mytest ADD birthday DATE;

Example: Modify a column

mysql> ALTER table mytest CHANGE

mysql> name newname VARCHAR (25);

Example: Delete a column

mysql> ALTER table mytest DROP newname;

55 | P a g e
Executing the above four functions would modify test, creating the following table:

mysql> TABLE mytest (

> email VARCHAR (25),

> phone_number INT,

> ID INT AUTO_INCREMENT,

> birthday DATE );

DRIVER MANAGER AND DRIVER:

The java.sql package defines an interface called Java.sql.Driver that


makes to be implemented by all the JDBC drivers and a class called java.sql.DriverManager

56 | P a g e
that acts as the interface to the database clients for performing tasks like connecting to
external resource managers, and setting log streams. When a JDBC client requests the
DriverManager to make a connection to an external resource manager, it delegates the task to
an approate driver class implemented by the JDBC driver provided either by the resource
manager vendor or a third party.

JAVA.SQL.DRIVERMANAGER:

The primary task of the class driver manager is to manage the various JDBC
drivers register. It also provides methods for:
 Getting connections to the databases.
 Managing JDBC logs.
 Setting login timeout.

MANAGING DRIVERS:

JDBC clients specify the JDBC URL when they request a connection.
The driver manager can find a driver that matches the request URL from the list of register
drivers and delegate the connection request to that driver if it finds a match JDBC URLs
normally take the following format:
<protocol>:<sub-protocol>:<resource>
The protocol is always jdbc and the sub-protocol and resource depend on the type of resource
manager. The URL for postgreSQL is in the format:
Jdbc: postgres ://< host> :< port>/<database>
Here host is the host address on which post master is running and database is the name of the
database to which the client wishes to connect.

MANAGING CONNECTION:
DriverManager class is responsible for managing connections to the databases:

57 | P a g e
public static Connection getConnection (String url,Properties info)
throws SQLException
This method gets a connection to the database by the specified JDBC URL using the
specified username and password. This method throws an instance of SQLException if a
database access error occurs.

CONNECTIONS:
The interface java.sql.Connection defines the methods required for a persistent
connection to the database. The JDBC driver vendor implements this interface. A database
‘vendor-neutral’ client never uses the implementation class and will always use only the
interface. This interface defines methods for the following tasks:
 Statements, prepared statements, and callable statements are the different types
of statements for issuing sql statements to the database by the JDBC clients.
 For getting and setting auto-commit mode.
 Getting meta information about the database.
 Committing and rolling back transactions.

CREATING STATEMENTS:

The interface java.sql.Connection defines a set of methods for creating


database statements. Database statements are used for sending SQL statements to the
database:
Public Statement createStatement () throws SQLException

This method is used for creating instances of the interface java.sql.Statement. This interface
can be used for sending SQL statements to the database. The interface java.sql.Statement is
normally used for sending SQL statements that don’t take any arguments. This method
throws an instance of SQLException if a database access error occur:

Public Statement createStatement (int resType, int resConcurrency) throws SQLException

JDBC RESULTSETS:

A JDBC resultset represents a two dimentional array of data produced as


a result of executing SQL SELECT statements against databases using JDBC statements. JDBC
58 | P a g e
resultsets are represented by the interface java.sql.ResultSet. The JDBC vendor provider
provides the implementation class for this interface.

SCROLLING RESULTSETS:

public boolean next() throws SQLException

public boolean previous() throws

SQLException public boolean first() throws

SQLException public boolean last() throws

SQLException

ACCESSING RESULTSET DATA:

Method nameand Purpose

public boolean getBoolean (int i)

Gets the data in the specified column as a boolean.

public boolean getBoolean (String col)

public int getInt(int I) Gets the data in the specied columnas

an int.

public int getInt (String col)

59 | P a g e
60 | P a g e
STATEMENT:

The interface java.sql.Stament is normally used for sending SQL statements that do not
have IN or OUT parameters. The JDBC driver vendor provides the implementation class for
this interface. The common methods required by the different JDBC statements are defined in
this interface. The methods defined by java.sql. Statement can be broadly categorized as
follows:

 Executing SQL statements


 Querying results and resultsets
 Handling SQL batches
 Other miscellaneous methods

The interface java.sql.statements defines

methods for executing different SQL statements like SELECT, UPDATE, INSERT, DELETE,
and CREATE.

Public Resultset execute Query (string sql) throws SQLException

The following figure shows how the DriverManager, Driver, Connection, Statement, ResultSet
classes are connected.

DriverManager

Driver
Driver

Application
Connectio
n

53 | P a g e
Prepared Statement Statement Callable Statement
6.4 JAVA SERVER PAGES
(JSP) INTRODUCTION:

Java Server Pages (JSP) technology enables you to mix regular, static HTML with dynamically
generated content. You simply write the regular HTML in the normal manner, using familiar
Web-page-building tools. You then enclose the code for the dynamic parts in special tags,
most of which start with <% and end with %>.

THE NEED FOR JSP:

Servlets are indeed useful, and JSP by no means makes them obsolete. However,

 It is hard to write and maintain the HTML.


 You cannot use standard HTML tools.
 The HTML is inaccessible to non-Java developers.

BENEFITS OF JSP:

JSP provides the following benefits over servlets alone:

 It is easier to write and maintain the HTML: In this no extra backslashes, no


double quotes, and no lurking Java syntax.
 You can use standard Web-site development tools:

54 | P a g e
We use Macromedia Dreamweaver for most of the JSP pages. Even HTML
tools that know nothing about JSP can used because they simply ignore the JSP tags.

 You can divide up your development team:


The Java programmers can work on the dynamic code. The Web developers
can concatenate on the representation layer. On large projects, this division is very
important. Depending on the size of your team and the complexity of your project, you can
enforce a weaker or stronger separation between the static HTML and the dynamic
content.

CREATING TEMPLATE TEXT:

A large percentage of our JSP document consists of static text known as template text. In
almost all respects, this HTML looks just likes normal HTML follows all the same syntax
rules, and simply “passed through” to that client by the servlet created to handle the page.
Not only does the HTML look normal, it can be created by whatever tools you already are
using for building Web pages.

There are two minor exceptions to the “template text passed through” rule.
First, if you want to have <% 0r %> in the out port, you need to put <\% or %\> in the
template text. Second, if you want a common to appear in the JSP page but not in the
resultant document,

<%-- JSP Comment --

%> HTML comments of the form:

<!—HTML Comment -->

are passed through to the client normally.

TYPES OF JSP SCRIPTING ELEMENTS:

JSP scripting elements allow you to insert Java code into the servlet that will be
generated from the JSP page. There are three forms:

55 | P a g e
1. Expressions of the form <%=Java Expression %>, which are evaluated and
inserted into the servlet’s output.
2. Sciptlets of the form <%Java code %>, which are inserted into the
servlet’s_jspService method (called by service).
3. Declarations of the form<%! Field/Method Declaration %>, which are
inserted into the body of the servlet class, outside any existing methods.

USING JSP EXPRESSIONS:

A JSP element is used to insert values directly into the output. It has the following form:

<%= Java Expression %>

The expression is evaluated, converted to a string, and inserted in the page. This evaluation is
performed at runtime (when the page is requested) and thus has full access to the
information about the request. For example, the following shows the date/time that the page
was requested.

Current time: <%=new java.util.Date () %>

PREDEFINED VARIABLES:

To simplify expressions we can use a number of predefined variables (or “implicit objects”).
The specialty of these variables is that, the system simple tells what names it will use for the
local variables in _jspService.The most important ones of these are:

 request, the HttpServletRequest.

56 | P a g e
 response, the HttpServletResponse.
 session, the HttpSession associated with the request
 out, the writer used to send output to clients.
 application, the ServletContext. This is a data structure shared by all servlets and
JSP pages in the web application and is good for storing shared data.
Here is an example:

Your hostname: <%= request.getRemoteHost () %>

COMPARING SERVLETS TO JSP PAGES

JSP works best when the structure of the HTML page is fixed but the values at various places
need to be computed dynamically. If the structure of the page is dynamic, JSP is less
beneficial. Some times servlets are better in such a case. If the page consists of binary data or
has little static content, servlets are clearly superior. Sometimes the answer is neither
servlets nor JSP alone, but rather a combination of both.

WRITING SCRIPTLETS

If you want to do something more complex than output the value of a simple expression .JSP
scriptlets let you insert arbitrary code into the servlet’s _jspService method. Scriptlets have
the following form:

<% Java code %>

Scriptlets have access to the same automatically defined variables as do expressions (request,
response, session, out , etc ) .So for example you want to explicitly send output of the
resultant page , you could use the out variable , as in the following example:

<%

57 | P a g e
String queryData = request.getQueryString ();

out.println (“Attached GET data: “+ queryData);

%>

SCRIPTLET EXAMPLE:

As an example of code that is too complex for a JSP expression alone, a JSP page that uses the
bgColor request parameter to set the background color of the page .Simply using

<BODY BGCOLOR=”<%= request.getParameter (“bgcolor”) %>

“> would violate the cardinal rule of reading form data.

USING DECLARATIONS

A JSP declaration lets you define methods or fields that get inserted into the main body of the
servlet class .A declaration has the following form:

<%! Field or Method Definition %>

Since declarations do not generate output, they are normally used in conjunction with JSP
expressions or scriptlets. In principle, JSP declarations can contain field (instance variable)
definitions, method definitions, inner class definitions, or even static initializer blocks:
anything that is legal to put inside a class definition but outside any existing methods. In
practice declarations almost always contain field or method definitions.

We should not use JSP declarations to override the standard servlet life cycle methods. The
servlet into which the JSP page gets translated already makes use of these methods. There is
no need for declarations to gain access to service, doget, or dopost, since calls to service

58 | P a g e
are

59 | P a g e
automatically dispatched to _jspService , which is where code resulting from expressions and
scriptlets is put. However for initialization and cleanup, we can use jspInit and jspDestroy-
the standard init and destroy methods are guaranteed to call these methods in the servlets
that come from JSP.

6.5 JAKARTA TOMCAT

Tomcat is the Servlet/JSP container. Tomcat implements the Servlet 2.4

and JavaServer Pages 2.0 specification. It also includes many additional features that make
it a useful platform for developing and deploying web applications and web services.

TERMINOLOGY:

Context – a Context is a web application.

$CATALINA_HOME – This represents the root of Tomcat installation.

DIRECTORIES AND FILES:

/bin – Startup, shutdown, and other scripts. The *.sh files (for Unix systems) are
functional duplicates of the *.bat files (for Windows systems). Since the Win32 command-
line lacks certain functionality, there are some additional files in here.

/conf – Configuration files and related DTDs. The most important file in here is
server.xml. It is the main configuration file for the container.

60 | P a g e
61 | P a g e
/logs – Log files are here by default.

/webapps – This is where webapps go\

INSTALLATION:

Tomcat will operate under any Java Development Kit (JDK) environment that provides
a JDK 1.2 (also known as Java2 Standard Edition, or J2SE) or later platform. JDK is needed
so that servlets, other classes, and JSP pages can be compiled.

DEPLOYMENT DIRECTORIES FOR DEFAULT WEB APPLICATION:

HTML and JSP Files

 Main Location
$CATALINA_HOME/webapps/ROOT

 Corresponding URLs.
http://host/SomeFile.htm
l

http://host/SomeFile.jsp

 More Specific Location (Arbitrary Subdirectory).


$CATALINA_HOME/webapps/ROOT/SomeDirectory

62 | P a g e
63 | P a g e
 Corresponding URLs
http://host/SomeDirectory/SomeFile.htm
l

http://host/SomeDirectory/SomeFile.jsp

Individual Servlet and Utility Class Files

 Main Location (Classes without Packages).


$CATALINA_HOME/webapps/ROOT/WEB-INF/classes

 Corresponding URL (Servlets).


http://host/servlet/ServletNam
e

 More Specific Location (Classes in Packages).


$CATALINA_HOME/webapps/ROOT/WEB-INF/classes/packageName

 Corresponding URL (Servlets in Packages).


http://host/servlet/packageName.ServletNam
e

Servlet and Utility Class Files Bundled in JAR Files

 Location
$CATALINA_HOME/webapps/ROOT/WEB-INF/lib

 Corresponding URLs (Servlets)


http://host/servlet/ServletNam
e

http://host/servlet/packageName.ServletName
64 | P a g e
65 | P a g e
TESTING

SOFTWARE TESTING

Testing
Software testing is a critical element of software quality assurance and
represents the ultimate review of specification, design and code generation.

7.1 TESTING OBJECTIVES

 To ensure that during operation the system will perform as per specification.
 TO make sure that system meets the user requirements during operation
 To make sure that during the operation, incorrect input, processing and
output will be detected
 To see that when correct inputs are fed to the system the outputs are correct
 To verify that the controls incorporated in the same system as intended
 Testing is a process of executing a program with the intent of finding an error
 A good test case is one that has a high probability of finding an as yet
undiscovered error

66 | P a g e
The software developed has been tested successfully using the following testing
strategies and any errors that are encountered are corrected and again the part of the
program or the procedure or function is put to testing until all the errors are removed. A
successful test is one that uncovers an as yet undiscovered error.

Note that the result of the system testing will prove that the system is working
correctly. It will give confidence to system designer, users of the system, prevent frustration
during implementation process etc.,

7.2 TEST CASE DESIGN:

White box testing

White box testing is a testing case design method that uses the control structure of the
procedure design to derive test cases. All independents path in a module are exercised at
least once, all logical decisions are exercised at once, execute all loops at boundaries and
within their operational bounds exercise internal data structure to ensure their validity. Here
the customer is given three chances to enter a valid choice out of the given menu. After which
the control exits the current menu.

Black Box Testing

Black Box Testing attempts to find errors in following areas or categories, incorrect or
missing functions, interface error, errors in data structures, performance error and
initialization and termination error. Here all the input data must match the data type to
become a valid entry.

The following are the different tests at various levels:

Unit Testing:

67 | P a g e
Unit testing is essentially for the verification of the code produced during the
coding phase and the goal is test the internal logic of the module/program. In the
Generic code project, the unit testing is done during coding phase of data entry forms
whether the functions are working properly or not. In this phase all the drivers are
tested they are rightly connected or not.

Integration Testing:

All the tested modules are combined into sub systems, which are then tested. The
goal is to see if the modules are properly integrated, and the emphasis being on the
testing interfaces between the modules. In the generic code integration testing is done
mainly on table creation module and insertion module.

Validation Testing

This testing concentrates on confirming that the software is error-free in all respects.
All the specified validations are verified and the software is subjected to hard-core testing. It
also aims at determining the degree of deviation that exists in the software designed from the
specification; they are listed out and are corrected.

System Testing

This testing is a series of different tests whose primary is to fully exercise the
computer-based system. This involves:

 Implementing the system in a simulated production environment and testing it.


 Introducing errors and testing for error handling.

68 | P a g e
TEST CASES

TEST CASE 1:

Test case for Login form:

When a user tries to login by submitting an incorrect ID or an incorrect Password then it


displays an error message “NOT A VALID USER NAME”.

TEST CASE 2:

Test case for User Registration form:

When a user enters user id to register and ID already exists, then this result in
displaying error message “USER ID ALREADY EXISTS”.

TEST CASE 3:

Test case for cart:

When a customer views an empty cart it displays “Cart is empty” message. When a user
wants to add a product to cart without logging into the system a message “Please login to
purchase” will be displayed.
TEST CASE 4:

69 | P a g e
Validation cases:

If any data field which accept the data from the user are not filled then
the corresponding error messages are generated.

70 | P a g e
OUTPUT SCREENS

OUTPUT SCREENS

HOME PAGE:

71 | P a g e
About Us

72 | P a g e
Contact Us

73 | P a g e
Registration

74 | P a g e
Registration Validation

75 | P a g e
LOGIN PAGE:

76 | P a g e
Login Validation

77 | P a g e
MANAGER HOME PAGE:

78 | P a g e
Adding New Product

79 | P a g e
Manager View Sales Report

80 | P a g e
Customer Home Page:

81 | P a g e
Browsing Products

82 | P a g e
Adding Product to Cart

83 | P a g e
Cart View:

84 | P a g e
Customer Profile Edit

85 | P a g e
SOURCE

CODE

DATABASE:

-- phpMyAdmin SQL Dump

-- version 4.7.9

-- https://www.phpmyadmin.net/

--

-- Host: 127.0.0.1

-- Generation Time: Jul 15, 2018 at 03:37 PM

-- Server version: 10.1.31-MariaDB

-- PHP Version: 7.2.3

SET SQL_MODE =

"NO_AUTO_VALUE_ON_ZERO"; SET

AUTOCOMMIT = 0;

START TRANSACTION;

SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;

/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;

/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;

86 | P a g e
/*!40101 SET NAMES utf8mb4 */;

87 | P a g e
--

-- Database: `shopping`

--

--

-- Table structure for table `admin`

--

CREATE TABLE `admin` (

`id` int(11) NOT NULL,

`username` varchar(255) NOT NULL,

`password` varchar(255) NOT NULL,

`creationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

`updationDate` varchar(255) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--

-- Dumping data for table `admin`

--

INSERT INTO `admin` (`id`, `username`, `password`, `creationDate`, `updationDate`) VALUES

88 | P a g e
(1, 'admin', 'f925916e2754e5e03f75dd58a5733251', '2017-01-24 16:21:18', '21-06-2018
08:27:55 PM');

--

-- Table structure for table `category`

--

CREATE TABLE `category` (

`id` int(11) NOT NULL,

`categoryName` varchar(255) DEFAULT NULL,

`categoryDescription` longtext,

`creationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

`updationDate` varchar(255) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--

-- Dumping data for table `category`

--

INSERT INTO `category` (`id`, `categoryName`, `categoryDescription`, `creationDate`,


`updationDate`) VALUES

(3, 'Books', 'Test anuj', '2017-01-24 19:17:37', '30-01-2017 12:22:24 AM'),

89 | P a g e
(4, 'Electronics', 'Electronic Products', '2017-01-24 19:19:32', ''),

(5, 'Furniture', 'test', '2017-01-24 19:19:54', ''),

(6, 'Fashion', 'Fashion', '2017-02-20 19:18:52', '');

--

-- Table structure for table `orders`

--

CREATE TABLE `orders` (

`id` int(11) NOT NULL,

`userId` int(11) DEFAULT NULL,

`productId` varchar(255) DEFAULT NULL,

`quantity` int(11) DEFAULT NULL,

`orderDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

`paymentMethod` varchar(50) DEFAULT NULL,

`orderStatus` varchar(55) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--

-- Dumping data for table `orders`

--

90 | P a g e
INSERT INTO `orders` (`id`, `userId`, `productId`, `quantity`, `orderDate`, `paymentMethod`,
`orderStatus`) VALUES

(1, 1, '3', 1, '2017-03-07 19:32:57', 'COD', NULL),

(3, 1, '4', 1, '2017-03-10 19:43:04', 'Debit / Credit card', 'Delivered'),

(4, 1, '17', 1, '2017-03-08 16:14:17', 'COD', 'in Process'),

(5, 1, '3', 1, '2017-03-08 19:21:38', 'COD', NULL),

(6, 1, '4', 1, '2017-03-08 19:21:38', 'COD', NULL);

--

-- Table structure for table `ordertrackhistory`

--

CREATE TABLE `ordertrackhistory` (

`id` int(11) NOT NULL,

`orderId` int(11) DEFAULT NULL,

`status` varchar(255) DEFAULT NULL,

`remark` mediumtext,

`postingDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--

-- Dumping data for table `ordertrackhistory`

91 | P a g e
--

INSERT INTO `ordertrackhistory` (`id`, `orderId`, `status`, `remark`, `postingDate`)

VALUES (1, 3, 'in Process', 'Order has been Shipped.', '2017-03-10 19:36:45'),

(2, 1, 'Delivered', 'Order Has been delivered', '2017-03-10 19:37:31'),

(3, 3, 'Delivered', 'Product delivered successfully', '2017-03-10 19:43:04'),

(4, 4, 'in Process', 'Product ready for Shipping', '2017-03-10 19:50:36');

--

-- Table structure for table `productreviews`

--

CREATE TABLE `productreviews` (

`id` int(11) NOT NULL,

`productId` int(11) DEFAULT NULL,

`quality` int(11) DEFAULT NULL,

`price` int(11) DEFAULT NULL,

`value` int(11) DEFAULT NULL,

`name` varchar(255) DEFAULT NULL,

`summary` varchar(255) DEFAULT NULL,

`review` longtext,

`reviewDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP


92 | P a g e
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--

-- Dumping data for table `productreviews`

--

INSERT INTO `productreviews` (`id`, `productId`, `quality`, `price`, `value`, `name`, `summary`,
`review`, `reviewDate`) VALUES

(2, 3, 4, 5, 5, 'Anuj Kumar', 'BEST PRODUCT FOR ME :)', 'BEST PRODUCT FOR ME :)', '2017-
02-26 20:43:57'),

(3, 3, 3, 4, 3, 'Sarita pandey', 'Nice Product', 'Value for money', '2017-02-26 20:52:46'),

(4, 3, 3, 4, 3, 'Sarita pandey', 'Nice Product', 'Value for money', '2017-02-26 20:59:19');

--

-- Table structure for table `products`

--

CREATE TABLE `products` (

`id` int(11) NOT NULL,

`category` int(11) NOT NULL,

`subCategory` int(11) DEFAULT NULL,

`productName` varchar(255) DEFAULT NULL,

93 | P a g e
`productCompany` varchar(255) DEFAULT NULL,

`productPrice` int(11) DEFAULT NULL,

`productPriceBeforeDiscount` int(11) DEFAULT NULL,

`productDescription` longtext,

`productImage1` varchar(255) DEFAULT NULL,

`productImage2` varchar(255) DEFAULT NULL,

`productImage3` varchar(255) DEFAULT NULL,

`shippingCharge` int(11) DEFAULT NULL,

`productAvailability` varchar(255) DEFAULT NULL,

`postingDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,

`updationDate` varchar(255) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--

-- Dumping data for table `products`

--

--

-- Table structure for table `subcategory`

--

CREATE TABLE `subcategory` (

`id` int(11) NOT NULL,


94 | P a g e
`categoryid` int(11) DEFAULT NULL,

`subcategory` varchar(255) DEFAULT NULL,

`creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,

`updationDate` varchar(255) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--

-- Dumping data for table `subcategory`

--

INSERT INTO `subcategory` (`id`, `categoryid`, `subcategory`, `creationDate`, `updationDate`)


VALUES

(2, 4, 'Led Television', '2017-01-26 16:24:52', '26-01-2017 11:03:40 PM'),

(3, 4, 'Television', '2017-01-26 16:29:09', ''),

(4, 4, 'Mobiles', '2017-01-30 16:55:48', ''),

(5, 4, 'Mobile Accessories', '2017-02-04 04:12:40', ''),

(6, 4, 'Laptops', '2017-02-04 04:13:00', ''),

(7, 4, 'Computers', '2017-02-04 04:13:27', ''),

(8, 3, 'Comics', '2017-02-04 04:13:54', ''),

(9, 5, 'Beds', '2017-02-04 04:36:45', ''),

(10, 5, 'Sofas', '2017-02-04 04:37:02', ''),

(11, 5, 'Dining Tables', '2017-02-04 04:37:51', ''),

(12, 6, 'Men Footwears', '2017-03-10 20:12:59', '');

95 | P a g e
--

-- Table structure for table `userlog`

--

CREATE TABLE `userlog` (

`id` int(11) NOT NULL,

`userEmail` varchar(255) DEFAULT NULL,

`userip` binary(16) DEFAULT NULL,

`loginTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP,

`logout` varchar(255) DEFAULT NULL,

`status` int(11) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--

-- Dumping data for table `userlog`

--

INSERT INTO `userlog` (`id`, `userEmail`, `userip`, `loginTime`, `logout`, `status`) VALUES

(1, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-02-26 11:18:50', '', 1),

(2, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-02-26 11:29:33', '', 1),

(3, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-02-26 11:30:11', '', 1),

96 | P a g e
(4, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-02-26 15:00:23', '26-
02-2017 11:12:06 PM', 1),

(5, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-02-26 18:08:58', '', 0),

(6, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-02-26 18:09:41', '', 0),

(7, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-02-26 18:10:04', '', 0),

(8, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-02-26 18:10:31', '', 0),

(9, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-02-26 18:13:43', '', 1),

(10, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-02-27 18:52:58', '',


0),

(11, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-02-27 18:53:07', '',


1),

(12, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-03-03 18:00:09', '',


0),

(13, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-03-03 18:00:15', '',


1),

(14, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-03-06 18:10:26', '',


1),

(15, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-03-07 12:28:16', '',


1),

(16, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-03-07 18:43:27', '',


1),

(17, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-03-07 18:55:33', '',


1),

(18, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-03-07 19:44:29', '',


1),

(19, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-03-08 19:21:15', '',


1),

97 | P a g e
(20, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-03-15 17:19:38', '',
1),

(21, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-03-15 17:20:36', '15-


03-2017 10:50:39 PM', 1),

(22, '[email protected]', 0x3a3a3100000000000000000000000000, '2017-03-16 01:13:57', '',


1),

(23, '[email protected]', 0x3a3a3100000000000000000000000000, '2018-04-29 09:30:40', '', 1);

--

-- Table structure for table `users`

--

CREATE TABLE `users` (

`id` int(11) NOT NULL,

`name` varchar(255) DEFAULT NULL,

`email` varchar(255) DEFAULT NULL,

`contactno` bigint(11) DEFAULT NULL,

`password` varchar(255) DEFAULT NULL,

`shippingAddress` longtext,

`shippingState` varchar(255) DEFAULT NULL,

`shippingCity` varchar(255) DEFAULT NULL,

`shippingPincode` int(11) DEFAULT NULL,

`billingAddress` longtext,
98 | P a g e
`billingState` varchar(255) DEFAULT NULL,

`billingCity` varchar(255) DEFAULT NULL,

`billingPincode` int(11) DEFAULT NULL,

`regDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

`updationDate` varchar(255) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--

-- Dumping data for table `users`

--

INSERT INTO `users` (`id`, `name`, `email`, `contactno`, `password`, `shippingAddress`,


`shippingState`, `shippingCity`, `shippingPincode`, `billingAddress`, `billingState`, `billingCity`,
`billingPincode`, `regDate`, `updationDate`) VALUES

(1, 'Anuj Kumar', '[email protected]', 9009857868, 'f925916e2754e5e03f75dd58a5733251',


'CS New Delhi', 'New Delhi', 'Delhi', 110001, 'New Delhi', 'New Delhi', 'Delhi', 110092, '2017-
02- 04 19:30:50', ''),

(2, 'Amit ', '[email protected]', 8285703355, '5c428d8875d2948607f3e3fe134d71b4', '', '', '', 0, '', '',
'', 0, '2017-03-15 17:21:22', ''),

(3, 'hg', '[email protected]', 1121312312, '827ccb0eea8a706c4c34a16891f84e7b', '', '', '', 0, '', '',
'', 0, '2018-04-29 09:30:32', '');

--

99 | P a g e
-- Table structure for table `wishlist`

--

CREATE TABLE `wishlist` (

`id` int(11) NOT NULL,

`userId` int(11) DEFAULT NULL,

`productId` int(11) DEFAULT NULL,

`postingDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--

-- Dumping data for table `wishlist`

--

INSERT INTO `wishlist` (`id`, `userId`, `productId`, `postingDate`)

VALUES (1, 1, 0, '2017-02-27 18:53:17');

--

-- Indexes for dumped tables

--

--

-- Indexes for table `admin`

--
100 | P a g
e
ALTER TABLE `admin`

ADD PRIMARY KEY

(`id`);

--

-- Indexes for table `category`

--

ALTER TABLE `category`

ADD PRIMARY KEY

(`id`);

--

-- Indexes for table `orders`

--

ALTER TABLE `orders`

ADD PRIMARY KEY

(`id`);

--

-- Indexes for table `ordertrackhistory`

--

--

-- Indexes for table `productreviews`

--
101 | P a g
e
ALTER TABLE

`ordertrackhistory` ADD

PRIMARY KEY (`id`);

--

-- Indexes for table `productreviews`

--
102 | P a g
e
ALTER TABLE

`productreviews` ADD

PRIMARY KEY (`id`);

--

-- Indexes for table `products`

--

ALTER TABLE `products`

ADD PRIMARY KEY

(`id`);

--

-- Indexes for table `subcategory`

--

ALTER TABLE

`subcategory` ADD

PRIMARY KEY (`id`);

--

-- Indexes for table `userlog`

--

--

-- Indexes for table `users`

--
103 | P a g
e
ALTER TABLE `userlog`

ADD PRIMARY KEY

(`id`);

--

-- Indexes for table `users`

--
104 | P a g
e
ALTER TABLE `users`

ADD PRIMARY KEY (`id`);

--

-- Indexes for table `wishlist`

--

ALTER TABLE `wishlist`

ADD PRIMARY KEY

(`id`);

--

-- AUTO_INCREMENT for dumped tables

--

--

-- AUTO_INCREMENT for table `admin`

--

ALTER TABLE `admin`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--

-- AUTO_INCREMENT for table `category`

--

ALTER TABLE `category`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;


105 | P a g
e
--

-- AUTO_INCREMENT for table `orders`

--

ALTER TABLE `orders`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--

-- AUTO_INCREMENT for table `ordertrackhistory`

--

ALTER TABLE `ordertrackhistory`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--

-- AUTO_INCREMENT for table `productreviews`

--

ALTER TABLE `productreviews`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--

-- AUTO_INCREMENT for table `products`

--

ALTER TABLE `products`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;


98 | P a g e
--

-- AUTO_INCREMENT for table `subcategory`

--

ALTER TABLE `subcategory`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--

-- AUTO_INCREMENT for table `userlog`

--

ALTER TABLE `userlog`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;

--

-- AUTO_INCREMENT for table `users`

--

ALTER TABLE `users`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--

-- AUTO_INCREMENT for table `wishlist`

--

ALTER TABLE `wishlist`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;


99 | P a g e
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;

/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

100 | P a g e
9. CONCLUSION

The Shopping Cart project has been successfully completed. The goal of the system is
achieved and the problems are solved. This project is developed in this manner that is
user friendly and required help is provided at different levels.

The primary objective is to provide the interactive service to all the Users.
Different types of services are provided to both the admin and users. User can avail
this service any time.

101 | P a g e
APPENDIX

ABBREVATIONS:

HTML: Hyper text mark up language.

JSCRIPT: java script

DFD: Data Flow Diagrams


HTTP: Hyper Text Transfer

Protocol JDBC: Java Data Base

FAQ’ Connectivity.
S

What is java script?

Java script is a compact, object based scripting language for developing


client and server internet applications.

Client vs server side java script?

Client side java script is interpreted only with in the browser that support it, and
the code is visible to the user. Server side java script is stored in a pre-compiled state on
the server, so it is browser – independent, and only the results of the java script
programs are passed to the browser, so that code is never revealed.

Where can <script> container tags be placed with in an html document?

In general, the <script> container tags may appear any where with in the html document.
It is more viable to have the tags placed with in the <head> container.

102 | P a g e
103 | P a g e
BIBLIOGRAPHY

Advanced Java Programming - Dietel and Dietel

Mastering JAVA 2 - John Zukowski

Java Server Programming - Apress

Software Engineering - Roger S

Pressman Análysis & Design of InformationSystems –

Senn

Websites

www.eci.gov.in

www.google.com

www.apeci.com

www.askjeeves.com

104 | P a g e
105 | P a g e

You might also like