Sie sind auf Seite 1von 28

ONLINE BOOK STORE

BATCH CODE START DATE END DATE NAME OF THE CO-ORDINATOR NAME OF THE DEVELOPERS : : : : MR.VASANTH KUMAR : Akash Goswami Gautam Kumar Vinoth Vetrivel Monika DATE OF SUBMISSION : 13-5-2012

CERTIFICATE

This is to certify that this report titled Online Book Store is developed by Akash Goswami,Gautam Kumar,Vinoth Vetrivel and Monika and submitted as the fulfillment of the course requirement at NIIT.

Coordinator Signature Date Organization Address

: Mr. M. Vasanth Kumar : : : NIIT : NIIT, T Nagar, Chennai-17.

TABLE OF CONTENTS

CHAPTER NO.

TITLE

PAGE NO

ABSTRACT

LIST OF TABLES LIST OF SYMBOLS 1 INTRODUCTION 1.1 GENERAL 1.2 EXISTING SYSTEM 1.3 PROPOSED SYSTEM 2. SYSTEM DESIGN 2.1UML DIAGRAM 2.1.1 USE CASE DIAGRAM 2.1.2 SEQUENCE DIAGRAM 2.1.3 COLLABORATION DIAGRAM 2.1.4 ACTIVITY DIAGRAM 2.2 TABLE DESIGN 2.3 HARDWARE REQUIREMENTS 2.4 SOFTWARE REQUIREMENTS 3 MODULES 3.1 REGISTRATION 3.2 LOGIN 3.3 PURCHASE

ii iii

DEVELOPMENT TOOLS 4.1JAVA ENTERPRISE EDITION 4.2SERVLETS 4.3JSP 4.4HTML 4.5DATABASE 4.6 TOMCAT/GLASSFISH SERVER

DESIGN PATTERN 5.1 PRESENTATION TIER 5.2 CONTROLLER 5.3DATA TIER

6 7 8 9

SNAPSHOTS FUTURE REFERNCES CONCLUSION REFERENCES

ACKNOWLEDGMENT

We wish to extend our thanks to our faculty, Mr Vasanth Kumar for his encouragement and guidance .We would also like to thank all other faculty members at NIIT for their cooperation and help when required. At last but not the least we would like to thank our parents, friends and God without whose support our project would not have been a success.

ABSTRACT
The design objective of this project Online Book Store is to create an online bookstore. The system will provide a mechanism for searching the available book title database with various criteria. The system will allow users to order books online. The browsing will be done via a JSP web page. A primary goal is to make the web site highly interactive and dynamic. When the user enters a subject, he or she will be able to view information on all books that correspond to that subject. The user will also be able to find additional books written by the author of a favorite title. When the user has identified a book to purchase, the system will allow him or her to enter important information, such as name, address, phone number, book id to complete the transaction. Prior to committing the transaction, the system will validate data on the client side to ensure that data is present in each required field. When the form has been correctly filled out, it will be submitted to a back-end database. On the back end, the data for the book inventory will be stored in Derby database. The same database will be used to store the customer order information. This data can be accessed later to process the orders. Any changes to the database, such as the inventory of books or the specials offered, will be reflected immediately on the web site. This project is developed using JavaEE and is be based on MVC architecture.

LIST OF TABLES

S.No 1. 2. 3.

Table Name Users Books Shipped

Page No

LIST OF FIGURES

S.No 1. 2. 3. 4.

Figure Name Use Case Diagram Sequence Diagram Collaboration Diagram Activity Diagram

Page Number

Chapter 1 INTRODUCTION 1.1GENERAL


The project titled Online Book Store is designed using JavaEE as front end and Derby Database as back end. This project is aimed to allow the users to view books and buy online. This project provides a user friendly screen to make the system interactive. There are 3 modules in our system namely 1. Registration 2. Login 3. Purchase

1.2 E XISTING SYSTEM


The existing system depends upon the local customers. The range of customers is limited. Also customers have to go to bookshops to buy books. Sometimes when the books are not available they have to go to different book shops in search of books. This is time consuming .Customers sometimes have to wait for the books to become available for more than a month which is not acceptable.

