This project report describes the development of an e-commerce website. It discusses the client-side and server-side programming used to build the website. The website uses an MVC framework with models to store data, views to display the user interface, and controllers to handle user requests. It also describes the hardware and software requirements including a web server, database, programming languages, and browser capabilities needed to implement the website. Screenshots of the website and coding examples are provided. The report concludes with future enhancements and a references section.
This section introduces the project report on an E-Commerce website, showcasing the team members and the structure of the report consisting of various chapters including their page numbers.
These slides contain a certification of the project by Mrs. Nisha and a declaration by the group asserting the originality of the work.
The team expresses gratitude towards their supervisor Mrs. Nisha and other supportive individuals at NIIT for their assistance during the project.
This section provides an overview of the growth of online grocery shopping, the complexities involved in consumer decision-making, and the aim of the ecommerce website project.
The slides discuss the Client and Server Side Programming technologies, explaining their roles in web development, particularly in the context of E-Commerce.
It details the advantages of E-Commerce such as 24/7 availability, cost efficiency, and ease of access for consumers amidst the hardware and software requirements.
Introduces system design using UML, showcasing various diagrams including use-case, activity, class, and data flow diagrams important for the architecture of the E-Commerce site.
Discusses database tables for the application, including coding examples and features of both user and admin interfaces crucial for the website's functionality.
Summarizes the advantages of E-Commerce technologies, identifies future trends such as social media engagement and AI, and concludes the project with future scope.
PROJECT REPORT
On
E-COMMERCE WEBSITE
Submittedin Partial Fulfillment of the
Requirements for the Award of the degree
Submitted by:
Priyanshu Joshi (S160022100505)
Nitin Negi (S150022100164)
Lakhan Singh Rautella (S150022100527)
Tanuj Singh (S150022100307)
Under The Guidance of
Mrs. Nisha Mam
NIIT
2.
2 | Pa g e
[Janakpuri, New Delhi]
CONTENT
Chapter Page No.
Certificate 4.
Declaration 5.
Acknowledgement 6.
Abstract 7.
List of Figures 8.
Basic AIM
Client Side Programming
Server Side Programming
How It Works
How Do We Get Idea?
Hardware and Software Requirements Specification 9.
Web Server
Web Browser
Server Software
TCP/IP Address
Ports and Protocols Web Authorizing Tools
Database System
Programming Languages
Browser and Platform Capabilities
System Design (UML and Use Cases) 13.
Use-case diagram 14
Activity diagram 15
Class diagram 16
3.
3 | Pa g e
DFD 17-19
Database Tables 20-21
Screenshots 22-29
Coding 30
User pages 31-125
Admin pages 126-170
Java Beans 171-181
DAO 182-199
Result 200
Future Scope and Conclusion & References 201
4.
4 | Pa g e
CERTIFICATE
This to certify that the project report entitled “E-Commerce Website” which has
been submitted by [ Priyanshu Joshi (S160022100505), Nitin Negi
(S150022100164), Lakhan Singh Rautella (S150022100527) and Tanuj Singh
(S150022100307)] in the partial fulfillment of the requirements for the award of the
degree, from NIIT, New Delhi is an authentic record of the group’s own work carried
out by them under my guidance. The matter embodied on this thesis is original and
has not been submitted for the award of any other degree.
Date: Mrs. Nisha
Tech Mentor
NIIT
Janakpuri
5.
5 | Pa g e
DECLARATION
We hereby declare that all the work presented in the documentation entitled “E-
Commerce Website” in the partial fulfillment of the requirement for the award of
degree Software Engineering from NIIT in an authentic record of our own work
carried.
Date:
Priyanshu Joshi
(160022100505)
Nitin Negi
(S150022100164)
Lakhan Singh Rautella
(S150022100527)
6.
6 | Pa g e
Tanuj Singh
(S150022100307)
ACKNOWLEDGEMENT
We would like to express our gratitude towards our supervisor and our Teachers in
NIIT-Janakpuri, Mrs. Nisha who has given us support and suggestions. Without her
help we could not have presented this dissertation up to the present standard. We
also take this opportunity to thank all others who gave us support for the project and
in other aspects of our study at NIIT .
Date:
Priyanshu Joshi
(160022100505)
Nitin Negi
(S150022100164)
7.
7 | Pa g e
Lakhan Singh Rautella
(S150022100527)
Tanuj Singh
(S150022100307)
ABSTRACT
Online shopping has been known as a rapidly growing business, and although online
grocery shopping has not followed these same growth patterns in the past, it is now
being recognized for its potential. As such, the focus of previous online shopping
research has seldom encompassed this specific retail market, with the existing
studies focusing essentially on consumer’s motivations and attitudes, rather than
how consumers actually groceries online. Therefore, this dissertation has the
objective of uncovering some of the details which can help further both academic
research and managerial knowledge. The general consumer decision making
process is characterized by a pre-decisional a decisional and a post-decisional
phase. All of which were addressed in an exploratory fashion, through a mixed
methods strategy which combined both quantitative and qualitative methods of data
collection. One of the main results obtained through this study is complimentarily of
retail channels – as it was found that online grocery shopping serves essentially for
major shopping trips, being complimented with smaller trips to traditional stores.
Moreover, some resistance to online grocery shopping, specifically the shopping
of fresh produce, was also still found among the Portuguese population. Additionally,
based on two of the main consumer shopping orientations which shape online
grocery shopping. Price-sensitivity and convenience, this study uncovered consumer
groups which presented distinguishable shopping strategies. These strategies are in
general very focused and rational, and very essentially based on the shopper’s more
8.
8 | Pa g e
prominent shopping orientation. Moreover, all consumer types were found to have
general negative response to online stimuli present during shopping. Thus, this
dissertation contributed to the knowledge of consumer decision making process for
online grocery shopping, making wave for new and further researches in this field
and contributing to managerial knowledge.
INTRODUCTION
Basic Aim:
Complete online solution for SEO and SMO techniques for making websites popular
and get higher ranking on search engines.
Tailor made design with value added features for gaining and retaining customers on
the site.
Unlimited changes without functional difficulties for addressing ever-changing
business requirements
Safe and secure payment options and mechanism for generating trust among
customers and building up their confidence for the particular site.
Technical assistance for any difficulty for seamless operation of the site.
Client Side Programming:
Client-side (i.e. frontend) web development involves everything users see on their
screens. Here are the major frontend technology stack components.
Hypertext Markup Language (HTML) and Cascading Style Sheets (CSS). HTML tell the
browser how to display the content of web pages, while CSS styles that
content, Bootstrap is a helpful framework for managing HTML and CSS.
JavaScript (JS). JS Makes web pages interactive. There are many JavaScript
libraries (such as jQuery, AJAX) and frameworks (such as Hibernate) for faster
and easier web development.
Server Side Programming:
9.
9 | Pa g e
The server side isn’t visible to users, but it powers the client side, just as a power
station generates electricity for your house.
The challenge lies mainly in the choice of server side technologies for developing
you web application.
As for server side programming languages, they are used to create the logic of
websites and applications. Frameworks for programming languages offer lots of tools
for simpler and faster coding. Let’s mention some of the popular programming
languages and their major frameworks (in parentheses)
Java (Hibernate)
Node.js, a JavaScript runtime, is also used for backend programming.
Web application needs a place to store its data and that’s when a Database is used.
There are two types of Databases: Relational and Non-Relational databases, each
having its pros and cons. Here are the most common databases for web
development.
Oracle 10gXE
A web application needs a caching system to reduce the load on the database and
to handle large amount of traffic. Memcached and Redis are the most widespread
Caching system.
Finally, a web application needs a server to handle requests from client’s computers.
There are two major players in this domain:
Apache
Glassfish
To develop a web application, you need to select the server, database, programming
language, framework and frontend tools that you are going to use. These web
development technologies build on top of each other and are, in fact, collectively
called a stack.
How It Works?
E-Commerce web site system works with the help of a number of backend frontend
coding languages. The internal working is mainly based on the MVC flow of the E-
Commerce website.
MVC stands for – Model, View and Controller.
Model:
10.
10 | Pa g e
Model represents shape of the data and business logic. It maintains the data of the
application. Model Objects retrieve and store mol state in a database. Model is a
data and business logic.
View:
View is a user interface. View display data using model to the user and also enables
them to modify the data. View is a user interface.
Controller:
Controller handles the user request. Typically, user interact with view, which in-terms
raises appropriate URL request will be handled by a controller. The controller
renders the appropriate view with the model data as a response. Controller is a
request handler.
MVC is mostly used with spring for any web application development. It is very
powerful and nice layered architecture for flow and configuration. It is very flexible to
integrate with other web frameworks like struts. In spring web MVC, Dispatcher
servlet class works as the front controller. It is responsible to manage the flow of the
spring MVC application.
Let’s understand the steps involved in the MVC flow.
First request will be received by Dispatcher Servlet.
Second, dispatcher will take the help of handlerMapping and get to know the
Controller class name associated with the given request.
Third, so request transfer to controller, and then controller will process the request by
executing appropriate methods and returns ModeAndView object (contains Model
Data and View Name) back to Dispatcher Servlet.
Now the dispatcher servlet sends the model object to the view resolver to get the
actual view page.
Finally, the dispatcher servlet will pass the model object to the view page to display
the result.
How Do We Get The IDEA?
The invention of faster internet connectivity and powerful online tools has resulted in
a new commerce arena – E-Commerce. E-Commerce offered many advantages to
companies and customers.
11.
11 | Pa g e
Faster buying/selling procedure, as well as easy to find products
Buying/Selling 24/7.
More reach to customers, there is n theoretical geographic limitations.
Low operational cost and better quality of services.
No need of physical company set-ups.
Easy to start and manage a business.
Customers can easily select products from different providers without
moving around physically.
HARDWARE AND SOFTWARE
REQUIREMENT SPECIIFICATION
The hardware and software which can be employed to implement the code
generated in this project is listed below:
Web Server
Web Browser
Server Software
TCP/IP Address
Ports and Protocols
Web Authoring Tools
Database System
Domain Name
Programming Requirements
Browser and Platform Capabilities
Web Server
Web Server can refer to either the hardware (the computer) or the software (the
computer application) that help to deliver content that can be accessed through the
internet. The most common use of the web servers is to host websites but there are
other uses as well as such as data storage or running an enterprise application.
Web Browser
A web browser is a program/application designed to display the internet with web
pages. A few examples are Microsoft Edge and Google Chrome.
Server Software
12.
12 | Pa g e
Software is required in order for the server to run the software manages the
connections and the server, a few examples of home server software are:
Apache
Glass Fish Server
TCP/IP Addresses
Each computer must have unique IP address. TCP/IP uses four numbers to address
a compute. The numbers are in between 0-255. IP addresses are normally written as
four numbers separated by a period like this: 192.168.1.50. TCP/IP is used when
transferring data across a network. If computers do not use the same protocols, it
become impossible for the data to be understood.
Ports and Protocols
The protocol is the type of connection you are running through, examples are HTTP,
SSH, DNS and FTP. The port is the name of the connection you are going through,
the port no. usually the last 3 numbers of the default gateway, each device that is
connected to the network will have its own unique port number.
Web Authoring Tools
Web Authoring Tools are software or cloud servers that allow you to create and put
up a website. Microsoft publisher are the example that you can use.
Database System
A Database System is the Database a company uses to link with the website. It can
contain many things that will be changed by the users of the website. The database
will store Passwords, Names, Addresses, Store Items and other business
information.
Domain Name
13.
13 | Pa g e
The Domain Name is the main section of the website. Google is an example:
http://www.google.com/. Here “google” is the Domain Name.
Programming Languages:
Web Pages are usually written in HTML within the code other languages can be
used such as JSP, CSS,BOOTSTRAP and JavaScript. HTML itself doesn’t provide
E-Commerce capabilities so other languages must be used as well.
SYSTEM DESIGN
The Unified Modeling Language (UML) is a general-purpose, developmental,
modelling language in the field of software engineering that is intended to provide a
standard way to visualize the design of a system.
The creation UML was originally motivated by the desire to standardize the disparate
notational system and approaches to software design. It was developed by Grady
Booch, Ivan Jacobson and James RumBaugh at Rational Software in 1994-1995,
with further development led by them in 1996.
In 1997 UML was adopted as a standard by the Object Management Group (OMG),
and has been managed by this organization ever since. In 2005 UML was also
published by the International Organization of Standardization (ISO) as an approved
ISO standard. Since then the standard has been periodically revised to cover the
latest revision of UML.
121 | Pa g e
margin-left: 10%;
margin-top: 3%;
padding: 10px;
border:none;
cursor: pointer;
}
JavaScript
$('head').append('<linkrel="stylesheet" href="/css/style.css"
type="text/css" />');
/*slider function*/
$(document).ready(function()
{
$('.bxslider').bxSlider({
mode:'fade',
captions: true,
auto:true
});
});
/* pop up signup form*/
function popup()
{
document.querySelector(".bg-model").style.display="flex";
}
/* close button function*/
122.
122 | Pa g e
$(document).ready(function()
{
$("#close").click(function()
{
$(".bg-model").css("display","none");
});
});
/*pop up login*/
$(document).ready(function()
{
$("#login").click(function()
{
$(".model-content").css("display","none");
$(".login-content").css("display","block");
});
});
/*pop up signup on login content*/
$(document).ready(function()
{
$("#signup").click(function()
{
$(".model-content").css("display","block");
$(".login-content").css("display","none");
});
});
/*close button on login-content*/
123.
123 | Pa g e
$(document).ready(function()
{
$("#close_login").click(function()
{
$(".bg-model").css("display","none");
});
});
/*========================Signup
validation========================*/
$(document).ready(function()
{
$("#msg").css("display","none");
$("#sign_btn").click(function()
{
var v_name=$('#name').val();
var mbno=$('#m_num').val();
var pswd=$('#pass').val();
var cpswd=$('#cpas').val();
var name_regex= /^[a-zA-Z]+$/;
var mb_regex=/^(?:(?:+|0{0,2})91(s*[-]s*)?|[0]?)?[789]d{9}$/;
if(v_name.length == 0)
{
$('#name').attr('placeholder',"*Please enteryour name").css
({"opacity":"1","color":"red"});
124.
124 | Pa g e
$("#name").css({"border-bottom-color":"red","border-bottom-
style":"inset"});
return false;
}
else if(v_name.length<=5 || (!v_name.match(name_regex)))
{
alert("enter a valid name greater than 5 digit");
return false;
}
else if(mbno.length == 0)
{
$('#m_num').attr('placeholder',"*Please Enter your Mobile no").css
({"opacity":"1","color":"red"});
$("#m_num").css({"border-bottom-color":"red","border-bottom-
style":"inset"});
return false;
}
else if(!mbno.match(mb_regex))
{
alert("enter a valid mobelno");
return false;
}
else if(mbno.length == 0)
{
$('#m_num').attr('placeholder',"*Please Enter your Mobile no").css
({"opacity":"1","color":"red"});
125.
125 | Pa g e
$("#m_num").css({"border-bottom-color":"red","border-bottom-
style":"inset"});
return false;
}
else if(!mbno.match(mb_regex))
{
alert("enter a valid mobelno");
return false;
}
else if(pswd.length == 0 )
{
$('#pass').attr('placeholder',"*Please choose a password").css
({"opacity":"1","color":"red"});
$("#pass").css({"border-bottom-color":"red","border-bottom-
style":"inset"});
return false;
}
else if(pswd.length<6)
{
alert("enter password greater than 5 character");
return false;
}
else if(cpswd.length== 0 )
{
$('#cpas').attr('placeholder',"*Please confirm your password").css
({"opacity":"1","color":"red"});
126.
126 | Pa g e
$("#cpas").css({"border-bottom-color":"red","border-bottom-
style":"inset"});
return false;
}
else if(cpswd!=pswd)
{
alert("password does not match");
return false;
}
else
{
alert("registerdsuccefully");
return true;
}
});
$('input').click(function ()
{
$("input").css("color","grey");
$("input").css("border-bottom-color","grey");
});
});
127.
127 | Pa g e
Admin Pages
AdminLogin.jsp
<%--
Document : Adminlogin
Created on : Oct 21, 2018,10:08:07 AM
Author : Priyanshu
--%>
<%@page import="com.hibernate.Myadmin"%>
<%@page import="java.util.List"%>
<%@page import="com.hibernate.EcomUser"%>
<%@page import="org.hibernate.Session"%>
<%@page import="org.hibernate.SessionFactory"%>
<%@page import="org.hibernate.cfg.Configuration"%>
<%@page import="org.hibernate.cfg.Configuration"%>
<%@page contentType="text/html" pageEncoding="UTF-8"
import="servelet.AdminDao;"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>AdminLogin</title>
</head>
<body>
<%
try
{
173 | Pa g e
EcomUser.java
package com.hibernate;
public class EcomUser implements java.io.Serializable {
private long id;
private String name;
private long mobile;
private String password;
public EcomUser(){
}
public EcomUser(long id,String name, long mobile,String password) {
this.id = id;
this.name = name;
this.mobile = mobile;
this.password = password;
}
public EcomUser(String name, long mobile,String password) {
this.name = name;
this.mobile = mobile;
this.password = password;
}
174.
174 | Pa g e
public long getId(){
return this.id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public long getMobile() {
return this.mobile;
}
public void setMobile(long mobile){
this.mobile = mobile;
}
public String getPassword(){
return this.password;
}
public void setPassword(String password){
this.password = password;
175.
175 | Pa g e
}
}
MyAdmin.java
package com.hibernate;
public class Myadmin implements java.io.Serializable
{
private long id;
private String username;
private String password;
public Myadmin()
{
}
public Myadmin(long id, String username, String password)
{
this.id = id;
this.username = username;
this.password = password;
}
public long getId(){
return this.id;
}
public void setId(long id) {
this.id = id;
}
176.
176 | Pa g e
public String getUsername(){
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword(){
return this.password;
}
public void setPassword(String password){
this.password = password;
}
}
Product.java
package com.hibernate;
public class Product implements java.io.Serializable
{
private long proId;
private String proCat;
private String proSubcat;
private String proDesc;
private String proPrice;
private String proImage;
private String proBrand;
178 | Pa g e
this.proDesc = proDesc;
this.proPrice = proPrice;
this.proImage = proImage;
this.proBrand = proBrand;
}
public long getProId(){
return this.proId;
}
public void setProId(long proId){
this.proId = proId;
}
public String getProCat(){
return this.proCat;
}
public void setProCat(String proCat) {
this.proCat = proCat;
}
public String getProSubcat() {
return this.proSubcat;
}
public void setProSubcat(String proSubcat){
this.proSubcat= proSubcat;
}
179.
179 | Pa g e
public String getProDesc(){
return this.proDesc;
}
public void setProDesc(String proDesc){
this.proDesc= proDesc;
}
public String getProPrice(){
return this.proPrice;
}
public void setProPrice(String proPrice){
this.proPrice = proPrice;
}
public String getProImage(){
return this.proImage;
}
public void setProImage(String proImage){
this.proImage = proImage;
}
public String getProBrand(){
return this.proBrand;
}
public void setProBrand(String proBrand) {
this.proBrand = proBrand } }
180.
180 | Pa g e
UserOrder.java
package com.hibernate;
import java.util.Date;
public class Userorder implements java.io.Serializable
{
private String email;
private long orderId;
private String orderName;
private Date orderDate;
private String orderBy;
private String address;
public void setAddress(String address){
this.address = address;
}
public String getAddress(){
return address;
}
public Userorder(){
}
public Userorder(long orderId,String orderName, Date orderDate,
String orderBy) {
this.orderId = orderId;
this.orderName = orderName;
this.orderDate = orderDate;
181.
181 | Pa g e
this.orderBy = orderBy;
}
public Userorder(String orderName, Date orderDate, String
orderBy,String email,String address)
{
this.orderName = orderName;
this.orderDate = orderDate;
this.orderBy = orderBy;
this.address=address;
this.email=email;
}
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return email;
}
public long getOrderId(){
return this.orderId;
}
public void setOrderId(long orderId){
this.orderId = orderId;
}
182.
182 | Pa g e
public String getOrderName(){
return this.orderName;
}
public void setOrderName(String orderName) {
this.orderName = orderName;
}
public Date getOrderDate(){
return this.orderDate;
}
public void setOrderDate(Date orderDate){
this.orderDate = orderDate;
}
public String getOrderBy(){
return this.orderBy;
}
public void setOrderBy(String orderBy) {
this.orderBy= orderBy;
}
}
190 | Pa g e
public class ProductDao
{
public static int save(Product p)
{
int status=0;
try
{
Configuration cfg=new Configuration();
cfg.configure("hibernate.cfg.xml");
SessionFactorysf=cfg.buildSessionFactory();
Sessions=sf.openSession();
Transaction t=s.beginTransaction();
p=new
Product(p.getProCat(),p.getProSubcat(),p.getProDesc(),p.getProPrice(),
p.getProImage(),p.getProBrand());
s.persist(p);
t.commit();
s.close();
}
catch(Exceptione)
{
System. out.print(e);
}
return status;
}
public static List<Product> view()
{
191.
191 | Pa g e
List <Product> l=new ArrayList();
try
{
Configuration cfg=newConfiguration();
cfg.configure("hibernate.cfg.xml");
SessionFactorysf=cfg.buildSessionFactory();
Sessions=sf.openSession();
l=s.createQuery(" from Productorder by pro_id").list();
for(Productrow:l)
{
row.setProId(row.getProId());
row.setProCat(row.getProCat());
row.setProSubcat(row.getProSubcat());
row.setProDesc(row.getProDesc());
row.setProPrice(row.getProPrice());
row.setProImage(row.getProImage());
l.add(row);
}
s.close();
}
catch(Exceptione)
{
e.printStackTrace();
}
return l;
}
public static int delete(int id){
192.
192 | Pa g e
int status=0;
try{
Configuration cfg=newConfiguration();
cfg.configure("hibernate.cfg.xml");
SessionFactorysf=cfg.buildSessionFactory();
Sessions=sf.openSession();
Product p = new Product();
p.setProId(id);
Transaction tx = s.beginTransaction();
s.delete(p);
tx.commit();
s.close();
}
catch(Exceptione)
{
e.printStackTrace();
}
return status;
}
public static void update(Productp)
{
try{
Configuration cfg=newConfiguration();
cfg.configure("hibernate.cfg.xml");
SessionFactorysf=cfg.buildSessionFactory();
193.
193 | Pa g e
Sessions=sf.openSession();
p.setProId(p.getProId());
p.setProCat(p.getProCat());
p.setProSubcat(p.getProSubcat());
p.setProDesc(p.getProDesc());
p.setProPrice(p.getProPrice());
p.setProImage(p.getProImage());
Transaction txn=s.beginTransaction();
s.update(p);
txn.commit();
s.close();
}
catch(Exceptionex)
{
ex.printStackTrace();
}
}
public static Product viewById(int id)
{
Productp=new Product();
try
{
List<Product> ls=new ArrayList();
Configuration cfg=newConfiguration();
cfg.configure("hibernate.cfg.xml");
SessionFactorysf=cfg.buildSessionFactory();
194.
194 | Pa g e
Sessions=sf.openSession();
ls=s.createQuery("from Productwhere proId='"+id+"'").list();
for(Productrow:ls)
{
p.setProId(row.getProId());
p.setProCat(row.getProCat());
p.setProSubcat(row.getProSubcat());
p.setProDesc(row.getProDesc());
p.setProPrice(row.getProPrice());
p.setProImage(row.getProImage());
ls.add(p);
}
s.close();
return p;
}
catch(Exceptionex)
{
ex.printStackTrace();
}
return p;
}
public static List<Product> viewByBrand(String str)
{
List <Product> l=new ArrayList();
195.
195 | Pa g e
try
{
Configuration cfg=newConfiguration();
cfg.configure("hibernate.cfg.xml");
SessionFactorysf=cfg.buildSessionFactory();
Sessions=sf.openSession();
l=s.createQuery(" from Productwhere
proBrand='"+str+"'").list();
for(Productrow:l)
{
row.setProId(row.getProId());
row.setProCat(row.getProCat());
row.setProSubcat(row.getProSubcat());
row.setProDesc(row.getProDesc());
row.setProPrice(row.getProPrice());
row.setProImage(row.getProImage());
l.add(row);
}
s.close();
}
catch(Exceptione)
{
e.printStackTrace();
}
return l;
}
}
196.
196 | Pa g e
sendMail.java
package servelet;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class sendMail
{
public static void send(String to,String sub,String msg,String
user,String pass)
{
Properties prop=newProperties();
prop.put("mail.smtp.host","smtp.gmail.com");
prop.put("mail.smtp.port","587");
prop.put("mail.smtp.auth","true");
prop.put("mail.smtp.starttls.enable","true");
Sessionses=Session.getInstance(prop,new
javax.mail.Authenticator()
{
protected PasswordAuthentication
getPasswordAuthentication()
{
return new PasswordAuthentication(user,pass);
}
});
197.
197 | Pa g e
try
{
MimeMessage mesg=newMimeMessage(ses);
mesg.setFrom(newInternetAddress(user));
mesg.addRecipient(Message.RecipientType.TO,new
InternetAddress(to));
mesg.setSubject(sub);
mesg.setText(msg);
Transport.send(mesg);
}
catch(Exceptione)
{
e.printStackTrace();
}
}
}
198.
198 | Pa g e
Validate.java
package servelet;
import com.hibernate.EcomUser;
import static java.lang.System.out;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class validate
{
public static booleancheckUser(String un,String password)
{
booleanb=false;
try
{
Configuration cfg=newConfiguration();
cfg.configure("hibernate.cfg.xml");
SessionFactorysf=cfg.buildSessionFactory();
Sessions=sf.openSession();
List<EcomUser> l=s.createQuery("from EcomUsereu where
eu.name='"+un+"' and eu.password='"+password+"'").list();
199.
199 | Pa g e
if(l!=null && l.size()>0)
{
return true;
}
s.close();
}
catch(Exceptione)
{
out.print(e);
}
return b;
}
public static String name(long no)
{
EcomUsereu=new EcomUser();
List<EcomUser> ls=new ArrayList<>();
try
{
Configuration cfg=new Configuration();
cfg.configure("hibernate.cfg.xml");
SessionFactorysf=cfg.buildSessionFactory();
Sessions=sf.openSession();
ls=s.createQuery("SELECT E.name from EcomUserE WHERE
E.mobile='"+no+"'").list();
for(EcomUserrow:ls)
{
eu.setName(row.getName());
200.
200 | Pa g e
ls.add(eu);
}
return eu.getName();
}
catch(Exceptione)
{
e.printStackTrace();
}
return eu.getName();
}
}
201.
201 | Pa g e
RESULT
In general, today’s businesses must always strive to create the next best thing that
consumers will want because consumers continue to desire their equal products,
services etc. to continuously be better, faster and cheaper. In this world of new
technology, businesses need to accommodate to the new types of consumer needs
and trends because it will prove to be vital to their business success and survival. E-
Commerce is continuously progressing and is becoming more and more important to
businesses as technology continues to advance and is something that should be
taken advantage of and implemented.
From the inception of the Internet and e-commerce, the possibilities have, become
endless for both businesses and consumers. Creating more opportunities for profit
and advancements for businesses, while creating more options for consumer.
However, just like anything else, e-commerce has its disadvantages including
consumer uncertainties, but nothing that cannot be resolved or avoided by good
decision making and business practices.
There are several factors and variables that need to be considered and decided
upon when starting an e-commerce business. Some of these include: types of e-
commerce, marketing strategies, and countless more. If the correct methods and
practices are followed, a business will prosper in an e-commerce setting with much
success and profitability.
202.
202 | Pa g e
FUTURE SCOPE AND CONCLUSIONS
E-Commerce is here to stay:
Social Media
Majority of online buying decisions are made on social media. Social network
like Facebook, LinkedIn Twitter, Google+, Pinterest etc. have become a
medium for easy log-in and purchase. Moreover, the clients can
Drone Delivery
App Only Approach
Artificial Intelligence
REFRENCES
https://www.w3schools.com/
https://www.wikipedia.org/
https://www.lucidchart.com/
https://stackoverflow.com/