You are on page 1of 87

INDEX: 1.

Organisation Overview
1.1 Clients of NMInfotech 1.2 Description

1. Profile of the problem


2.1 Business Functions Provided In Proposed System

2. Existing System
3.1 Introduction 3.2 Existing Software 3.3Definitions, Acronyms and Abbreviations 3.4 Various Modules in Project 3.5DFD: 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 Context Level DFD Zero Level DFD First Level DFD Second Level DFD Third Level DFD

PROBLEM ANALYSIS
4.1 Product Definition 4.2 Product functions 4.3 User characteristics 4.4 Constraints

5.0 SOFTWARE REQUIREMENT ANALYSIS

5.1Technologies Used 5.2 Software Requirements 5.3 Hardware Requirements 5.4 Feasibility Analysis 5.5 Scope for Future Work 5. 6 Business Functions Provided In Proposed System 5.7 Specific Requirements 5.8 Use-Case Reports 5.9 Supplementary Requirements 5.10Supporting Information 5.11Concerns / Queries / Doubts if any:

6.0 Design
6.1 Use Case model 6.2Architecture diagram 6.3Database design 6.4 E-R Diagram 6.5 Detailed Design 6.5.1Our home page 6.5.2My account JSP 6.5.3 Signup Form 6.5.4Grocery Item Form 6.6Flow Chart

7.0 Testing

7.1 Functional Testing 7.2 Structural Testing 7.3 Levels Of Testing 7.4 Testing The Project

8.0 Implementation
8.1 Implementation 8.2 Implementation of the project 8.3 Conversion Plan 8.4 Post-Implementation and Software Maintenance

9.0 Project Legacy


9.1 Current Status of the project 9.2 Remaining Areas of Concern 9.3 Technical and Managerial Lessons Learnt

10.0 Source Code

11.0 Bibliography

1.1 CLIENTS OF NM INFOTECH

1.2 Description
NM InfoTech is a Product based software company in Mohali. It is a rapidly growing IT company with extensive experience designing and developing cutting edge custom software solutions. The company is promoted by a team of young professionals having vast experience in different domains. Their team members are well qualified and experienced, also having very good recognition in the industry and combine years of experience and providing state-of-the art technology with superior services which provides intelligent, cost effective IT solutions. State-of-the-art offshore software development center is located in Mohali, India. With sustained infrastructure investments over the years, they have created a world class knowledge-networked environment where their employees provide high quality solutions to clients. These investments enhance employee productivity and reduce engagement risk for our clients. To ensure cost-effective, on time delivery of high quality software maintenance and development solutions, they at NM Info tech have a welldeveloped facility, and are always abreast with technology. Their solutions are focused in the technology areas, where they have built their expertise over the past many years. Their Business model captures customer satisfaction as the top priority.

Following are the services offered by NM Info tech:


- Business and Technology consulting - Application Services - Software Development - Software Designing - Website Maintenance - Software Testing

- Application Testing - Game Testing - Performance Testing - Security Solutions - Industrial Training - Corporate Training

1. PROFILE OF THE PROBLEM:


Any person who wants to purchase grocery items requires following resources: Extra time for going to market and purchase grocery items. Dedicated man power for purchasing grocery item in time.Vehicles for purchasing grocery items. In current system user have to make time for purchasing grocery items. Grocery item are those items which are used regularly. Its tough to make time for grocery item regularly. By using new system user can save this extra time. For purchasing grocery item in time a dedicated person is required. If there is no one than its difficult to get grocery item in exact time so its like to be late if we are in hurry. So by using new system there is no need for a dedicated person for purchasing grocery items. We cant get all the grocery items from same palace. So we have needed a vehicle for purchasing grocery item from different palaces. In new system there is no need for any vehicle, all the grocery items are at the same palace by a simple call or email user can get the entire desired grocery item.

2.1 Business Functions Provided In Proposed System


1. 2.
Login: The system users required to login through a login screen. After authentication and login he would be able to access only those areas for which he is capable to access. Registered User Maintenance: A user can himself get registered with the application and also administrator can add new users in application. A registered user is provided with an interface in the application where he can select his grocery item, can buy them and he can check his till now details of purchasing and also update his or her details (personal, professional). Health Guide: Health Guide is a pdf which include information of how to make health better. Public User Maintenance: Public users are those users, thats not authenticated but they can create their account. Public user can see all the grocery items and there prices. Public user can not purchase any product just he can visit. Reports: Reports required by different users will be generated in this section. Administrator can generate report about the different users. The registered users can generate report of the purchased products and there details. Online Purchasing: In this section, a registered user can purchase grocery item by selecting his/her grocery products online. After finishing selection, he/she can click on buy and all the selected items are added in users account and in time these items will be delivered to his/her palace. User can purchase these items by giving his/her account info, by sending case, by DD and etc.

3. 4. 5. 6.

3.0 EXISTING SYSTEM


Grocery Project will be an enterprise application that will provide a web interface for all grocery users to purchase daily usable grocery items. The Various resources provided will be: 1. 2. 3. 4. 5. List of all Grocery items. List of all Grocery items price. Home Delivery Discount Policy Registration For Customers

6. 7. 8. 9. 10.

Sale Tips For New Users Costumers Purchasing Details Health Guide And Easy To Use Interface and more.

3.1 INTRODUCTION
There are large numbers of commercial Online Shopping websites offering large number of products tailored to meet the shopping interests of large number of customers. These online marketplaces have thousands of products listed under various categories. Problem: The basic problems with the existing systems are the non-interactive environment they provide to the users. The use of traditional user interfaces which make continuous post backs to the server; each post back makes a call to the server, gets the response and then refreshes the entire web form to display the result. This scenario adds an extra trade off causing a delay in displaying the results. A search engine that would display the results without allowing the users to further filter the results based on various parameters. Fraud and security concerns:Given the lack of ability to inspect merchandise before purchase, consumers are at higher risk of fraud on the part of the merchant as theres risk of credit cards ids to be stolen. .Phishing is another danger, where consumers are fooled into thinking they are dealing with a reputable retailer, but they dont know that they himself feeding their private information to a system generated by unauthenticated parties. Solution: The motive of this Online Shopping Web Application is to allow the user to play with the search tool and create different combinatorial search criterion to perform exhaustive search. Making the application AJAX enabled gets rid of these unnecessary delays letting the user to perform exhaustive search. The users of this application can easily feel the difference between the Ajax empowered user interfaces vs. traditional user interfaces. Provide Interactive interface through which a user can interact with different areas of application easily. A search engine that provides an easy and convenient way to search for products specific to their needs. The search engine would list a set of products based on the search term and the user can further filter the list based on various parameters. Provide Drag and Drop feature thereby allowing the user to add products to or remove products from the shopping cart by dragging the products in to or out of the shopping cart. We are using Secure Sockets Layer (SSL) encryption has generally solved the problem of credit card numbers being intercepted in transit between the consumer and the retailer.

3.2 Existing Software


The Online Shopping System (OSS) web application is intended to provide complete solutions for vendors as well as customers through a single gateway using the internet as the medium. It will enable vendors to setup online shops, customer to browse through the shop and purchase them online without having to visit the shop physically. The administration module will enable a system administrator to approve and reject requests for new shops and maintain various lists of shop category Initial functional requirements will be: Secure registration and profile management facilities for Customers Browsing through the e-Mall to see the items that are there in each category of products like Apparel, Kitchen accessories, Bath accessories, Food items etc. Adequate searching mechanisms for easy and quick access to particular products and services. Creating a Shopping cart so that customers can shop n no. of items and checkout finally with the entire shopping carts Regular updates to registered customers of the OSS about new arrivals.

Uploading Most Purchased Items in each category of products in the Shop like Apparel, Kitchen accessories, Bath accessories, Food items etc. Strategic data and graphs for Administrators and Shop owners about the items that are popular in each category and age group. Maintaining database of regular customers of different needs. Shop employees are responsible for internal affairs like processing orders, assure home delivery, getting customer's delivery-time feedback, updating order's status and answering client's queries online. Feedback mechanism, so that customers can give feedback for the product or service which they have purchased. Also facility rating of individual products by relevant customers. Also feedback can be given on the performance of particular vendors and the entire mall as well. Adequate payment mechanism and gateway for all popular credit cards, cheques and other relevant payment options, as available from time to time.

For the previous paragraph, depicting the functions of the system, from the perspective of the various users of the system, the following colour codes has been used :

Initial non functional requirements will be: Secure access of confidential data (users details). SSL can be used. 24 X 7 availability Better component design to get better performance at peak time Advertisement space where it will effectively catch the customers attention and as a source of revenue.