1.3 PROPOSED SYSTEM


The proposed system titled ONLINE BOOK STORE aims to overcome the limitations of existing system. The proposed system provides simple screens for the user where users can view and buy books online. This system makes the purchase of book more convenient for the users. One can browse books from their home and can pay the cash on delivery.

Chapter 2 SYSTEM DESIGN 2.1 UML DIAGRAM 2.1.1 Use Case Diagram The use case diagram represents the functionalities of the system using actors and use cases.

Fig 2.1.1: Use Case Diagram

2.1.2 Sequence Diagram


This diagram is used to represent the sequence in which the events take place.

Fig 2.1.2 Sequence Diagram

2.1.3 Collaboration Diagram


This diagram represents how the user interacts with the system .

Fig 2.1.3 Collaboration Diagram

2.1.4 Activity Diagram


This diagram represents the sequence of activities held in the system.

Fig 2.1.4 Activity Diagram

2.2 TABLE DESIGN


To store the details of the user, we have used net beans derby database. The Users table consists of id, email, password, address and phone. The Books table contains description, id, name and price. The Shipped table contains id, email, address, timestamp, status, book id, and phone. S.No 1. 2. 3. 4. 5. Column Name Data Type Id Email Password Address Phone Integer Varchar Varchar Varchar Varchar 50 30 300 30 Size Key Primary Key Unique Not Null Not Null Not Null Not Null Null

Table 2.2.1: Users

S.No

Column Name

Data Type

Size

Key

Null

1. 2. 3. 4.

Description Id Name Price

Varchar Integer Varchar Integer

300 Primary key 100

Not Null

Not Null Not Null

Table2.2.2: Books

S.No

Column Name

Data Type

Size

Key

Null

1. 2. 3. 4. 5. 6. 7.

Id Email Address Timestamp Status Book Id Phone

Integer Varchar Varchar Timestamp Varchar Integer Varchar 30 10 50 300

Primary Key Not Null Not Null

Not Null

Not Null

Table 2.2.3 Shipped

2.3 HARDWARE SPECIFICATION


Hard Disk: 60 GB or above RAM: 128 MB or more

2.4 SOFTWARE REQUIREMENTS


Operating System: Windows, Ubuntu IDE: Netbeans 7 Front End: JavaEE Back End: Derby

Chapter 3 MODULES 3.1REGISTRATION


In this module user is allowed to fill in a registration form containing details such as email id, password, address and phone number. Once the user fills in the details, the information are validated .If the entries are valid the user is registered successfully else he is redirected to the registration page itself.

3.2 LOGIN
This will ensure that only the authorized users can login to the system. Users are provided with a login form where they are supposed to fill in their email id and password. If the user is authenticated, he is logged in to the system.

3.3 PURCHASE
In this module users can buy books by clicking on the buy button. If the user is logged in they are provided with a form where their email id, shipping address and book id are listed .The user may edit the details or click on the buy option to ship the book. Once the book has been shipped, shipping id is provided to the user. The user has to pay the cash on delivery.

Chapter 4 DEVELOPMENT TOOLS 4.1 JAVA ENTERPRISE EDITION


JAVA EE is the industry standard for developing portable, robust, scalable and secure server-side Java technology applications. It built on the solid foundation of Java platform, Standard Edition (JAVA SE).

4.2 SERVLETS
A Servlet is a Java class in Java EE that conforms to the Java Servlet API, a protocol by which a Java class may respond to HTTP requests. They are not tied to a specific client-server protocol, but are most often used with this protocol. The word "Servlet" is often used in the meaning of "HTTP Servlet". Thus, a developer may use a servlet to add dynamic content to a Web server using the Java platform. The generated content is commonly HTML, but may be other data such as XML. A Servlet is an object that receives a request and generates a response based on that request. The basic servlet package defines Java objects to represent servlet requests and responses, as well as objects to reflect the servlet's configuration parameters and execution environment. Servlets may be packaged in a WAR file as a Web application.