In addition to the above mentioned points, due to the highly evolving nature of the project, the following are planned to be delivered if deemed necessary: Warehousing within the very ambits of the project More payment gateways. Dynamic price model by which prices can be changed based on demand and supply Dynamic Storefront: Each customer will have a web page personalized based on his or her recent purchases. This is the equivalent of having a unique storefront for each customer in hopes of drawing in as many return customers as possible.

This list is by no means, a final one. The final list will be dictated by implementation constraints, market forces and most importantly, by end user demands for whom this is being built.

3.3Definitions, Acronyms and Abbreviations


SLA: Service Level Agreement or SLA is a formal written agreement made between two parties, the service provider & the service recipient. It defines the term of engagement - the fundamental rules that will govern the relationship. EJB: Enterprise Java Beans. JAVA EE:Java Enterprise Edition 5 is a programming platform part of the Java Platform-for developing and running distributed multi-tier architecture Java applications, based largely on modular software components running on an application server. HTTP: Hypertext Transfer Protocol is a transaction oriented client/server protocol between a web browser & a Web Server.

HTTPS:Secure Hypertext Transfer Protocol is a HTTP over SSL (secure socket layer). TCP/IP:Transmission Control Protocol/Internet Protocol, the suite of communication protocols used to connect hosts on the Internet. TCP/IP uses several protocols, the two main ones being TCP and IP.

3.4Various Modules in Project


a) Admin Module: This module is the central module of this application. This module provide user interface for the admin users to get all the information about the system and also for configuring the system with any required information. These users have all the rights for insertion, updating, deletion and etc. b) Registered User Information System: This module will provide maintenance of the users and their information according to their rights. c) Online Purchasing: This module will provide maintenance of online purchasing. This is the main module of this system. In this module all the ways of purchasing are maintained. d) Reports: In this module all the reports are generated in pdf format. These reports are viewed by admin, authenticated users, and stock maintainer. e) Stock Maintainer: The rest of this SRS is organized as follows: Section 2 gives an overall description of the software. It gives what level of proficiency is expected of the user, some general constraints while making the software and some assumptions and dependencies that are assumed. Section 3 gives specific requirements which the software is expected to deliver. Functional requirements are given by various use cases. Some performance requirements and design constraints are also given.

3.5DFD 3.5.1 CONTEXT LEVEL DFD:

3.5.2

Zero Level DFD

3.5.3

First Level DFD

3.5.4 Second Level DFD

3.5.5

Third Level DFD

PROBLEM ANALYSIS
4.1 Product Definition

OSS is aimed towards the vendors who want to reach out to the maximum cross-section of customer and common people who can be potential customer.This project envisages bridging the gap between the seller, the retailer and the customer. OSS should be user-friendly, quick to learn and reliable software for the above purpose. OSS is intended to be a stand-alone product and should not depend on the availability of other software. It should run on both UNIX and Windows based platform.

4.2 Product functions


User: System Administrator Functions: The Administrator is the super user and has complete control over all the activities that can be performed. The application notifies the administrator of all shop creation requests, and the administrator can then approve or reject them. The administrator also manages the list of available product categories. The administrator can also view and delete entries in the guestbook. User: Shop Owner Functions: Any user can submit a shop creation request through the application. When the request is approved by the Administrator, the requester is notified, and from there on is given the role of Shop Owner. The Shop Owner is responsible for setting up the shop and maintaining it. The job involves managing the sub-categories of the items in the shop. Also, the shop owner can add or remove items from his shop. The Shop Owner can view different reports that give details of the sales and orders specific to his shop. The Shop Owner can also decide to close shop and remove it from the mall. User: Customer/Guests Functions: A Customer can browse through the shops and choose products to place in a virtual shopping cart. The shopping cart details can be viewed and items can be removed from the cart. To proceed with the purchase, the customer is prompted to login. Also, the customer can modify personal profile information (such as phone number and shipping address) stored by the application. The customer can also view the status of any previous orders, and cancel any order that has not been shipped yet. User: Employees Functions: Purchase department under a Purchase manager to overlook purchasing activities if warehousing needs arise. Functions: Sales department under a Sales manager who will look after the sale of products and services, the most important activity. Functions: Accounts department under an Accounts manager to look after the accounting activities of the enterprise

4.1 User characteristics


The user should be familiar with the Shopping Mall related terminology like Shopping cart/Checking out/Transaction etc. The user should be familiar with the Internet.

4.1 Constraints
There is no maintainability of back up so availability will get affected.

Limited to HTTP/HTTPS. Real-life credit card validation and Banking system is not implemented.

5.0 SOFTWARE REQUIREMENT ANALYSIS


5.1Technologies Used JAVA
JAVA is Platform Independent, Secure, Object Oriented, Scalable and Robust Programming Language. It consists of two parts 1.JDBC JDBC (Java Database Connectivity) is an API, which is used for the communication of java programs with different databases. 2.Java Mail API The Java Mail API provides a platform-independent and protocol-independent framework to build mail and messaging applications. 3.Servlets Servlets are basically a part of Java Platform, Enterprise Edition (Java EE) and is a technology that is used for extending the functionality of the servers that host application access via request-response programming model. 4.JSP JSP (Java Server Pages) a technology of Java Platform, Enterprise Edition (Java EE) is used for server-side programming and with the help of JSP we can segregate the work of a web designer and a developer. 5.Web Services Web services are Web based applications that use open, XML-based standards and transport protocols to exchange data with clients. Web services are developed using Java Technology APIs and tools provided by an integrated Web Services Stack which is available with Glassfish. 6.Scripting Language HTML & CSS JavaScript XML,XHTML JVM stands for Java Virtual Machine, which is run time environment to execute the java programs. Java API (Application Programming Interface) that consists of inbuilt classes used in java programs.

AJAX UML

7.SQL Server 2005 SQL Server 2005 is used as databse, used to store data. It is RDBMS. 8.Tools & Development Environment Apache Tomcat 6.0.18 Server: Apache Tomcat is a Servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a "pure Java" HTTP web server environment for Java code to run. NetBeans : It is a toolkit which is designed for the creation of complex projects, providing fully dynamic web application utilizing EJBs.

5.2 Software Requirements


JDK 1.6 NetBeans 6.9.1

J2ME Sun Java Wireless Toolkit 2.5.2

Database SQL Server 2005

Web Server Tomcat 6.0.18

Application Server Glassfish v2.1

Testing Tool JUnit 4.5

Operating System Windows Vista / XP sp3/Windows 7

5.3 Hardware Requirements


Intel P4 processor with minimum 2.0Ghz Speed RAM: Minimum 512MB Hard Disk: Minimum 20GB

5.4 Feasibility Analysis


The system feasibility can be divided into the following sections: 5.1 Economic Feasibility The project is economically feasible as the only cost involved is having a computer with the minimum requirements mentioned earlier. For the users to access the application, the only cost involved will be in getting access to the Internet. 5.2 Technical Feasibility To deploy the application, the only technical aspects needed are mentioned below: Operating Environment: Win 2000/XP/Linux/ Plat form : Net Beans Framework Database SQL Server 2005 For Users: Internet Browser and Internet Connection 5.3 Behavioral Feasibility The application requires no special technical guidance and all the views available in the application are self explanatory. The users are well guided with warning and failure messages for all the actions taken.

5.5 Scope for Future Work


The following things can be done in future. The current system can be extended to allow the users to create accounts and save products in to wish list. The users could subscribe for price alerts which would enable them to receive messages when price for products fall below a particular level. The current system is confined only to the shopping cart process. It can be extended to have an easy to use check out process. Users can have multiple shipping and billing information saved. During checkout they can use the drag and drop feature to select shipping and billing information.

5.7 Specific Requirements


[This section of the SRS should contain all the software requirements to a level of detail sufficient to enable designers to design a system to satisfy those requirements, and testers to test that the system satisfies those requirements. When using use-case modeling, these requirements are captured in the use cases and the applicable supplementary specifications. If use-case modeling is not used, the outline for supplementary specifications may be inserted directly into this section.]

5.8 Use-Case Reports


[In use-case modeling, the use cases often define the majority of the functional requirements of the system, along with some non-functional requirements. For each use case in the above use-case model or subset thereof, refer to or enclose the use-case report in this section. Make sure that each requirement is clearly labeled.]

5.9 Supplementary Requirements


[Supplementary Specifications capture requirements that are not included in the use cases. The specific requirements from the Supplementary Specifications which are applicable to this subsystem or feature should be included here, refined to the necessary level of detail to describe this subsystem or feature. These may be captured directly in this document or refer to separate Supplementary Specifications, which may be used as an enclosure at this point. Make sure that each requirement is clearly labeled.]

5.10Supporting Information
[The supporting information makes the SRS easier to use. It includes: a) Table of contents, b) Index, c) Appendices. These may include use-case storyboards or user-interface prototypes. When appendices are included, the SRS should explicitly state whether or not the appendices are to be considered part of the requirements.]

5.11Concerns / Queries / Doubts if any:


[You can put in your question and doubts from your project, technologies that you use. These queries will be answered and will be put up in the discussion forum. Any specific project related queries will be answered sent individually to the teams]

6.0 DESIGNING:

The design of the web application involves the design of the forms for listing the products, search for products, display the complete specification for the product, and design a shopping cart that is easy to use. Design of an interactive application that enables the user to filter the products based on different Design of an application that has features like drag and drop etc. Design of application that decreases data transfers between the client and the server. parameters.

6.1 Use-Case Model Survey

1: Use case diagram for Customer & Visitor.

Figure 2: Use case diagram for Shop owner.

Figure 3: Use case diagram for Employees.

Use case diagram for Administrator.

Given below is an overall picture of the system, as depicted in the above use-case diagrams:

1. Administrator: Database Management: Control the database and keep track of all records of customers and employee details. Contact and Giving Permission to Vendors: Contact with the vendors and give permission to sell their product under the site after 1.
testing the products quality. View all details: View the details of all employees and control the whole site. Advertising the Site: Responsible for making advertisements for the site.

Customers: Login: Customers must have a valid login id to enter into the site. Registration: New users can sign up by creating new ID. View and edit Own Details: Can view/edit his personal details, payment details, anddetails about services provided. Choosing and comparing products: Can view all available products and can compare them and make a choice for purchasing products. Purchasing: Can purchase any product through valid credit card. Giving Feedback to Customer Care: Can give feedback to the 24X7 Customer Care Service center about their impression for the site and services. Logout: Customer must logoutof the site after purchasing products.

1. Visitors: Visiting the Site: Can only visit the site without registration. Register : New users can sign up by creating new ID.

1. ShopOwner:

Taking Permission from Administrator: Vendors must take permission from the Administrator for selling their products under the site. Administrator will test products quality according to its market price to permit vendor for selling purpose. Consulting with Administrator: Can consult with the Administrator regarding products quality and advertisements. Advertising Vendors Own Products: Responsible for making advertisements of his products, but the site will not be responsible for any kind of advertisements about products.

1. Sales Manager: View customer details: View the personal details of the customer.
Managing Sales to Customers: Responsible for properly allocating the selected product according to the customers choice and delivering product to the customer. View Product Stocks: Keep track of each product items stocks for selling purpose. Contacting with Administrator: Responsible for informing administrator when any product items stock goes under the minimum level.

1. Purchase Manager: Consulting with Administrator: Taking permission from the Administrator for the product to be purchased from vendor. Product Stock Management: Responsible for managing stocks of each product items. 1. Accounts Manager:
Regulating Payments: Keep track of all the payment transactions made by the customers and update the payment information. Consulting with Banks: Responsible for contacting the banks for the validation of the a/c number provided by the customer while purchasing and make the transaction from the given a/c. Consulting with Administrator: Consult with the Administrator about the payment details of the customers for the updating of the database.

1. Customer Care: Getting Feedback from the Customers: Responsible for receiving complaints, queries and feedback from the customers. Providing Solutions to Customers: Provide feasible solutions to the customers on their complaints and queries.

6.2Architecture diagram

6.3Database design

6.4 E-R Diagram:

6.5Detailed Design
The user interface of the application has been designed using NetBeans 6.9. The main controls used in the design are Repeaters, Ajax Update panels, Ajax toolkit controls like modal popup and Auto complete controls. The user can see the list of products that are available. The user can search for products by entering the search term into the search textbox provided on the top. The user can filter the products by using the dropdown lists

A) OUR HOME PAGE

B )MY ACCOUNT JSP

C) SIGN UP FORM JSP

D) GROCERY ITEM FORMS

5.11Flow Chart

7. Testing 7.1 Testing Measurement Requirement Regarding testing:The requirement for the application testing is as follows: Test Guidelines Integration Strategy Special Considerations Test Documents

The development of software system involves a series of production activities where opportunities for human fallibility are enormous. Errors may begin to occur at every inception of the4 process where the objectives may be erroneously or imperfectly specified as well as later design and development states. Because of human inability to perform and communicate with perfection, software development is accompanied by quality assurance activity. Software testing is a critical element of software quality assurance and represents the ultimate reviews of specification design and coding. The increasing visibility of software as a system element and attendant cost associated with a software failure is motivating forces for well planned, thorough testing. 7.1.1 Testing Objectives: A number of rules that can serve well as testing objectives: Testing is a process of executing a program with the intent of finding an as yet undiscovered error. A successful test is one that uncovers a yet undiscovered error. 7.1.2 Test case Design: The design of tests can be as challenging as the initial design of the project itself. Testing design tests that have the highest likelihood of finding the most errors with a minimum amount of time and effort. Any software product can be tested in any of the two ways: Knowing the specific function that a product has been designed to perform, test can be conducted that demonstrate each function is fully operational.

1.

Knowing the internal working of a product. Test can be conducted to ensure that the internal operation of product performs according to specification and all internal components have been adequately exercised.

The first step is called the white box testing and the second black box testing. Test cases are design to answer the following questions: How is functional validity tested? What classes of input will make good test cases? Is the system particularly sensitive to certain input values? How are the boundaries of a data class isolated? What data rates and data volumes can the system tolerate? What effect will specific combinations of data have on system operation? 7.2 FUNCTIONAL TESTING Testing Procedure: Testing plays a critical role in quality assurance of the software testing is a dynamic method for verification and validation. With the help of testing we observe the failure of the system in terms of logical and runtime errors. The testing process can deduce the presence of fault in the system; however activities have to be performed to identify the faults. As the foal of testing is to detect any errors in the programs, different flavor of testing are often used. Unit testing are used to test a module or a small collection of modules and the focus is on detecting coding errors in modules. During integration testing modules re combined into sub system, which are ten tested. The foal here is to test the system design. In system testing and acceptance testing, the entire system is tested the foal here is to test the fulfillment of the requirement. Structural testing can be used for unit testing while at higher level mostly functional testing is used. The primary objective for test case design is to derive a set of test that has the highest likelihood for uncovering errors in the software. To accomplish this objective, two different categories of test case design techniques are used White box testing and black box testing. White box test focuses on the program control structure. Test cases are derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Basis path testing. A white box technique makes use of program graphs (or graph matrices) to derive the set of linearly independent test that will ensure coverage. Condition and data flow testing further exercise loops of varying degrees of complexity. Black box tests are designed to uncover errors functional requirements without regard to the internal workings of a program. Black box testing techniques focus on the output domain of a program in a manner that provides thorough test coverage. The black box test are used to demonstrate that software functions are

operational, that input is properly accepted and output is properly produced, and that the integrity of external information data file) is maintained A black box test examines some fundamental aspect of a system with little or no regard of the integral logical structure of the software. Graph based testing methods explore the relationships between and behavior of program likely to exercise specific software function. Boundary value analysis probes the programs ability to handle data at the limits of acceptability.

7.3Levels of testing
A software testing strategy: 7.3.1 Unit Testing: Unit testing focus verification effort on the smallest unit of software designs the module. The unit test is always White-Box oriented and the step can be conducted in parallel for Multiple modules. In our modules, different testing at module level is shown above in test reports. 7.3.2 Integration Testing: Integration testing address the issues associated with the dual problem of the

verification and program construction. Black box test case design techniques are the most prevalent during integration, although a limited amount of white box testing may be used to ensure coverage of major control paths. 7.3.3 Validation Testing: Validation testing provides the final assurance that software meets all functional

behavioral and performance requirement Black box testing techniques are user exclusively during validation testing is performed in terms of efficiency of coding and in terms of checking weather particular application is meeting its requirement. 7.3.4 System Testing: Once satisfied with all the modules work well in themselves and there are no problems. Then go in to see how the system will work or perform once all the modules are put together. The main types of system testing are: Peak load Testing: It determines whether the system will handle the volume of activities that occur when the system is at the peak of its processing demand. Storage Testing:

It determines the capacity of the system uses to process transaction generate report.

Recovery Testing: It determines the ability of the system to recover data or restart after failure

Procedure Testing: It determines the clarity of the documentation on operation and use of system.

Human Factor Testing: This test determines how the user would use the system when processing data and preparing reports. As this system provides readability and user friendliness, the screen is never left blank.

System testing system testing tests the flow of data through the entire system. Data flows from the table were checked. This also includes the preparation of test, checking the entire system with this data to see if all the requirements are met and the system performs as specified by the requirements. The system being developed will follow bottom up approach of testing where each functional unit will be independently tested and then integrating testing of the module or sub module will be done. 7.3.5 Level 1-> Testing (Alpha Testing):