4.3 JSP
Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic web pages and applications. This is accomplished by embedding Java code into Html, XML, DHTML, or other document types. When a client such as a web browser makes a request to the Java application container, which is typically a web server, the static page is converted behind the scenes, and displayed as dynamic content to the viewer.Servlets can be generated automatically from Java Server Pages (JSP) by the Java Server Pages compiler. The difference between Servlets and JSP is that is Servlets typically embed HTML inside Java code,

while JSPs embed Java code in HTML. A somewhat older usage is to use servlets in conjunction with JSPs in a pattern called model-view-controller pattern.

4.4 HTML
HTML stands for Hyper Text Markup Language. It is the predominant markup language for web pages. HTML is the basic building-blocks of web pages. A markup language is a set of markup tags and HTML uses markup tags to describe web pages. The purpose of a web browser is to read HTML documents and compose them into visual or audible web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page. It can embed scripts in languages such as JavaScript which affect the behavior of HTML web pages.

4.5DATA BASE(DB)
A collection of information organized in such a way that a computer program can quickly select desired pieces of data. You can think of a database as an electronic filing system. To access information from a database, you need a Data Base Management System (DBMS).This is a collection of programs that enables you to enter, organize, and select data in a database.

4.6 APACHE TOMCAT/GLASS FISH SERVER


4.6.1 APACHE TOMCAT Apache Tomcat (or Jakarta Tomcat or simply Tomcat) is an open source servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the Java Server Pages (JSP) specifications from Sun Microsystems, and provides a "pure Java" HTTP web server environment for Java code to run. Tomcat should not be confused with the Apache web server, which is a C implementation of an HTTP web server; these two web servers are not bundled together. Apache Tomcat includes tools for configuration and management, but can also be configured by editing XML configuration files.In Tomcat, a

Realm element represents a "database" of usernames, passwords, and roles (similar to Unix groups) assigned to those users. Different implementations of Realm allow Catalina to be integrated into environments where such authentication information is already being created and maintained, and then utilize that information to implement Container Managed Security as described in the Servlet Specification. 4.6.2 GLASS FISH The use of Glass Fish application server is growing, and having a reference card for dayto-day jobs is inevitable. Glass Fish is a free, open-source, production-ready, supported application server based on Java EE 5. The server runs on many platforms including Windows, Linux, Solaris, and Mac OS. It includes the Top Link Essentials implementation of the Java Persistence API. All Glass Fish V3 releases provide the same stability and capabilities of earlier V1 releases, plus many new features. These include clustering, in-memory replication, more improvements to the Grizzly-based HTTP engine, enhanced administrative functionality, improved self-management capabilities, great performance, and more.

Chapter 5 DESIGN PATTERN


The MVC design pattern provides a host of design benefits. MVC separates design concerns (data persistence and behavior, presentation, and control), decreasing code duplication, centralizing control, and making the application more easily modifiable.

5.1 PRSENTATION TIER


The Presentation logic is the part of application that is concerned with displaying different screens to users. In software development Presentation logic is concerned with how business objects are displayed to users of the software. The separation of business logic from presentation logic is an important concern for software development and an instance of the separation of presentation and content. The objective of the presentation layer is to decouple the actual user interface design and implementation from the specialized business logic of your mobile location services development process. For rapid development with minimum errors, it is most effective to have specialization.

5.2 CONTROLLER
The succession of views that a Web application user sees is called screen flow. A Webtier controller controls screen flow by selecting the next view a user sees. In static Web sites, screens are statically linked to one another. By contrast, a controller dynamically chooses the "next" screen in response to both user actions and model operation results. The controller uses this data to determine which view to display next. A Web controller "displays a view" by forwarding the request to a JSP page, servlet, or other component that renders the view in a format compatible with the client. The controller in the sample application uses two components to select and generate views: a screen flow manager, which selects the next view to display; and a templating service, which