At this level a test data is prepared for testing. Project leaders test the system on this test a data keeping following point in consideration. Proper Error handling.

Exit points in code Exception handling. Input/Output format.

If the system is with testing phase at level 1, than it is passed on to level 2. Level 2-> Testing (Beta Testing): Here the testing is time on the live database. If errors are not corrected it is send back to level 1 for modification otherwise it is passed at level 3. Level 3-> Here the error free and properly tested system is implemented.

Standard Software Development vs. Integrated Testing: In normal software development mythologies, testing doesnt begin until after code is constructed. It a defect is found after coding, there is a good deal of scrap and rework to correct the code, and possibly the design, test cases and requirements as well. Defects must be tested out of the system, rather than being avoided in the first place. But in the other case as testing begins at the requirements as well. Defects are avoided instead of being tested out of the code. This is a less costly and timelier approach. User manuals and training materials can be developed sooner. The entire software development lifecycle is compressed. Testing is performed in parallel with development instead of the end. 7.4 Testing the project 7.4.1 TESTING PRINCIPLES Before applying methods to design effective test cases, we must understand the basic principles that hide software testing Al tests should be traceable to customer requirements, as we have seen the objective of the software testing is to uncover errors. It follows that the most sever defects (from the customers point of vies) are those that cause the program to fail to meet its requirements. The pair to principle applies to software testing. Stated simply, the pair to principle implies that 80 percent of all errors uncovered during testing will likely be traceable to 20 percent of all program modules and to thoroughly test them. Testing should begin in small and progress toward testing in large. The first test planned and executed generally focus in an attempt to find errors in integrated clusters of modules and ultimately in the entire system. Exhaustive testing is not possible. The number of path permutations for even a moderately sized program is exceptionally large. For this reason, it is impossible to execute every combination of paths during testing. It is impossible; however to adequately cover program logic and to ensure that all conditions in the procedural design have been exercised. To be most effective, testing should be conducted by an independent third party by most effective; we mean testing that has the highest probability of finding errors (the primary objective of testing) for reasons; the software engineer who created the system is not the best person to conduct all tests for the software. Experienced software developers often say testing never ends it just gets transferred from you (the software engineer) to your customer. Every time your customer uses the program, a test is being conducted. By applying test case design, the software engineer can achieve more complete testing and thereby uncover and correct the highest number of errors before the customer tests begin.

7.4.2 Testing Strategies: A software testing strategy provides a road map for the software developer. The quality assurance organization, and the customer a road map that describe the steps to be conducted as part of testing. Any testing strategy must incorporate test planning. Test case design. Test resultant data collection and evaluation. A strategic approach to software testing: A number of software testing strategies have been proposed in the literature all provides the software developer with a template for testing and all have the following generic characteristics. Testing begins at the module level and works outward toward the integration of the entire computer based system. Different testing technique is appropriate at different point in time. Testing conducted by the developer of the software and (for large project) an independent test group. Testing and debugging are different activities but debugging must be accommodated in any test strategy.

STRUCTURAL TESTING-: Structural testing is white box testing, not black box testing, since black boxes are considered opaque and do not permit visibility into the code. Structural testing is also known as clear box testing, also known as glass box testing. Structural testing is a way to test software with knowledge of the internal workings of the code being tested. In penetration testing, white-box testing refers to a methodology where an ethical hacker has full knowledge of the system being attacked. The goal of a white-box penetration test is to simulate a malicious insider who has some knowledge and possibly basic credentials to the target system.

1. Implementation Implementation of the project Conversion Plan Post-Implementation and Software Maintenance 9.0 Project Legacy

9.1 Current Status Of Project:-

According to my survey ,initially all the tasks related to training & examination were conducted manually but now with the help of this application all such work will be done automatically because here we are providing online application for doing such operations. Here in this application we have used online pdf tutorials, video tutorials & also audio tapes for providing training to medical representatives. After pursuing training medical representative can appear for the examination for any promotion.

9.2 Remaining areas of concern: validations on some pages Web-Services for login through sms Live chat with concerned buyer and seller representative. Authentication of user through mobiles(Picture Recognition)

9.3 Technical & Managerial lessons learnt


Team Coordination ,Task Assignment among group members Proper resource management Solving problems while implementing innovative ideas Integration of various new technologies

1. User Manual: A complete document (Help Guide) of the software developed.

1.

1. Source Code

2. Shown Below Demo of Each Technology (Source Code )used to develop the software
Code of JSP pages

3. <%-4. 5. 6. 8. 9. <%@page contentType="text/html" pageEncoding="UTF-8"%> 10. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 11. 12. 13. <html> 14. <head> "http://www.w3.org/TR/html4/loose.dtd"> Document : AddProducts Created on : Oct 14, 2010, 3:02:33 PM Author : Administrator

7. --%>

15. 16. 17. 18. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36.

<%@include file="headteg.jsp" %> </head> <body> <%@include file="header.jsp" %> <%@include file="leftpanel.jsp"%> <div id="midPannel"> <%@include file="flash.jsp" %> <div id="content"> <h4></h4> <form method="get" action="AddProductServlet" > <% String cn=request.getParameter("cn"); String cid=request.getParameter("cid"); %> <table border="0" align="center" width="680px"> <tr><th align="center" style="color: #ffcc66" colspan="2">ADD PRODUCTS</th></tr> <tr><td colspan="2"><hr></td></tr> <tr> <td style="color: #ffcc66">Category_name</td> <td style="color: black"><%=cn%></td> <td colspan="2"><input type="hidden" name="txtCid" value="<%=cid%>" /></td> <td><input type="hidden" name="txtProduct_Id" value="" /></td> <td><input type="hidden" name="txtCat" value="<%=cn%>" /></td> </tr> <tr> <td>Product_Name</td>

19. <div id="main">

37. 38. 39. 40. 41.

42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53.

<td> <input type="text" name="txtProduct_Name" value="" /></td> </tr> <tr> <td>Product_Description</td> <td><input type="text" name="txtDescription" value="" /></td> </tr> <tr> <td>Product_Image</td> <td><input type="text" name="txtImage" value="" /></td> </tr> <tr> <td align="center"><input type="submit" name="sbtnaddproduct" value="ADD" /></td> <td align="center"><input type="reset" value="CANCEL" name="rscancel" onclick="window.location(back(-1))"/></td> </tr> </table> </form> </div> </div> <%@include file="rightpanel.jsp" %> <div id="fake_footer"></div>

54. 55. 56. 57. 58. 59. 60. 61. 62. 63. </div> 64.

<%@include file="footer.jsp" %>

65. </body> 66. </html>


67. Code of Addproductservlet.java

68. 69. package Servlet; 70. 71. import java.io.IOException; 72. import java.io.PrintWriter; 73. import javax.servlet.ServletException; 74. import javax.servlet.http.HttpServlet; 75. import javax.servlet.http.HttpServletRequest; 76. import javax.servlet.http.HttpServletResponse; 77. import datalayer.registereduser.DBOperation; 78. 79. /** 80. * 81. * @author Administrator 82. */ 83. public class AddProductServlet extends HttpServlet { 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8");

95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123.

PrintWriter out = response.getWriter(); try { if(request.getParameter("sbtnaddproduct")!=null) { String cn=request.getParameter("txtCat"); String cid=request.getParameter("txtCid"); String pd=request.getParameter("txtProduct_Id"); String pn =request.getParameter("txtProduct_Name"); String desc=request.getParameter("txtDescription"); String img=request.getParameter("txtImage"); DBOperation dbobj=new DBOperation(); dbobj.insertprod(pd,pn,desc,img,cid); response.sendRedirect("Products.jsp?cn="+cn+"&cid="+cid); } else if(request.getParameter("sbtneditproduct")!=null) { String sid=request.getParameter("txtSid"); String cn=request.getParameter("txtCn"); String cid=request.getParameter("txtCid"); String pd=request.getParameter("txtEditPd"); String pn=request.getParameter("txtEditPn"); String desc=request.getParameter("txtEditDesc"); String img=request.getParameter("txtEditImage"); DBOperation dbobj=new DBOperation(); dbobj.updateProduct(pd, pn, desc, img); //dbobj.updateStock(pd,bno,rt,expiry,qtyleft,wt,sid); response.sendRedirect("Products.jsp?cn="+cn+"&cid="+cid); }

124. 125. 126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. } }

} finally { out.close(); }

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign /** * Handles the HTTP <code>GET</code> method. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response);

on the left to edit the code.">

/** * Handles the HTTP <code>POST</code> method. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override

152. 153. 154. 155. 156. 157. 158. 159. 160. 161. 162. 163. 164. 165. 166.}

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold>

167.Code of StockBean------Bean Class used in the project

168./* 169. * To change this template, choose Tools | Templates 170. * and open the template in the editor. 171. */ 172. 173.package bean.common; 174./** 175. * 176. * @author Administrator 177. */ 178.public class StockBean { 179. private String batch_no,rate,expiry,quantityleft,weight,stockid;

180. 181. 182. 183. 184. 185. 186. 187. 188. 189. 190. 191. 192. 193. 194. 195. 196. 197. 198. 199. 200. 201. 202. 203. 204. 205. 206. 207. 208. } public void setWeight(String wt){ this.weight=wt; } public String getQuantityLeft(){ return quantityleft; } public void setQuantityLeft(String qtyleft){ this.quantityleft=qtyleft; } public String getExpiry(){ return expiry; } public void setExpiry(String exp){ this.expiry=exp; } public String getRate(){ return rate; } public void setRate(String rt){ this.rate=rt; } public String getBatchNo(){ return batch_no; public StockBean() { } public void setBatchNo(String bno){ this.batch_no=bno;

209. 210. 211. 212. 213. 214. 215. 216. 217. 218. 219. 220.} 221.

} public String getWeight(){ return weight; } public void setStockId(String stockid){ this.stockid=stockid; } public String getStockId(){ return stockid; }