actually generates the view content. The controller uses the screen flow manager to select a view, and forwards the request to the templating service, which assembles and delivers a view to the client. Both the screen flow manager and the templating servlet are generic components that are usable in any Web application. The component-based design reduces component coupling, promoting code reuse and simplifying the controller design.

5.3 DATA TIER


These data access tier patterns tackles best practices for an application accessing the database or the underlying persistence layer from the business tier. The patterns demonstrated here focus on and solve design problems occurring in the data tier of a J2EE application. The technologies that enable you to do this are not new. Both platforms have had mechanisms to implement database connectivity since they started. The existence of database drivers makes it easy for you to link Business tier applications to a common back-end storage and share tables, records, and fields between platforms 5.3.1 JAVA DB WITH DERBY A Derby database contains dictionary objects such as tables, columns, indexes, and jar files. A Derby database can also store its own configuration information.Derby: used to belong to Informix, who had bought a company called Cloudscape, who had developed a SQLcompliant Java relational database. Informix was in turn swallowed up by IBM, who eventually open sourced Cloudscape by contributing the code to Apache Software Foundation. Cloudscape then became Apache Derby, though when Sun Microsystems decided to add it to the Java 6.0 SDK. 5.3.2 CREATING, DROPPING AND BACKUP We can create new databases and access existing ones by specifying attributes to the Derby connection URL. There is no drop database command. To drop a database, we need to delete the database directory with operating system commands. The database must not be booted when we remove a database. We can get a list of booted databases with getPropertyInfo.

To back up a database, we can use the online backup utility. We can also use roll-forward recovery to recover a damaged database. Derby accomplishes roll-forward recovery by using a full backup copy of the database, archived logs, and active logs from the most recent time before a failure. 5.3.3 STORAGE AND RECOVERY A Derby database provides persistent storage and recovery. Derby ensures that all committed transactions are durable, even if the system fails, through the use of a database transaction log. Whereas inserts, updates, and deletes may be cached before being written to disk, log entries tracking all those changes are never cached but always forced to disk when a transaction commits. If the system or operating system fails unexpectedly, when Derby next starts up it can use the log to perform recovery, recovering the "lost" transactions from the log and rolling back uncommitted transactions. Recovery ensures that all committed transactions at the time the system failed are applied to the database, and all transactions that were active are rolled back. Thus the databases are left in a consistent, valid state. In normal operation, Derby keeps the log small through periodic checkpoints. Check pointing marks the portions of the log that are no longer useful, writes changed pages to disk, then truncates the log. Derby checkpoints the log file as it fills. It also checkpoints the log when a shutdown command is issued. Shutting down the JVM in which Derby is running without issuing the proper shutdown command is equivalent to a system failure from Derby's point of view. Booting a database means that Derby checks to see if recovery needs to be run on a database. Recovery can be costly, so using the proper shutdown command improves connection or start up performance.

5.3.4 DATABASE LIMITATIONS Derby databases have these limitations:

Indexes are not supported for columns defined on CLOB, BLOB, and LONG VARCHAR data types. If the length of the key columns in an index is larger than half the page size of the index, creating an index on those key columns for the table fails. For existing indexes, an insert of new rows for which the key columns are larger than half of the index page size causes the insert to fail. It is generally not recommended to create indexes on long columns. It is best to create indexes on small columns that provide a quick look-up to larger, unwieldy data in the row. You might not see performance improvements if you index long columns.

The system shuts down if the database log cannot allocate more disk space. A "Log Full" error or some sort of IOException will occur in the derby.log if the system runs out of space. If the system has no more disk space to append to the derby.log, you might not see the error messages.

Chapter 6 SNAPSHOTS

Chapter 7 FUTURE SCOPE

The system ONLINE BOOK STORE is modular and scalable. Thus this system can be scaled well to add features like buying multiple books at a time, buying books with credit card etc.

Chapter 8 CONCLUSION Thus the ONLNE BOOK STORE is found to meet all the specified objectives. This system allows user to browse and buy books from their home, thereby saving their time.

REFERENCES

Das könnte Ihnen auch gefallen