222.Code of DBConnection-----JDBC Connectivity

223./* 224. * To change this template, choose Tools | Templates 225. * and open the template in the editor. 226. */ 227. 228.package datalayer.common; 229.import java.sql.Connection; 230.import java.sql.DriverManager; 231./** 232. * 233. * @author nm 234. */ 235.public class DBConnection { 236. static Connection conn;

237. public static Connection connectDB(){ 238. 239. 240. 241. 242. 243. 244. 245. 246. 247. 248.} 249./* 250. * To change this template, choose Tools | Templates 251. * and open the template in the editor.
252. */
253.Codeof DB Operation

try{ Class.forName("com.mysql.jdbc.Driver"); conn=DriverManager.getConnection("jdbc:mysql:///grocery","root","root"); System.out.println("Connection created....."); } catch(Exception e){ System.out.println("Exception in DBConnection } return conn; } :"+e);

254.package datalayer.registereduser; 255.//import com.mysql.jdbc.Statement; 256.import datalayer.common.DBConnection; 257.import java.sql.Connection; 258.import java.sql.PreparedStatement; 259.import java.sql.ResultSet; 260.import java.sql.Statement; 261.import bean.common.BeanDemo; 262.import bean.common.BeanProducts; 263.import bean.common.FeedbackBean; 264.import bean.common.OrderHistoryBean;

265.import bean.common.OrderRecordBean; 266.import bean.common.WishListBean; 267.import java.util.ArrayList; 268.import java.sql.Date; 269.import java.util.HashMap; 270.import java.util.List; 271.import java.util.Map; 272./** 273. * 274. * @author Administrator 275. */ 276.public class DBOperation { 277. 278. 279. 280. 281. 282. 283. 284. 285. 286. 287. 288. 289. 290. 291. 292. 293. Connection conn; PreparedStatement pstmt,pstmt1; Statement stmt; ResultSet rs,rs1; BeanDemo bnobj; BeanProducts bnpobj; ArrayList al,alstk; public ArrayList selectcat() { try { conn=DBConnection.connectDB(); pstmt=conn.prepareStatement("select * from product_category"); System.out.println("Items Seleted From Product_Category table"); rs=pstmt.executeQuery(); al=new ArrayList(); while(rs.next())

294. 295. 296. 297. 298. 299. 300. 301. 302. 303. 304. 305. 306. 307. 308. 309. 310. 311. 312. 313. 314. 315. 316. 317. 318. 319. 320. 321. } } }

{ bnobj=new BeanDemo(); System.out.println("category id"+rs.getString("category_id")); bnobj.setcategory_id(rs.getString("category_id")); bnobj.setcategory_name(rs.getString("category_name")); bnobj.setcategory_description(rs.getString("category_description")); bnobj.setparent_category(rs.getString("parent_category")); al.add(bnobj); } catch(Exception e) { System.out.print("Exception in selectCat: return al; public ArrayList selectproducts(String cid){ try{ conn=DBConnection.connectDB(); pstmt=conn.prepareStatement("select * from product_master where System.out.println("Items Selected from Product_master table "); rs=pstmt.executeQuery(); al=new ArrayList(); while(rs.next()){ bnpobj=new BeanProducts(); bnpobj.setproduct_id(rs.getString("product_id")); bnpobj.setproduct_name(rs.getString("product_name")); bnpobj.setproduct_description(rs.getString("product_description")); "+e);

category_id='"+cid+"';");

322. 323. 324. 325. 326. 327. 328. 329. 330. 331. 332. 333. 334. 335. 336. 337. 338. 339. 340. 341. 342. 343. 344. 345. 346. 347. 348. 349. } } } }

bnpobj.setproduct_image(rs.getString("product_image")); al.add(bnpobj);

catch(Exception e){ System.out.print("Exception in selectProducts: return al; public ArrayList viewStock(String pd){ try{ conn=DBConnection.connectDB(); pstmt=conn.prepareStatement("select * from product_master,product_stock where System.out.println("Items Selected from Product_master and product_stock table "); rs=pstmt.executeQuery(); al=new ArrayList(); System.out.println("product_id in viewStock() while(rs.next()){ bnpobj=new BeanProducts(); bnpobj.setproduct_id(rs.getString("product_id")); bnpobj.setproduct_name(rs.getString("product_name")); bnpobj.setproduct_description(rs.getString("product_description")); bnpobj.setproduct_image(rs.getString("product_image")); bnpobj.setRate(rs.getInt("rate")); bnpobj.setWeight(rs.getString("weight")); bnpobj.setBatch_no(rs.getString("batch_no")); bnpobj.setQuantityleft(rs.getString("quantity_left")); bnpobj.setStockid(rs.getString("stock_id")); "+pd); "+e);

product_stock.product_id="+pd+"=product_master.product_id;");

350. 351. 352. 353. 354. 355. 356. 357. 358. 359. 360. 361. 362. 363. 364. 365. 366. 367. 368. 369. 370. 371. 372. 373. 374. 375. 376. 377. 378. } } } }

System.out.println("rs.getString value System.out.println("bnpobj of stock_id al.add(bnpobj);

:"+rs.getString("stock_id")); "+bnpobj.getStockid());

catch(Exception e){ System.out.print("Exception in selectProducts: return al; public boolean authenticateUser(String uname,String pwd,String type){ String uname1,pwd1,type1; try{ conn=DBConnection.connectDB(); stmt=conn.createStatement(); rs=stmt.executeQuery("Select * from user_master"); while(rs.next()){ uname1=rs.getString("user_id"); pwd1=rs.getString("password"); type1=rs.getString("type"); if(uname1.equals(uname)){ if (pwd1.equals(pwd)){ if(type1.equals(type)){ System.out.println("User Match Successfully with Database return true; } } } :"); "+e);

379. 380. 381. 382. 383. 384. 385. 386. 387. 388. 389. 390. 391. 392. 393. 394. 395. 396. 397. 398. 399. 400. 401. 402. 403. 404. 405. } } }

} return false; catch(Exception e){ System.out.println("Exception in authenticateUser : return false; "+e);

public ArrayList selectStock(String cid){ try{ conn=DBConnection.connectDB(); pstmt=conn.prepareStatement("select * from product_master where System.out.println("Products Selected from Product master table "); rs=pstmt.executeQuery(); al=new ArrayList(); while(rs.next()){ // System.out.println("product_id : "+rs.getString("product_id")); System.out.println("product_name : "+rs.getString("product_name")); bnpobj=new BeanProducts(); bnpobj.setproduct_id(rs.getString("product_id")); bnpobj.setproduct_name(rs.getString("product_name")); bnpobj.setproduct_image(rs.getString("product_image")); pstmt1=conn.prepareStatement("select * from product_stock where System.out.println("Products Selected From Stock table: "); rs1=pstmt1.executeQuery(); HashMap hmap=new HashMap();

category_id="+cid+";");

product_id="+bnpobj.getproduct_id()+";");

406. 407. 408. 409. 410. 411. 412. 413. 414. 415. 416. 417. 418. 419. 420. 421. 422. 423. 424. 425. 426. 427. 428. 429. 430. 431. 432. 433. } } } }

ArrayList alrt=new ArrayList(); while (rs1.next()) { // System.out.println("Batch_no: // System.out.println("Weight: "+rs1.getString("batch_no")); "+rs1.getString("weight"));

bnpobj.setBatch_no(rs1.getString("batch_no")); bnpobj.setWeight(rs1.getString("weight")); bnpobj.setQuantityleft(rs1.getString("quantity_left")); bnpobj.setExpiry(rs1.getString("expiry_date")); bnpobj.setRate(rs1.getInt("rate")); hmap.put(bnpobj.getBatch_no(), bnpobj.getWeight()); alrt.add(rs1.getString("rate")); bnpobj.setAlrt(alrt); } bnpobj.setHmap(hmap); al.add(bnpobj);

catch(Exception e){ System.out.println("Exception in selectStock() : return al; public int getRate(int batchNo) { conn=DBConnection.connectDB(); try { pstmt=conn.prepareStatement( "select rate from product_stock where batch_no = System.out.println(batchNo); rs = pstmt.executeQuery(); "+e);

"+ batchNo+ ";");

434. 435. 436. 437. 438. 439. 440. 441. 442. 443. 444. 445. 446. 447. 448. 449. 450. 451. 452. 453. 454. 455. 456. 457. 458. 459. 460. 461. } } } }

while(rs.next()) { return rs.getInt(1); } } catch (Exception e) { System.out.println("Exception in getRate return 0; public int getWeight(int batchNo) { conn=DBConnection.connectDB(); try { pstmt=conn.prepareStatement( "select weight from product_stock where batch_no System.out.println(batchNo); rs = pstmt.executeQuery(); while(rs.next()) { return rs.getInt(1); } } catch (Exception e) { System.out.println("Exception in getRate return 0; "+e); "+e);

= "+ batchNo+ ";");

public ArrayList shoppingCartProducts(int pd) { try { conn=DBConnection.connectDB();

462. 463. 464. 465. 466. 467. 468. 469. 470. 471. 472. 473. 474. 475. 476. 477. 478. 479. 480. 481. 482. 483. 484. 485. 486. 487. 488. 489. }

System.out.println("Product_id: "+pd); pstmt=conn.prepareStatement("select * from product_master where System.out.println("Shopping Cart Process "); rs=pstmt.executeQuery(); System.out.println("execute query00000000000000000"); al=new ArrayList(); while(rs.next()) { System.out.println("Product_id: "+rs.getString("product_id")); bnpobj=new BeanProducts(); bnpobj.setproduct_id(rs.getString("product_id")); bnpobj.setproduct_name(rs.getString("product_name")); bnpobj.setproduct_description(rs.getString("product_description")); bnpobj.setproduct_image(rs.getString("product_image")); al.add(bnpobj); } } catch(Exception e) { System.out.print("Exception in shoppingCartProducts: } return al; public void insertcat(String catid,String cn,String desc,String parentcat) { try { conn=DBConnection.connectDB(); "+e);

product_id='"+pd+"';");

490. 491.

stmt=(Statement) conn.createStatement(); in tn=stmt.executeUpdate("insert into product_category

(category_name,category_description,parent_category) values('"+cn+"','"+desc+"',"+parentcat+");"); 492. 493. 494. 495. 496. 497. 498. 499. 500. 501. 502. 503. 504. 505. 506. } public void updatecat(String cn,String newcn,String desc,String parentcat) { try { conn=DBConnection.connectDB(); stmt=(Statement) conn.createStatement(); //System.out.println("method "+cn+" "+newcn+" "+desc+" "+parentcat); int n=stmt.executeUpdate("update product_category set } } catch(Exception e) { System.out.print("Exception in insertCat: "+e); System.out.println("Total Categories added are: "+n);

category_name='"+newcn+"',category_description='"+desc+"',parent_category="+parentca t+" where category_name='"+cn+"';"); 507. 508. 509. 510. 511. 512. 513. 514. } } } catch(Exception e) { System.out.print("Exception in updateCat: "+e); System.out.println("Total categories updated are: "+n);

515. 516. 517. 518. 519. 520. 521. { try {

public void updateStock(String bno,String rt,String wt,String qtyleft,String

expiry,String sid)

conn=DBConnection.connectDB(); stmt=(Statement) conn.createStatement(); int n=stmt.executeUpdate("update product_stock set

batch_no="+bno+",rate="+rt+",weight="+wt+",expiry_date="+expiry+",quantity_left="+q tyleft+" where stock_id="+sid+";"); 522. 523. 524. 525. 526. 527. 528. 529. 530. 531. 532. 533. 534. 535. product_id='"+pd+"';"); 536. 537. 538. } catch(Exception e) System.out.println("Total Products updated are: "+n); } public void updateProduct(String pd,String pn,String desc,String img) { try { conn=DBConnection.connectDB(); stmt=(Statement) conn.createStatement(); int n=stmt.executeUpdate("update product_master set } } catch(Exception e) { System.out.print("Exception in updateProduct: "+e); System.out.println("Total Products updated are: "+n);

product_name='"+pn+"',product_description='"+desc+"',product_image='"+img+"'where

539. 540. 541. 542. 543. 544. 545. 546. 547. 548. 549. }

{ System.out.print("Exception in updateProduct: } public void insertprod(String pd,String pn,String desc,String img,String cid) { try { conn=DBConnection.connectDB(); stmt=(Statement) conn.createStatement(); int n=stmt.executeUpdate("insert into product_master "+e);

(product_name,product_description,product_image,category_id) values('"+pn+"','"+desc+"','"+img+"',"+cid+");"); 550. 551. 552. 553. 554. 555. 556. 557. 558. 559. 560. 561. 562. 563. 564. } public void deletecat(String cn) { try { conn=DBConnection.connectDB(); stmt=(Statement)conn.createStatement(); System.out.print("Deletetion starting"); int n=stmt.executeUpdate("delete from product_category where } } catch(Exception e) { System.out.print("Exception in insertProduct: "+e); System.out.print("Total Products added are: "+n);

category_name='"+cn+"';");

565. 566. 567. 568. 569. 570. 571. 572. 573. 574. 575. 576. 577. 578. }

System.out.print("Total rows Deleted are: "+n); } catch(Exception e) { System.out.print("Exception in deleteCategory: } public void deleteProducts(String pd) { try { conn=DBConnection.connectDB(); stmt=(Statement)conn.createStatement(); int n=stmt.executeUpdate("delete from product_master where System.out.println("Product deleted "); System.out.println(n); } catch(Exception e) { System.out.println("Exception in deleteProducts: } } public void deleteStock(String sid) { try { conn=DBConnection.connectDB(); stmt=(Statement)conn.createStatement(); "+e); "+e);

product_id='"+pd+"';"); 579. 580. 581. 582. 583. 584. 585. 586. 587. 588. 589. 590. 591. 592.

593. stock_id='"+sid+"';"); 594. 595. 596. 597. 598. 599. 600. 601. 602. 603. 604. 605. 606. 607. 608. 609. 610. 611. 612. 613. 614. 615. 616. 617. 618. 619. } } return true; } } else{ return false; } } } } catch(Exception e) {

int n=stmt.executeUpdate("delete from product_stock where System.out.println("Product deleted "); System.out.println(n);

System.out.println("Exception in deleteProducts:

"+e);

public boolean insertUserMaster(String uid,String fn,String pwd,String email){ try{ conn=DBConnection.connectDB(); stmt=(Statement) conn.createStatement(); stmt.executeUpdate("insert System.out.println("Details added to user_master table "); catch(Exception e){ System.out.println("Exception in insertUserMaster: if(e==null){ return true; "+e); into user_master

values('"+uid+"','"+fn+"','"+pwd+"','"+email+"','active','user');");

620. 621. 622. 623. 624.

public boolean insertUserDetails(String fn,String ln,String uid,String pwd,String try{ conn=DBConnection.connectDB(); stmt=(Statement) conn.createStatement(); stmt.executeUpdate("insert into user_details

add1,String add2,String city,String state,String pcd,String ph,String mb){

(user_id,first_name,last_name,address1,address2,state,city,pincode,phone,mobile) values('"+uid+"','"+fn+"','"+ln+"','"+add1+"','"+add2+"','"+city+"','"+state+"','"+pcd+"','"+p h+"','"+mb+"');"); 625. 626. 627. 628. 629. 630. 631. 632. 633. 634. 635. 636. 637. 638. 639. 640. 641. 642. 643. conn=DBConnection.connectDB(); stmt=conn.createStatement(); } public Map getUserDetails(String userID){ Map map=new HashMap(); try{ } return true; } } else{ return false; } catch(Exception e){ System.out.println("Exception in insertUserDetails: if(e==null){ return true; "+e); System.out.println("Details added to user_details ");

644.

String

query="select

um.user_name,um.email_id,ud.first_name,ud.last_name,ud.address1,ud.address2,ud.state,u d.city,ud.pincode,ud.phone,ud.mobile from user_details as ud inner join user_master as um on ud.user_id=um.user_id where ud.user_id='"+userID+"'"; 645. 646. 647. 648. 649. 650. 651. 652. 653. 654. 655. 656. 657. 658. 659. 660. 661. 662. 663. 664. 665. 666. 667. 668. } public boolean updateUserDetails(String userID,String add1,String add2,String try{ } return map; } }catch(Exception e){ System.out.println("Exception getUserDetails():::-"+e); System.out.println("map----------------777 "+map); System.out.println("query in getUserDetails------------- "+query); rs=stmt.executeQuery(query); while(rs.next()){ map.put("userName",rs.getString("user_name")); map.put("emailAddress",rs.getString("email_id")); map.put("firstName",rs.getString("first_name")); map.put("lastName",rs.getString("last_name")); map.put("address1",rs.getString("address1")); map.put("address2",rs.getString("address2")); map.put("state", rs.getString("state")); map.put("city",rs.getString("city")); map.put("pincode",rs.getString("pincode")); map.put("phoneNumber",rs.getString("phone")); map.put("mobileNumber",rs.getString("mobile"));

city,String state,String pcode,String ph,String mobile,String email){

669. 670.

conn=DBConnection.connectDB(); String query="update user_details as ud inner join user_master as um on set

ud.user_id=um.user_id um.email_id=? where ud.user_id=?"; 671. 672. 673. 674. 675. 676. 677. 678. 679. 680. 681. 682. 683. 684. 685. 686. 687. 688. 689. 690. 691. 692. 693. 694. } catch(Exception e){ int result=pstmt.executeUpdate(); pstmt.setString(9,userID); pstmt.setString(8,email); pstmt.setString(7,mobile); pstmt.setInt(6,Integer.parseInt(ph)); pstmt.setInt(5,Integer.parseInt(pcode)); pstmt.setString(4,city); pstmt.setString(3,state); pstmt.setString(2,add2); pstmt.setString(1,add1); pstmt=conn.prepareStatement(query);

ud.address1=?,ud.address2=?,ud.state=?,ud.city=?,ud.pincode=?,ud.phone=?,ud.mobile=?,

695. 696. 697. 698. 699. 700. 701. 702. 703. } }

System.out.println("Exception updateUserDetails()::-"+e); return false; public void insertStock(String pid,String try{ conn=DBConnection.connectDB(); stmt=(Statement) conn.createStatement(); int n=stmt.executeUpdate("insert into product_stock bno,String rt,String exp,String

qtyleft,String wt){

(product_id,batch_no,rate,expiry_date,quantity_left,weight) values("+pid+",'"+bno+"','"+rt+"','"+exp+"','"+qtyleft+"','"+wt+"');"); 704. 705. 706. 707. 708. 709. 710. 711. 712. 713. 714. 715. 716. 717. 718. 719. 720. if(uname1.equals(uname)){ } public String authenticateUser(String uname,String pwd){ String uname1,pwd1,type="invalid"; try{ conn=DBConnection.connectDB(); stmt=conn.createStatement(); ResultSet rs=stmt.executeQuery("Select * from user_master"); while(rs.next()){ uname1=rs.getString("user_id"); pwd1=rs.getString("password"); } } catch(Exception e){ System.out.println("Exception in insertStock: "+e); System.out.println("Total Stock added are: "+n);

721. 722. 723. 724. 725. 726. 727. 728. 729. 730. 731. 732. 733. 734. 735. { 736. 737. 738. 739. 740. 741. 742. 743. 744. 745. 746. 747. } String pwd=""; try{ conn=DBConnection.connectDB(); stmt=conn.createStatement(); System.out.println("User id"+uid); ResultSet rs=stmt.executeQuery("select * from user_master where // rs=stmt.executeQuery(); while(rs.next()){ pwd=rs.getString("password"); System.out.println("User Id :"+uid); System.out.println("Current Password :"+pwd); } public void changePassword(String uid,String currpwd,String newpwd,String conpwd) } return type; } catch(Exception e){ System.out.println("Exception in authenticateUser : "+e); } return type; } } if (pwd1.equals(pwd)){ type=rs.getString("type"); return type;

user_id='"+uid+"';");

748. 749. 750. 751. 752. 753. 754. 755. 756. 757. 758. 759. 760. 761. 762. 763. 764. 765. 766. 767. 768. 769. } } }

if(pwd.equals(currpwd)){ if(newpwd.equals(conpwd)){ Statement stmt1=conn.createStatement(); int i=stmt1.executeUpdate("update user_master set System.out.println("Password changed successfully"); } else{ System.out.println("Invalid Current Password"); } } catch(Exception e){ System.out.println("Exception in changePassword() :"+e);

password='"+newpwd+"' where user_id='"+uid+"'");

public String getPasswordAndMailID(String id){ String result="invalid"; try{ conn=DBConnection.connectDB(); stmt=conn.createStatement(); ResultSet rs=stmt.executeQuery("select * from user_master where // rs=stmt.executeQuery(); while(rs.next()){ result=rs.getString("password"); result=result+":"+rs.getString("email_id"); System.out.println("result========================== "+result);

user_id='"+id+"';"); 770. 771. 772. 773. 774.

775. 776. 777. 778. 779. 780. 781. 782. 783. 784. 785. 786. 787. 788. 789. 790. 791. 792. 793. 794. 795. 796. } } }

catch(Exception e){ System.out.println("Exception in getPasswordAndMailID() return result; public boolean insertOrderRecord(List al,String userID,String status){ try{ System.out.println("in insertOrderrecord000000000000000000"); conn=DBConnection.connectDB(); stmt=conn.createStatement(); System.out.println("stmt object created11111111111111"); for(int i=0;i<al.size();i++){ OrderHistoryBean bean=(OrderHistoryBean)al.get(i); int pid=bean.getPid(); int qty=bean.getQty(); int amount=bean.getTotal(); System.out.println("before stmt query22222222222222222222"); rs=stmt.executeQuery("select user_name from user_master where String query="insert into orders :"+e);

user_id='"+userID+"'"); (user_id,user_name,last_modified,date_purchased,orders_status,orders_date_finished,com ments) values(?,?,curdate(),curdate(),?,curdate(),?)"; 797. 798. 799. 800. System.out.println("after stmt query33333333333333333333333333"); Date date=new Date(2010,11,20); pstmt=conn.prepareStatement(query); pstmt.setString(1,userID );

801. 802. 803. 804. 805. 806. 807. 808. 809. 810. 811. 812. 813. 814. 815. 816. 817. 818. 819. 820. 821. 822. 823. 824. 825. 826.

pstmt.setString(2,"sheenam" );

pstmt.setString(3,status ); pstmt.setString(4,"null" ); System.out.println("after pstmt query 4444444444444444444444"); int rows=pstmt.executeUpdate(); System.out.println("status of the query is = "+rows); rs=stmt.executeQuery("select * from orders"); rs.afterLast(); rs.previous(); int orderID=rs.getInt(1); System.out.println("55555555555555555 orderId"+orderID); query="select * from product_master where product_id="+pid+";"; System.out.println("query6666666 "+query); stmt=conn.createStatement(); ResultSet rs2=stmt.executeQuery(query); rs2.next(); String productName=rs2.getString(2); System.out.println("66666666666666666 productname "+productName); query="insert into orders_products

(orders_id,product_id,product_name,rate,final_price,products_quantity,products_weight) values(?,?,?,?,?,?,?)"; 827. pstmt=conn.prepareStatement(query);

828. 829. 830. 831. 832. 833. 834. 835. 836.

pstmt.setInt(1,orderID); pstmt.setInt(2,pid); pstmt.setString(3,productName); pstmt.setInt(4, 0000); pstmt.setInt(5, amount); pstmt.setInt(6,qty); pstmt.setInt(7,000); System.out.println("execute update ==============

"+pstmt.executeUpdate()); 837. 838. 839. 840. 841. 842. 843. 844. 845. 846. 847. 848. 849. 850. 851. 852. 853. } public ArrayList getOrderRecord(String userID){ ArrayList al1=null; try{ conn=DBConnection.connectDB(); stmt=conn.createStatement(); String query="select from } return false; } catch(Exception e){ System.out.println("Exception insertOrderRecord() : "+e); } return true;

o.date_purchased,o.orders_status,p.product_name,p.final_price,p.products_quantity

orders_products as p inner join orders as o o.user_id='sheenam_goyal'"; 854. 855. 856. 857. 858. 859. 860. 861. 862. 863. 864. 865. 866. 867. 868. 869. 870. 871. 872. 873. 874. 875. 876. 877. 878. 879. } } System.out.println("alllllllllllllllll "+al1); return al1; } catch(Exception e){ } OrderRecordBean obj; al1=new ArrayList(); while(rs.next()){ System.out.println("22222222222"); obj=new OrderRecordBean();

on p.orders_id=o.orders_id where

System.out.println("query111111111111 "+query); rs=stmt.executeQuery(query);

obj.setDate(rs.getDate("date_purchased").toString()); obj.setPaymentStatus(rs.getString("orders_status")); obj.setProductName(rs.getString("product_name")); obj.setAmount(rs.getInt("final_price")); obj.setQuantity(rs.getInt("products_quantity")); al1.add(obj);

System.out.println("Exception getOrderRecord()::-"+e);

public boolean addProductToWishList(int productID,int quantity,int weight,String try{ conn=DBConnection.connectDB();

userID){

880. 881. 882. 883. 884. 885. 886. 887. 888. 889. 890.

stmt=conn.createStatement(); String query="select product_name from product_master where System.out.println("queryyyyyyyyyyy "+query); System.out.println("userIDDDDDDDDDDDDDDDDDddd "+userID); rs=stmt.executeQuery(query); String productName=null; while(rs.next()){ productName=rs.getString("product_name"); } System.out.println("productName---------------------"+productName); String insertQuery="insert into wishlist

product_id="+productID+";";

(product_id,product_name,weight,quantity,last_modified,user_id) values(?,?,?,?,curdate(),?)"; 891. 892. 893. 894. 895. 896. 897. 898. 899. 900. 901. 902. 903. 904. 905. } return false; } catch(Exception e){ System.out.println("Exception in insertStock: "+e); System.out.println("insertQuery----------------"+insertQuery); pstmt=conn.prepareStatement(insertQuery); pstmt.setInt(1,productID); pstmt.setString(2,productName); pstmt.setInt(3, weight); pstmt.setInt(4,quantity); pstmt.setString(5,userID); pstmt.executeUpdate(); System.out.println("addProductToWishList() successfull "); return true;

906. 907. 908. 909. 910. 911. 912. 913. 914. 915. 916. 917. 918. 919. 920. 921. 922. 923. 924. 925. 926. 927. 928. 929. 930. 931. 932. 933. 934.

} public ArrayList getWishListRecord(String userID){ try{ conn=DBConnection.connectDB(); stmt=conn.createStatement(); rs=stmt.executeQuery("select * from wishlist where user_id='"+userID+"'"); ArrayList al=new ArrayList(); WishListBean bean; while(rs.next()){ bean=new WishListBean(); bean.setWishListID(rs.getInt(1)); bean.setProductID(rs.getInt(2)); bean.setProductName(rs.getString(3)); bean.setWeight(rs.getInt(4)); bean.setQuantity(rs.getInt(5)); bean.setLastModified(rs.getDate(6).toString()); bean.setUserID(rs.getString(7)); al.add(bean); } return al; } catch(Exception e){ } return null; } public boolean removeRecordFromWishList(int wishListID){ try{ conn=DBConnection.connectDB();

935. 936. 937. 938. 939. 940. 941. 942. 943. 944. 945. 946. 947. } }

stmt=conn.createStatement(); stmt.executeUpdate("delete from wishlist where wish_list_id="+wishListID); return true; } catch(Exception e){

return false; public boolean addfeedback(String fullName,String userID,String feedback,String

emailAddress,String mobileNumber) { conn = DBConnection.connectDB(); try { String sqlQuery = "insert into

feedback(user_id,feedback,full_name,email_address,mobile_number,date)values (?,?,?,?,?,curdate())"; 948. 949. 950. 951. 952. 953. 954. 955. 956. 957. 958. 959. 960. } catch (Exception e) { return true; System.out.println("query---------- "+sqlQuery); System.out.println("userID -------- "+userID); pstmt = conn.prepareStatement(sqlQuery); pstmt.setString(1, userID); pstmt.setString(2,feedback ); pstmt.setString(3,fullName ); pstmt.setString(4, emailAddress ); pstmt.setString(5,mobileNumber ); pstmt.executeUpdate();

961. 962. 963. 964. 965. 966. 967. 968. 969. 970. 971. 972. 973. 974. 975. 976. 977. 978. 979. 980. 981. 982. 983. 984. 985. 986. 987. 988. 989. { } }

System.out.println("Exception in addfeedback() return false; public ArrayList selectfeedback() try { conn=DBConnection.connectDB();

:"+e);

pstmt=conn.prepareStatement("select * from Feedback;"); System.out.println("Items Seleted From feedback table"); rs=pstmt.executeQuery(); al=new ArrayList(); while(rs.next()) { FeedbackBean bnf=new FeedbackBean(); if(rs.getString("user_id")!=null){ bnf.setuser_id(rs.getString("user_id")); } else { bnf.setuser_id("guest"); }

bnf.setfeedback(rs.getString("feedback")); bnf.setuser_name(rs.getString("full_name")); bnf.setEmailAddress(rs.getString("email_address")); bnf.setMobileNumber(rs.getString("mobile_number")); bnf.setDov(rs.getDate("date").toString());

990. 991. 992. 993. 994. 995. 996. 997. 998. 999. 1000. 1001. 1002. 1003. 1004. 1005. 1006. 1007. 1008. 1009. 1010. 1011. 1012. 1013. 1014. 1015. { } } } }

al.add(bnf);

catch(Exception e) { System.out.print("DBOperation ::- select feedback()::-----"+e); System.out.println("alllllllllllllllllll"+al); return al; public boolean changePassword(String userID,String oldPassword,String try

newPassword){

conn=DBConnection.connectDB(); stmt=conn.createStatement(); rs=stmt.executeQuery("select password from user_master where while(rs.next()) { if(rs.getString("password").equals(oldPassword)){ String query="update user_master set password="+newPassword+" where System.out.println("query11111111111111111"+query); int result=stmt.executeUpdate(query); if(result>0) return true; else

user_id='"+userID+"';");

user_id='"+userID+"';";

1016. 1017. 1018. 1019. 1020. 1021. 1022. 1023. 1024. 1025. 1026. 1027. 1028. 1029.} } } } } }

return false; } else { return false;

catch(Exception e) { System.out.print(e); return false;

1030. Code of SendMail

1031.package sendmail; 1032. 1033.import javax.mail.*; 1034.import javax.mail.internet.*; 1035.import java.util.Properties; 1036.import java.util.Date; 1037. 1038.public class SendSMTP { 1039. 1040. 1041. 1042.//--[ Set up the default parameters public static void sendMail(String toEmailId, String text, String subject,String try { userName,String password) {

1043. 1044. 1045. 1046. 1047. 1048. 1049.

Properties p = new Properties(); p.put("mail.smtp.auth", "true"); p.put("mail.transport.protocol", "smtp"); p.put("mail.smtp.host", "smtp.gmail.com"); p.put("mail.smtp.port", "25"); p.put("mail.smtp.starttls.enable", "true");

1050.//--[ Create the session and create a new mail message 1051. 1052. 1053. 1054. 1055. 1056. 1057.//--[ Set the FROM, TO, DATE and SUBJECT fields 1058. 1059. 1060. 1061. 1062. 1063. 1064. ) ); 1065. 1066. 1067. 1068. 1069. msg.setSentDate(new Date()); msg.setSubject(subject); count++; } msg.setFrom(new InternetAddress(userName)); String rec[]=toEmailId.split(";"); int count=1; msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(rec[0])); while(count<rec.length) { msg.addRecipients( Message.RecipientType.TO,InternetAddress.parse(rec[count] Authenticator auth = new SMTPAuthenticator("saini.punya97@gmail.com", Session mailSession = Session.getInstance(p, auth); Message msg = new MimeMessage(mailSession); "swastik123");

1070. 1071.//--[ Create the body of the mail 1072. 1073. 1074.//--[ Ask the Transport class to send our mail message 1075. 1076. 1077. 1078. 1079. 1080. 1081. 1082. 1083. 1084. 1085. 1086. 1087. 1088. 1089. 1090. 1091. 1092. 1093. 1094. 1095. 1096. 1097. } catch (Exception E) { } } trans.connect(); Address[] ad = msg.getAllRecipients(); for (int i = 0; i < ad.length; i++) { System.out.println("Sending to .... " + ad[i].toString()); try{ Address[] ad1 = new Address[1]; ad1[0] = ad[i]; System.out.println("sending email to actually useing ad1 and value of ad1 trans.sendMessage(msg, ad1); System.out.println("msg sent to......" + ad[i].toString()); } catch(Exception e) { continue; System.out.println("trying to send msg ..........."); Transport trans = mailSession.getTransport(); msg.setText(text);

is ............." + ad[i].toString());

1098. 1099. 1100. 1101. 1102.} } }

System.out.println("Something gone wrong while sending mail!"); E.printStackTrace();

12. Bibliography

For making this project websites used are:\ www.google.com www.roseindia.cm www.yahoo.com Books refered are: Complete reference of java. Black book of java.

You might also like