Вы находитесь на странице: 1из 76


1.1 Project Introduction
The main objective of the system is to provide a user friendly interface for maintaining the bookshop. It mainly deals with import of books from different publication houses, their sales and customer relations. The importance of our system lies within its simplicity and interactability. Each function of the system is seems to be so simple but it has a complex code within itself. Bookshop Management System is a database program that is especially tailored for book sellers. It has many features that book sellers will find very useful. The seller can manage the stock, list the customers and create catalogues. Our System has mainly divided into four modules.Those are of import of books, maintenance of books, customer relations and transaction of books. Each module has its own functionality.

1.2 Current Scenario

The software for the existing system is stand alone application. It is non web based and non portable. The software should be purchased and installed. Installation of software is a difficult process and cannot be performed by the end users who maintains the bookshop and have no computer knowledge.

1.3 Problem Definition

The normal bookshop owners commonly follow manual process of storing information. This includes lot of physical work. It is very difficult to maintain several bundles of records. Software also exists for the bookshop management system. But the installation of software is more difficult process and it is more economical to purchase for normal bookshop owners. These are the main problems in the current scenario.

2.1 HTML
HTML (Hyper Text Markup Language) is a language used to create hyper text documents that have hyper links embedded in them. It consists of tags embedded in the text of a document with HTML. We can build web pages or web documents. it is basically a formatting language and not a programming language. The browser reading the document interprets mark up tags to help format the document for subsequent display to a reader. HTML is a language for describing structured documents. HTML is a platform independent. WWW (World Wide Web) pages are written using HTML. HTML tags control in part the representation of the WWW page when view with web browser. The browser interprets HTML tags in the web document and displays it. Different browsers show data differently. Examples of browsers used to be web pages include: Netscape Internet Explorer

2.2 JAVA
Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sherdian at Sun Microsystems in 1991.

History of java
Java language was developed by James Gosling and his team at sun micro systems and released formally in 1995. Its former name is oak. Java Development Kit 1.0 was released in 1996. To popularize java and is freely available on Internet.

Overview of java
Java is loosely based on C++ syntax, and is meant to be ObjectOriented Structure of java is midway between an interpreted and a compiled language. Java programs are compiled by the java compiler into Byte Codes which are secure and portable across different platforms. These byte codes are essentially instructions

encapsulated in single type, to what is known as java virtual machine (JVM) which resides in standard browser. Jvm verifies these byte codes when downloaded by the browser for integrity. Jvm is available for almost all OS. JVM converts these byte codes into machine specific instructions at runtime.

Features of java
Java is object-oriented language and supports encapsulation, inheritance, polymorphism and dynamic binding, but does not support multiple inheritance. Everything in java is an object except some primitive data types. Java is portable architecture neutral that is java programs once compiled can be executed on any machine that is enabled. Java is distributed in its approach and used for internet programming. Java is robust, secured, high performing and dynamic in nature. Java supports multithreading. There for different parts of the program can be executed at the same time

2.3 Java Script

JavaScript processes on the client side that can perform many form tasks without connecting to a web server. Advantages: JavaScript provides interactivity for your web pages without relying on serverside programming, which means your pages can be interactive even when you are not connected to the Internet. Since the code is typed directly into your HTML files, you can create JavaScript with software as simple as a plain text editor. You can quickly test and modify JavaScript code.

Disadvantages: Long, complicated Java Scripts can add quite a bit of download time to your HTML page.

2.4 ORACLE 2.4.1 Features of oracle

Oracle provides efficient and effective solution with the following features:

Client/Server (distributed Processing) environment: To take full advantage

of a given network, oracle allows processing the database server and the client programs.

Large Databases and space Management: Oracle supports the large of data of
terabytes in size. To make efficient hardware devices, t allows full uses.

Many concurrent database users: Oracle supports large numbers executing a

variety of database on the same data.

Controlled Availability: Oracle can selectively control database level of sub data. Portability: Oracle software is ported to work with operating systems. Applications
can be ported to any operating systems modifications.

Compatibility: Oracle software is compatible with standards, including most

industrial operating systems. Applications can be used on virtually any systems modification.

Connect ability: Oracle software allows different environment and operating

systems to share the network.

2.4.2 Oracle security: Manageable Security: To Protect against unauthorized use, oracle provides failsafe security and monitor data access. These are used to manage the data and for providing security.

2.4.3 SQL The Structured Query Language

SQL is a simple, powerful database access language that is the standard language for relational database management system. The SQL implemented by Oracle Corporation.

SQL statements
All operations on the information in an oracle database are performed using SQL statements. A SQL statement is a string of SQL text that is given to oracle to execute. SQL statements are divided into the following categories: Data Definition Language(DDL) statements Data Manipulation Language (DML) statements. Transaction Control statements. Session Control statements. Embedded SQL statements.

Data Definition Language (DDL): DDL statements define maintain, and drop
objects when they are no longer needed. DDL statements also include statements that permit a user to gaint other users the privileges, or rights, to access the database and specific object within the database.

Data Manipulation Language (DML):

DML statements manipulate the

databases. data for example querying, inserting, updating, and deleting rows of a table are all DML operations; locking a table or view and examining the execution plan of an SQL statements are also DML operations.

Transaction Control statement: Transaction Control statements manage the

changes make by DML statements. They allow the user or application developer to group changes into logical transactions. Eg. COMMIT.

2.5 JDBC
The JDBS API provides universal data access from the Java programming language. Using the JDBC 3.0 API, we can access virtually any data source, from relational databases to spreadsheets and flat files. JDBC technology also provides a common base on which tools and alternate interfaces can be built.

2.5.1 JDBC Overview

Java database Connectivity is a java API for executing SQL statements. It consists of a set of classes and interfaces written in java programming language that makes it easy to send SQL statements to virtually any relational database, in other words, with the JDBC API. It is not necessary to access an Oracle database, another program to access an Informix database, and so on. One can write a single program using the JDBC API, and the program will be able to send SQL statements to appropriate database. With a program written in java, one also doesnt have to worry about writing different programs to run on different platform. The combination of Java and JDBC lets a programmer to write it once and run it anywhere.

2.5.2 ODBC
ODBC (Open Database Connection) is a way to connect any front-end tool to any back-end database engine .A front end tool is one which is used to provide a user interface using which the user will be able to manipulate the data. Aback-end is responsible for the actual manipulation of the database on the request of the front end, as well as for the storage and retrieval of information. Often a back-end is also called as a server and front end as a client. Every database software provides an ODBC driver which follows all the specifications to the ODBC compliant, it is this ODBC driver converts the request to match the implementation specified at the server side. Another important feature of the ODBC is that it provides a client an opportunity to connect multiple databases simultaneously, which could be residing at different physical locations.

What does JDBC do? Especially JDBC does three things: Establishing the connection to database. Send SQL statements.
Process the results.

2.5.3 The JDBC API The JDBC API is designed to allow developers to create database front-ends without needing to continually rewrite their code. The ability to create robust, platform independent applications and web-based applets prompted developers to consider using java to develop front-end connectivity solutions. How JDBC Works JDBC provides application developers with a singular API that is uniform and database independent. The API provides a standard to write to, and a standard that takes all of various application designs into account. The solution is a set of java interfaces that are implemented by the driver. The driver translates the standard JDBC calls into a specific call required by the database it supports. The application can be written once and moved to the various drivers. The application multi-tier database design is also known as Middleware. In addition to providing developers with a uniform and DBMS independent framework, JDBC also provides a means of allowing developers to return the specific functionality that their database vendor offers. JDBC and ODBC are based on X/ Open SQL 0Command Level Interface . Having the same conceptual base allows work on the API to proceed quickly and makes acceptance of the API easier.

2.5.4 JDBC-ODBC bridge driver (Type-1)

A bridge driver provided with JDBC can convert the JDBC calls into any type of database simultaneously. This approach is a recommended one since ODBC drivers, which are industry standard as of now, would make an application truly portable access database.

Implementation of JDBC-ODBC Bridge

Java application submits an SQL statement through the JDBC driver. The JDBC driver translates the request to an ODBC call. The ODBC driver then converts the request again and presents it to the database interface. The results of the request are then fed back through the same channels but in reverse.

2.5.5 JDBC-ODBC Connectivity

Seven basic steps to JDBC: There are seven basic steps to use JDBC to accessing a database. 1. Importing the java.sql package. 2. Load and register the driver. 3. Establish a connection to the database server. 4. Create a statement. 5. Execute the statement. 6. Retrieve the results. 7. Close the statement and connection.


Importing the java.sql package:

The JDBC API is a set of classes and interfaces. The package name for these classes and interfaces to be imported is java.sql. Import java.sql.*;

2. Load and register the driver:

It includes two steps:

Loading the driver:

To load the driver class.forName () method is used. Class.forName (weblogic.jdbc.oci.Driver); The class.forName () method takes the complete package name of the driver as its argument.

Registering the driver:

all drivers are required to register themselves at load time. The driver itself calls the DriverManager.registerDriver () method at load time to ensure that the driver is properly registered. This method is never have to be called explicitly by an application.


Establishing a connection to the database server:

The standard method of establishing a connection to the database to call DriverManager.getConnection () method. It takes at least two arguments. The first is a string representing the URL of the database followed by a set of login properties, such as the user name and password. Connection conn = DriverManager.getConnection (jdbc: web logic: Oracle: fool:, username, password);


Create a statement:
A statement object is to created from which to execute the query. There are three types of statement classes 1. Statement 2. Prepared statement

1. Statement
Statement stmt=conn.createstatement ();

2. Prepared statement Prepared Statement stmt=conn.preparedStatement (SQLquery);

5. Execute the statement:

The method used to execute a simple query is a Statement.executeQuery (). ResultSet rs=stmt1.executequery (select * from proxymapping); The executeQuery() method takes an SQL query string as an argument and returns the results of the query as a ResultSet object. The executeUpdate method is used to update the database results.

6. Retrieve the results:

Results are stored in a ResultSet object. The get method retrieves the data from the ResultSet and converts it to Java type. Each get method is used to retrieve a different Java type.

7. Close the statement and connection:

The final steps in any database application should be to close the connection and any open statements. While it is not absolutely that we close every connection and its statement object, it is highly recommended. Stmt.close (); Conn.close ();

2.5.6 The JDBC 3.0 API is comprised of two packages:

1. The java.sql package 2. The javax.sql package, which adds server-side capabilities

2.5.7 JDBC Technology Drivers

To use the JDBC API with a particular database management system, we need a


JDBC technology-based driver to mediate between JDBC technology and the database. Depending on various factors, a driver might be written purely in the Java programming language or in a mixture of the Java programming language and Java Native Interface (JNI) native methods. The latest SDK includes a JDBC-ODBC Bridge driver that makes most Open Database Connectivity (ODBC) drivers available to programmers using the JDBC API. JDBC-ODBC Bridge Driver describes the current status of this software.

JDBC URL Syntax and Structure

JDBC follows the bellow syntax: JDBC :< subprotocol>:<subname> Where <subprotocol> defines the types of driver, and <subname> provides the network-encoded name For example:

JDBC: oracle: products Here the database called the products. The driver connect () the method is the most important method and it is called by the driver manager to obtain a connection object. The connection object is the string point of the JDBC application layer. The connection object used to create statement object that perform object queries. The driver connect () method typically performs the following steps: Check to see if the given URL String is valid. Opens the TCP connection to the host and port number specified.

Attempts to access the named database table (if any) returns an instance of a connection object.


The Driver Manager Class

The driver manager class is actually a utility class used to manage JDBC drivers. The class provides methods to obtain connection through a driver register and deregister drivers, setup login and set login timeout for database access. Drivers are registered with the driver manager class, either at initialization of the Driver Manager class, or when an instance of driver is created.

The Application Layer

The application layer encompasses three interfaces that are implemented at the driver layer but are used by the developer. The three main interfaces are connection, Statements and Result set. A connection object is obtained from the driver implementation through the DriverManager.getConnection () method call. Once a connection manager object is returned, the application developer may create a statement object to issue against the database. The result of statement id a result set object, which contains the result of the particular statement (if any).

Connection Basic
The connection interface represents a session with the database connection provided by the driver. Typically database connections include the ability to control changes made to the actual data stored through the transaction. The primary use of the connection interfaces is to create a statement. Connection con=null; Statement stmt=null; Con=DriverManager.getConnection(url);

Stmt=con.createStatement(); This statement may be used to send SQL statement that returns a

single result in a ResultSet object reference. Statements that need to be called a number of times with slight variations may be executed more efficiently using a prepared statement. The connection interface is also used to create a callable statement whose purpose is to execute stored procedures.

Statement Basics
A statement is vehicle of sending SQL queries to the database and retrieving a set of results. Statements can be updates, insertion, and deletion of the queries. Statement may or may not returns a ResultSet object depending on the statement method used. The executeupdate() method.

Result Set Basics

The Result Set interface defines methods for accessing the table of data generated as the result of executing a statement Result Set column values may be accessed any order, they are indexed and may be selected by either the name or the number of the columns. Result Set maintains the position of the current row, starting with the first row of the data returned. The next () method moves to the next row of the data.

Result Set Metadata

Besides being able to read data from a Result Set object, JDBC provides an interface to allow a developer to determine what type of data is returned. The ResultSetMetaData interface is similar to database Metadata interface is concept, but it is specific to the current Result Set. The ResultSetMetaData is useful in dynamically determining the Metadata of the Result Set returned from a stored procedure.

2.5.8 JDBC Drivers

Drivers come in different varieties according to their construction and type of database they are intended to support java soft categorizes database drivers in four ways.

The JDBC-ODBC Bridge Driver

The JDBC-ODBC Bridge is a JDBC driver that provides translation of JDBC called to ODBC operation. The JDBC-ODBC Bridge Driver is implemented

with ODBC binary code and, in some cases client library as well. The bridge driver is made up of three parts: A set of C library that connect the JDBC to ODBC driver manager. The ODBC driver manager. The ODBC driver. Using a JDBC-ODBC bridge driver, application will speak directly to the JDBC interface classes. Because ODBC calls are made using binary C calls, the client must have a local copy of the ODBC Driver Manager, and the client side libraries.

The Native Library-To Java Driver

This driver uses native C language library calls to translate JDBC to the native client library. These driver use C language libraries that provide vendor specific functionality and tie these libraries to the JDBC.

2.6 JSP
Java Server Pages (JSP) is a technology for building applications containing dynamic content such as HTML, DHTML, XML, etc. The JSP technology allows you to write Web pages that create dynamic content as easily as possible but with maximum power and flexibility. JSP offers the following advantages:

Write Once, Run Anywhere technology. JSP is platform independent, both in its dynamic Web pages and its Web

servers. You can author JSP pages on any platform and run them on any Web server and access them from any Web browser. You can also build the server-side components on any platform (with a Java Virtual Machine) and run them

Static HTML templates, thus greatly simplifying the creation of Web content. Support for server-side scripting and tags.


The normal bookshop owners commonly follow manual process of storing information. This includes lot of physical work. It is very difficult to maintain several bundles of records. Softwares also exist for the bookshop management system. But the installation of software is more difficult process and it is more economical to purchase for normal bookshop owners. These are the main problems in the current scenario.

Limitations in Existing System

The data accessing from the database is very slow The current system takes time in retrieving a single record from the database


The proposed solution for the current scenario is our system which is a web based application. It is portable and works on any operating system. There is no difficulty in installation of the software and can be run on the local server so that even a common end user who has very less computer knowledge can manage it easily with out any effort.

Advantages over Existing System

This system provides fast data accessing when compared to the current system. In the proposed system retrieving a single record from large database is very easy.


3.3 SYSTEM REQUIREMENTS 3.3.1 Hardware requirements:

Hard Disk Drive 40 to 80 GB SATA Processor:6.4x 25200+2.6GHZ Primary Memory (Ram) 128MB L2 Cache Chipset Operating System: Windows NT/2000/XP Monitor: Plug and play monitor. KeyBoard: HP 101/102 Mouse: ps/2 Compatible Mouse

3.3.2 Software requirements:

Programming Languages Server Data Base Server side programming Client side Programming : Java : Apache Tomcat 5.0 : Oracle 8i : Jsp, Java Servlets : HTML, JavaScript

1) Import of Books 2) Maintenance of Books 3) Customer Relations 4) Transaction of Books


Import of Books Module



The shop owner maintains the information of different publishing houses, the authors they deal with and the subjects they publish. The enormous collection of all these books is done basing upon subject catalogue, author catalogue or publication catalogue. The owner requests the publication house the books that he need in his bookshop. He pays the bill for those books. He stores the information into database. Whenever there is import of books he should modify the database.


Maintenance of Books Module

The shop owner enters book details and thus places in the order as following hierarchy. Department-subject-author-edition-publication house He gives particular code for those books. For the books that are sent as bulk code is given for whole bulk.

3. Customer Relations Module Functionality:

Customers are categorized into 4 types. CATEGORY-A CATEGORY-B CATEGORY-C CATEGORY-D CATEGORY-A: These are the customers who take the books in bulk on regular basis. Eg: Organizations, Educational Institutions CATEGORY-B: These are the customers who take the selected books in regular manner. Eg: Students, Book lover CATEGORY-C: These are the customers who take the selected books but they are

visited only once in a while. CATEGORY-D: This is rare. It may accidentally happen. These customers take a large number of books. Special offers are given for CATEGORY-A and CATEGORY-B. Discount rates may vary basing upon count of books they take. CATEGORY-C would have the cost as usual. If ever any discount is announced they would be benefited with those. CATEGORY-D may accidentally happen basing upon the count of books they take. For each regular customer a credit level is given; that means customer can credit in the bookshop until he reaches the peak. If the customer crosses his credit level then he is intimated to pay the amount and his further transactions are blocked. After the payment, his credit level is modified. The regular customers are provided with membership cards which act as their identity. The irregular customers are given a form to fill in their details so that they can be turned into regular customers.

4. Transaction of Books Module Functionality:

When a customer gives his order, the system should first ask his code. If customer is regular he gives the code he is allotted with. Then the system would show all his details like name, contact number, address, credit level and his previous purchase details. The present purchase details are then entered and bill is generated by allotting the discount basing upon the category he belongs to. After this, the maintenance of book database as well as customer details database is modified. For all the customers who have credit availability i.e. paying amount later, system would be verifying whether they have paid the bill within a certain time limit or not.

Features of the system:

The database of system maintains the details of many publishing houses and customers. The system creates alerts Whenever there is shortage of books that are graded with a higher degree.


Whenever there is abundance of books which are graded If the customer has a long pay back delay. When it identifies stolen books. To notify important dates like book fairs, exhibitions, To show customers who have higher credit levels. For allotment of discount while billing.

with a lower degree.

important delivery dates.

Each book is given with security tag that has a bar code. The system grades the customer basing upon their purchases and bill payments and automatically notifies the special offers.

Publication details and books purchased there Books in shop Customer details along with the books they purchased Bill Reports Outstanding Reports Ageing Analysis


4.1 ARCHITECTURE 4.1.1 3-Tier Architecture:
The three-tier software architecture (a.k.a. three layer architectures) emerged in the 1990s to overcome the limitations of the two-tier architecture. The third tier (middle tier server) is between the user interface (client) and the data management (server) components. This middle tier provides process management where business logic and rules are executed and can accommodate hundreds of users (as compared to only 100 users with the two tier architecture) by providing functions such as queuing, application execution, and database staging

Fig 4.1.1(a): 3-Tier Architecture


The three tier architecture is used when an effective distributed client/server design is needed that provides (when compared to the two tier) increased performance, flexibility, maintainability, reusability, and scalability, while hiding the complexity of distributed processing from the user. These characteristics have made three layer architectures a popular choice for Internet applications and net-centric information systems.

Technical Details:
A three tier distributed client/server architecture includes a user system interface top tier where user services (such as session, text input, dialog, and display management) reside.

Fig 4.1.1(b): Three tier distributed client/server architecture depiction

Advantages of Three-Tier:

Separates functionality from presentation. Clear separation - better understanding. Changes limited to well define components. Can be running on WWW. Effective network performance.


4.1.2 FUNCTIONAL ARCHITECTURE: 1. Functional view of import of books:

When the owner requests for Import of books module, a request will be given to the web server. The web server uses database to fetch the data and update the data.

Maintains details Of publication houses

Store details Into database




Fig 4.1.2(1): Functional architecture of Import of Books

2. Functional view of maintenance of books:

When the owner requests for Maintainance of books, a request will be given to the web server for entering book details. The web server uses database to fetch the data and update the data.

Maintains Details of books And their Arrangements

Store details Into database



Book Database

Fig 4.1.2(2): Functional architecture of Maintenance of Books


3. Functional view of customer relations:

When the owner requests for maintaining customer relations, a request will be given to the web server for entering customer information and give customer membership ids and credit levels. The web server uses database to fetch the data and update the data.

Maintains details about Customers

Store details Into database



Customer Database

Fig 4.1.2(3): Functional architecture of customer Relations

4. Functional view of transaction of books module:

When the owner requests for Transaction of books, a request will be given to the web server when the customer purchases the books. The web server uses database to fetch the data and update the data.


Creates bills for each customers order

Store details Into database



Book Database

Fig 4.1.2(4): Functional architecture of Transaction of Books


Tier 1 Http Client 1 Queries Http Client 2 Http Client N Web Server Results Tier 2 Tier 3


Fig 4.1.3(a): Technical Architecture

Technical view of the Application:

Http Request (2) SQL Query (4) Web Server (3) Database (5) Result (6)

Browser (1)

Http Response (7)


Fig 4.1.3(b): Technical view of the Application

4.1.4 Database Design

The database design is the backbone of work done on the development of application. In Database environment common data are available and used by several users. Instead of each user managing its own data across application is shared by authorized users with database software managing the data as an entity. The database consists of set of well-defined tables and queries created using SQL server. A table is set rows and columns, which hold valuable information. A query is statement given by user and executes by computer to access specific information from tables.

4.1.5 Relational Database Management System (RDBMS):

Relational database management system stores data in the form of related tables. Relational databases are powerful because they require few assumptions about how data is related or how it will be extracted from the database. As a result, the same database can be viewed in many different ways. An important feature of relational systems is that a single database can be spread across several tables. This differs from flat-file databases, in which each database is self-contained in a single table. Almost all full-scale database systems are RDBMS's. Relational databases are optimized for storing transactional data, and the majority of modern business software applications therefore use an RDBMS as their data store. The leading RDBMS vendors are Oracle, IBM and Microsoft.

Objectives of Database: Reduced Redundancy


Redundant data occupies space and therefore is wasteful.

More information at low cost

Using storing and modifying at low cost are important. Although hardware prices are falling, software programming is on the rise.

Accuracy and Integrity

The accuracy of Database ensures that data quality remain constant. Integrity Controls and detects data in accuracy where they occur.

4.2 ER Diagram


Fig 4.2: E R Diagram for the System



Process Model
To solve actual problems in an industry setting, a software engineer or a team of engineers must incorporate a development strategy that encompasses that process, methods, and tools. This strategy is often referred to as process model or a software engineering paradigm. A process model for software engineering is chosen based on the nature of the project and application, the methods and tools to be used and the controls and the deliverables that are required. So, our application is based on the Object Oriented Approach. In this model we design the UML diagrams like Usecase, Activity, Sequence, Collaboration and Class diagrams.

4.3.1 Global USECASE diagrams: Identification of actors:

Actor: Actor represents the role a user plays with respect to the system. An actor interacts with, but has no control over the use cases.

Graphical representation:

<<Actor name>>


An actor is someone or something that: Interacts with or uses the system. Provides input to and receives information from the system. Is external to the system and has no control over the use cases Actors are discovered by examining:


Who directly uses the system? Who is responsible for maintaining the system? External hardware used by the system. Other systems that need to interact with the system.

The actors identified in this system are: 1. Owner 2. Customer 3. publisher

Identification of usecases: Usecase: A use case can be described as a specific way of using the system from a
users (actors) perspective.

Graphical representation:

A more detailed description might characterize a use case as: Pattern of behavior the system exhibits A sequence of related transactions performed by an actor and the system Delivering something of value to the actor Use cases provide a means to: capture system requirements communicate with the end users and domain experts test the system

Use cases are best discovered by examining the actors and defining what the actor will be able to do with the system.

Guide lines for identifying use cases:

For each actor, find the tasks and functions that the actor should be able to perform or that the system needs the actor to perform. The use case should represent a course of events that leads to clear goal. Name the use cases. Describe the use cases briefly by applying terms with which the user is familiar. This makes the description less ambiguous

The use cases that are identified in this system are: Import books Database of imported books Bookshop database Search and purchase books Billing Customer Information

Flow of events:
A flow of events is a sequence of transactions (or events) performed by the system. They typically contain very detailed information, written in terms of what the system should do, not how the system accomplishes the task. Flow of events are created as separate files or documents in your favorite text editor and then attached or linked to a use case using the Files tab of a model element. A flow of events should include When and how the use case starts and ends Use case/actor interactions Data needed by the use case Normal sequence of events for the use case

Alternate or exceptional flows

Construction of use case diagrams:

These diagrams present a high level view of how the system is used as viewed from an outsiders (actors) perspective. A use-case diagram may depict all or some of the use cases of a system. A use-case diagram can contain: actors ("things" outside the system) use cases (system boundaries identifying what the system should do) Interactions or relationships between actors and use cases in the system including the associations, dependencies, and generalizations.

Use case diagram for our system:


<<extend>> database of imported books


import books

maintainance database


search and purchase books <<include>>



customer information

Fig 4.3.1: Overall Use case Diagram


Activity diagrams provide a way to model the workflow of a business process, code-specific information such as a class operation. The transitions are implicitly triggered by completion of the actions in the source activities. The main difference between activity diagrams and statecharts is activity diagrams are activity centric, while statecharts are state centric. An activity diagram is typically used for modeling the sequence of activities in a process, whereas a statechart is better suited to model the discrete stages of an objects lifetime. Actions on activities can occur at one of four times:

On entry ---or activity.

The "task" must be performed when the object enters the state


On exit or activity. do


The "task" must be performed when the object exits the state

---- The "task" must be performed while in the state or activity and The "task" triggers an action only if a specific event is

must continue until exiting the state.

On event ---received.

An end state represents a final or terminal state on an activity diagram or state chart diagram. A start state (also called an "initial state") explicitly shows the beginning of a workflow on an activity diagram. Swim lanes can represent organizational units or roles within a business model. They are very similar to an object. They are used to determine which unit is responsible for carrying out the specific activity. They show ownership or responsibility. Transitions cross swim lanes Synchronizations enable you to see a simultaneous workflow in an activity diagram Synchronizations visually define forks and joins representing parallel workflow. A fork construct is used to model a single flow of control that divides into

two or more separate, but simultaneous flows. A corresponding join should ideally accompany every fork that appears on an activity diagram. A join consists of two of more flows of control that unite into a single flow of control. All model elements (such as activities and states) that appear between a fork and join must complete before the flow of controls can unite into one. An object flow on an activity diagram represents the relationship between an activity and the object that creates it (as an output) or uses it (as an input).


o nr we

c s mr u to e

Pb hr u lis e

re u s fo p b a n q e t r u lic tio h u ed ta o s e ils im o g p rtin b os ok

lis go t tin u p b a nh u e u lic tio o s s

a ttin b r-c d fo llo g a o e r e c b o a db lk ah o k n u

a n eb o s rra g o k ino e rd r o e p b h gh u e rd r u lis in o s fo th s b o s r oe ok

e te in rm tio in n r fo a n to m in in ed ta a e a ta c a b s

e te in rm tio in n r fo a n to d ta a eo im o db o s a b s f p rte o k

ta eo e fro k rd r m c s mr u to e

s a hfo e rc r th o e e rd r

d e c s m rh v o s u to e a e mme h ? e b rs ip [ y s] e [n ] o

[ y s] e

if b o sa e ok r ins o hp d e c s m r w n to o s u to e a t b c m mme eo e e br [ y s] e

[n ] o

if od r isb lk re u [n ] o

e te c s m r n r u to e d ta e ils

fill m m e h e b rs ip c rd a

c e k c e it hc r d le e vl

[ y s] e

if c d p id re it a [n ] o

if c e it rd aa b v ila le [ y s] e

[n ] o

in a c s m r to tim te u to e p yth c e its a e rd [ y s] e

[n ] o

b th o e ill e rd r

e te c s m r d ta n r u to e e ils in d ta a e to a b s

c e kc s m r h c u to e ty e p

c te o a a g ry (b lko e) u rd r [ y s] e g em re iv o d c ut is o n

[ n ] / c s m r b lo g toc te o b o u to e e n s a g ry

g ea p o ria iv p r p te d c ut is o n

s ll b o sin e ok n rm l p e o a ric

g n ra b e e te ill

md c s mr o ify u to e d ta a e a bs

m d m in in n e o ify a ta a c d ta a e a bs

Fig 4.3.2: Overall Activity Diagram


A sequence diagram is a graphical view of a scenario that shows object interaction in a time-based sequence what happens first, what happens next. Sequence diagrams establish the roles of objects and help provide essential information to determine class responsibilities and interfaces. There are two main differences between sequence and collaboration diagrams: sequence diagrams show time-based object interaction while collaboration


diagrams show how objects associate with each other. A sequence diagram has two dimensions: typically, vertical placement represents time and horizontal placement represents different objects.

Object: An object has state, behavior, and identity. The structure and behavior of
similar objects are defined in their common class. Each object in a diagram indicates some instance of a class. An object that is not named is referred to as a class instance. The object icon is similar to a class icon except that the name is underlined: An object's concurrency is defined by the concurrency of its class.

Message: A message is the communication carried between two objects that trigger
an event. A message carries information from the source focus of control to the destination focus of control. The synchronization of a message can be modified through the message specification. Synchronization means a message where the sending object pauses to wait for results.

Link: A link should exist between two objects, including class utilities, only if there
is a relationship between their corresponding classes. The existence of a relationship between two classes symbolizes a path of communication between instances of the classes: one object may send messages to another. The link is depicted as a straight line between objects or objects and class instances in a collaboration diagram. If an object links to itself, use the loop version of the icon.

Sequence diagrams for our system:


: ow er n

: cu stom er

: cu stom er in form ation

: cu stom er database

1: giv m bersh form e em ip

2: fill formif in terested 3: su it form bm

4: feed formin database to

5: categoriz cu e stom er

6: allot id

7: u pdate details

8: giv m bersh card e em ip

9: en pu ase in ter rch form ationof all cu stom ers

Fig 4.3.3(a): Sequence Diagram for customer Information


: publisher

: import books

: owner

1: request publication details

2: send details

3: request order

4: send order

5: generate bill for imported books

6: pay bill

Fig 4.3.3(b): Sequence Diagram for Import Books


: owner

: customer

: search and purchase books

: database

1: give order

2: forward order 3: search for a book

4: enter the code for searching book 5: check whether the book is present or not

6: show book details

7: forward book details

8: generate bill if book is present

9: forward bill details

10: according to the customer category give discounts 11: forward total amount

12: request for bill payment

Fig 4.3.3(c): Sequence Diagram for Search and Purchase Books



Collaboration diagrams and sequence diagrams are alternate representations of an interaction. A collaboration diagram is an interaction diagram that shows the order of messages that implement an operation or a transaction. A sequence diagram shows object interaction in a time-based sequence. Collaboration diagrams show objects, their links, and their messages. They can also contain simple class instances and class utility instances. Each collaboration diagram provides a view of the interactions or structural relationships that occur between objects and object-like entities in the current model. These diagrams are used to indicate the semantics of the primary and secondary interactions. They also show the semantics of mechanisms in the logical design of the system

Message icons: A message icon represents the communication between objects

indicating that an action will follow. The message icon is a horizontal, solid arrow connecting two lifelines together. A message icon can appear in 3 ways: message icon only, message icon with sequence number, and message icon with sequence number and message label. There are two types of numbering schemes. 1. Flat numbered sequence In this messages are numbered as 1, 2, 3.. 2. Decimal numbered sequence: In this the messages are given numbers as 1.1, 1.2, 1.3It makes clear which operation is calling which other operation.

Differences between sequence and Collaboration diagrams are:

1. Sequence diagram is easy to read. 2. Collaboration diagram can be used to indicate how objects are statically connected. 3. There is no numbering in sequence diagram. 4. Sequence diagram shows the links between objects in a time based sequence. 5. Collaboration diagram shows how the objects associate with each other

Collaboration Diagrams for our system:

2: fill form if interested 1: give membership form 8: give membership card : owner 3: submit form : customer

4: feed form into database

9: enter purchase i nform ati on of all custom ers 5: categorize customer 6: allot i d

: custom er information

7: update details

: customer database

Fig 4.3.4(a): Collaboration Diagram for Customer Information


2 s n d ta : e d e ils 4 s n od r : ed r e :p b h r u lis e 3 re u s o e : q e t rd r 6 p yb : a ill :o n r we

5 g n ra b fo im o te b o s : e e te ill r p r d o k 1 r q e t p b a nd ta : e u s u lic tio e ils

: im o t pr bos ok

Fig 4.3.4(b): Collaboration Diagram for Import Books

8: generate bill if book is present

12: request for payment

: customer

: owner 2: forward order 9: forward bill details

1: give order

4: enter code to search 7: forward b ook detai ls 11: forward total amount 10: allot discount according to customer category

6: show bo ok detai ls : database 3: search order 5: check the book : search and purchase books

Fig 4.3.4(c): Collaboration Diagram for Search and Purchase Books


4.3.5 CLASS DIAGRAM Identification of analysis classes:

A class is a set of objects that share a common structure and common behavior (the same attributes, operations, relationships and semantics). A class is an abstraction of real-world items. There are 4 approaches for identifying classes: 1. Noun phrase approach: 2. Common class pattern approach. 3. Use case Driven Sequence or Collaboration approach. 4. Classes , Responsibilities and collaborators Approach

1. Noun Phrase Approach:

The guidelines for identifying the classes:

Look for nouns and noun phrases in the use cases. All classes must make sense in the application domain; Avoid computer implementation classes defer them to the design stage.

b. Some classes are implicit or taken from general knowledge.


d. Carefully choose and define the class names. After identifying the classes we have to eliminate the following types of classes: a. Redundant classes. b. Adjective classes.

2. Common class pattern approach:

The following are the patterns for finding the candidate classes: a. Concept class. b. Events class. c. Organization class d. Peoples class e. Places class

f. Tangible things and devices class.

3. Usecase driven approach:

We have to draw the sequence diagram or collaboration diagram. If there is need for some classes to represent some functionality then add new classes which perform those functionalities.

4. CRC approach:
The process consists of the following steps: a. Identify classes responsibilities ( and identify the classes ) b. Assign the responsibilities c. Identify the collaborators.

Identification of responsibilities of each class:

The questions that should be answered to identify the attributes and methods of a class respectively are: 1. What information about an object should we keep track of? 2. What services must a class provide?

Identification of relationships among the classes:

Three types of relationships among the objects are:

Association: How objects are associated? Super-sub structure: How are objects organized into super classes and sub classes? Aggregation: What is the composition of the complex classes? Association:
The questions that will help us to identify the associations are: 1. Is the class capable of fulfilling the required task by itself? 2. If not, what does it need?


3. From what other classes can it acquire what it needs?

Guidelines for identifying the tentative associations:

-- A dependency between two or more classes may be an association. Association often corresponds to a verb or prepositional phrase. -- A reference from one class to another is an association. Some associations are implicit or taken from general knowledge. Some common association patterns are: Location association like part of, next to, contained in.. Communication association like talk to, order to We have to eliminate the unnecessary association like implementation associations, ternary or n-ary associations and derived associations.

Super-sub class relationships:

Super-sub class hierarchy is a relationship between classes where one class is the parent class of another class (derived class).This is based on inheritance.

Guidelines for identifying the super-sub relationship, a generalization are 1. Top-down: Look for noun phrases composed of various adjectives in a class name. Avoid excessive refinement. Specialize only when the sub classes have significant behavior. 2. Bottom-up: Look for classes with similar attributes or methods. Group them by moving the common attributes and methods to an abstract class. You may have to alter the definitions a bit. 3. Reusability: Move the attributes and methods as high as possible in the hierarchy. 4. Multiple inheritances: Avoid excessive use of multiple inheritances. One way of getting benefits of multiple inheritances is to inherit from the most appropriate class and add an object of another class as an attribute.


Aggregation or a-part-of relationship:

It represents the situation where a class consists of several component classes. A class that is composed of other classes behaves very difficultly. The major properties of this relationship are transitivity and anti symmetry.

Class diagram for our System:

< < e n t it y cl ass> > < < e n ti ty cl a ss>>

Im p o rt b o o ks bo oks im po rt()

pu blis he r b o oks b ill p u blis h () g e ne ra te b ill()

< < en t it y cla ss> >

cu s to m e r m e m b e rs hip fo rm m e m b e rs hip ca rd b o o ks b ill g ive o rde r() fill form () s u b m it fo rm () p a y bill()

< < co n tr o l cla ss> >

<< e n tity cl a ss> >

cus tom e r info rm atio n cu s to m e r d eta ils ca teg orize () u pda te ()

1 ..n 1

Ow n e r b o o ks b a rco de fo rm m em b e rs hip ca rd id b ill s e n d ord e r() im p o rt() a llot b arco de () fe e d into da tab a s e () a llot id () ca teg o rize () ta ke o rde r() s e a rch() g e n e ra te b ill()

1 ..n

1 < < e n ti ty cl a ss> >

s e a rch a nd p u rch as e bo o ks b ill ta ke o rde r() s e a rch b oo ks () g e n e ra te b ill() p a y bill()

< < e n ti ty cla ss> > < <b o u n d a r y c la ss> >

m a in ta ina nce da tab a s e s old bo o k de tails q ua n tity u pd a te ()

< < b o u n d a ry cl a ss> >

B illin g cus to m er d eta ils che ck typ e() a llo t dis cou nt() g e n erate b ill()

da tab a se b o o k d eta ils p u b lis h in g h ou s e s d e ta ils u p d a te ()


Fig 4.3.5: Class Diagram for Overall System

These are the tables that shave been used in this project development.

Attributes Phname Phaddress Phoffno Phmno Phfaxno Phemail

Data type Varchar2(50) Varchar2(100) Varchar2(15) Varchar2(15) Varchar2(15) Varchar2(40)

Constraint Not Null Not Null Not Null Not Null Not Null Not Null

Mandatory Primary key ------

Table 5.1: Publication House Details Table Attributes Bid Bdep Bsub Btitle Bauthor Bedition Bpub Bprice Bvolume Bpurchase Data type Varchar2(20) Varchar2(25) Varchar2(25) Varchar2(50) Varchar2(40) Varchar2(15) Number(50) Number(6) Number(5) Date Constraint Not Null Not Null Not Null Not Null Not Null Not Null Not Null Not Null Not Null -Mandatory Primary key ----------

Table 5.2: Publication House Title Details Table


Attributes Cid Cname Caddress Cno Cemail Category Creditlevel Creditbal

Data type Varchar2(10) Varchar2(25) Varchar2(50) Varchar2(15) Varchar2(40) Varchar2(5) Number(10) Number(12,2)

Constraint Not Null Not Null Not Null Not Null Not Null Not Null Not Null Not Null

Mandatory Primary key --------

Table 5.3: Customer Details Table

Attributes Billno Billdate Cid Cname Bid Billprice Billcredit

Data type Varchar2(10) Varchar2(20) Varchar2(10) Varchar2(25) Varchar2(10) Varchar2(12,2) Number(12,2)

Constraint Not Null Not Null Not Null Not Null Not Null Not Null Not Null

Mandatory Primary key -------

Table 5.4: Member purchase Details Table

Attributes Billno Billdate Cname Cadd Ccontact Bid Billprice

Data type Varchar2(10) Varchar2(20) Varchar2(25) Varchar2(25) Varchar2(25) Varchar2(10) Number(12,2)

Constraint Not Null Not Null Not Null Not Null Not Null Not Null Not Null

Mandatory Primary key -------


Table 5.5: Non Member Purchase Details Attributes Bid Bdep Bsub Btitle Bauthor Bedition Bpub Bprice Bvolume Bpurchase Data type Varchar2(20) Varchar2(25) Varchar2(25) Varchar2(50) Varchar2(40) Varchar2(15) Number(50) Number(6) Number(5) Date Constraint Not Null Not Null Not Null Not Null Not Null Not Null Not Null Not Null Not Null -Mandatory Primary key ----------

Table 5.6: Publisher Purchase Details Table Attributes Note Note Description Ndate Nable Data Type Varchar2(50) Varchar2(200) Varchar2(20) Varchar2(5) Constraint Not Null Not Null Not Null Not Null Mandatory Primary key ----

Table 5.7: Notifications Table


The use of this project is to maintain books, to provide the details of the books to the users and allowing the user to login and to purchase the books. i.,e online library. First the user will login by the username and password then the server checks whether the given password is valid or not. If it is a valid password then it opens the home page of the book management system. The home page contains all the book details like publishers list, search for the book, bill payment and updations, to update the book details. Now the user after login can search for a book, author and edition.Then the


customer will request for his required book then the server checks the availability of the book. If that book is available then the server will transacts the book after the payment of bill. while the bill payment or the transaction the server will check the customer datails and delivers the book. Then the librarian will update the book details after the transaction. This is how the customer will login to the server sand purchases the book and etc. Thus the book management system works.

Testing is the process of detecting errors. Testing performs a very critical role for quality assurance and for ensuring the reliability of software. The results of testing are used later on during maintenance also.

6.1 Psychology of Testing

The aim of testing is often to demonstrate that a program works by showing that it has no errors. The basic purpose of testing phase is to detect the errors that may be present in the program. Hence one should not start testing with the intent of showing


that a program works, but the intent should be to show that a program doesnt work. Testing is the process of executing a program with the intent of finding errors.

6.2 Testing Objectives

The main objective of testing is to uncover a host of errors, systematically and with minimum effort and time. Stating formally, we can say, Testing is a process of executing a program with the intent of finding an error. A successful test is one that uncovers an as yet undiscovered error. A good test case is one that has a high probability of finding error, if it exists. The tests are inadequate to detect possibly present errors. The software more or less confirms to the quality and reliable standards.

6.3 Levels of Testing

In order to uncover the errors present in different phases we have the concept of levels of testing. The basic levels of testing are as shown below

Client Needs

Acceptance Testing


System Testing

Integration Testing

Unit Testing

Design Code

System Testing
The philosophy behind testing is to find errors. Test cases are devised with this in mind. A strategy employed for system testing is code testing.

Code Testing
This strategy examines the logic of the program. To follow this method we developed some test data that resulted in executing every instruction in the program and module i.e. every path is tested. Systems are not designed as entire nor are they tested as single systems. To ensure that the coding is perfect two types of testing is performed or for that matter is performed or that matter is performed or for that matter is performed on all systems.

6.4 Types of Testing Unit testing Link testing Integration testing System testing Acceptance testing White box testing Black box testing


Unit Testing
Unit testing focuses verification effort on the smallest unit of software i.e. the module. Using the detailed design and the process specifications testing is done to uncover errors within the boundary of the module. All modules must be successful in the unit test before the start of the integration testing begins. In this project each service can be thought of a module. There are so many modules like Import of Books, Maintainance of Books, Customer Relations and Transaction of Books. Giving different sets of inputs has tested each module. When developing the module as well as finishing the development so that each module works without any error. The inputs are validated when accepting from the user. In this application developer tests the programs up as system. Software units in a system are the modules and routines that are assembled and integrated to form a specific function. Unit testing is first done on modules, independent of one another to locate errors. This enables to detect errors. Through these errors resulting from interaction between modules initially avoided.

Link Testing
Link testing does not test software but rather the integration of each module in system. The primary concern is the compatibility of each module. The Programmer tests where modules are designed with different parameters, length, type etc.

Integration Testing
After the unit testing we have to perform integration testing. The goal here is to see if modules can be integrated properly, the emphasis being on testing interfaces between modules. This testing activity can be considered as testing the design and hence the emphasis on testing module interactions. In this project integrating all the modules forms the main system. When integrating all the modules we have checked whether the integration effects working of any of the services by giving different combinations of inputs with which the two services run perfectly before Integration.


System Testing
Here the entire software system is tested. The reference document for this process is the requirements document, and the goal as to see if software meets its requirements.

Acceptance Testing
Acceptance Test is performed with realistic data of the client to demonstrate that the software is working satisfactorily. Testing here is focused on external behavior of the system; the internal logic of program is not emphasized. Test cases should be selected so that the largest number of attributes of an equivalence class is exercised at once. The testing phase is an important part of software development. It is the process of finding errors and missing operations and also a complete verification to determine whether the objectives are met and the user requirements are satisfied.

White Box Testing

In this glass box testing method a unit will be taken at a time and tested thoroughly at a statement level to find the maximum possible errors. We tested step wise every piece of code, taking care that every statement in the code is executed at least once. We have generated a list of test cases, sample data. Which is used to check all possible combinations of execution paths through the code at every module level?

Black Box Testing:

This testing method considers a module as a single unit and checks the unit at interface and communication with other modules rather getting into details at statement level. Here the module will be treated as a block box that will take some input and generate output. Output for a given set of input combinations are forwarded to other modules.

Criteria Satisfied by Test Cases



Test cases that reduced by a count that is greater than one, the number of additional test cases that must be designed to achieve reasonable testing.


Test cases that tell us something about the presence or absence of classes of errors, rather than an error associated only with the specific test at hand.

While editing defect details, care is to be taken not to allow the defect number and status fields to be edited. Password should not be less than 6 characters. Phone Number and Experience of tester should be in Numeric While entering the details all fields are mandatory Access to certain operations is restricted basing on the user type

6.5 Results of testing for our application


Test Case# : 1

Priority(H,L): High

Test Objective: To let the administrator login Test Description: The user name and password should match with those stored in the database Requirements Verified: There should exist the administrator user name and password in the database. Test Environment: Internet Explorer Test setup or Pre-conditions: User should enter some thing Actions Invalid user name and/or password Valid user name and password Pass: Yes PrP Problems or issues: Nil Expected Results Alert message should be displayed Administrator home page is displayed Conditional Pass: Fail:


Import of Books



Owner will login into the system by entering id and password .The shop owner requests the publication house the books that he need in his shop and import those books. Import books 1.Maintain publication house info 2. Request for import 3.Save book details into database Details of books are stored in database Details of books are stored in database




Maintainance of Books Books are stored In database according to the following hierarchy Department Subject Author Edition Publication House


Bookshop Database 1.Maintain details of books 2.When transactions are done database is also updated Details of books are stored in database Details of books are stored in database



Customer Relations



Customers are categorized into 4 categories and Id is allotted based upon the category Customer Information 1. Maintain customer Information 2. Save customer details into database.



Details of customer are stored in database Details of customers are stored in database


Transaction of Books When the customer purchases the books, bill is generated


Billing 1. Allot discount based upon the customer category 2. When transactions are done database is also updated


Details of purchases are stored in database


Details of purchases are stored in database


7.1 Administrator login page


7.2 Home Page of Our System


7.3 Enter Details of Publication House


7.4 List of Publication Houses


7.5 Updating Publication House details


7.6 Validation for updating


7.7 Modified details of publication Houses


7.8 Enter Title of Publication Houses


7.9 Page for Search the Book




7.10 Validation for Search by book code


7.11 Details of book if book code is exist


7.12 Bill Payment


7.13 Bill for Member customers


7.14 Bill for Non Member Customers


The application Bookshop Management System developed by us has made the best possible efforts to satisfy the needs of Owner of bookshop. The details of

customers, publication houses and books can be accessed and the transaction of books is done very easily and with in a very less time with a little effort. The owner need not have more computer knowledge. He just need to maintain the details. The entire work will be done by the system only. The bookshop management is a database program that is especially tailored for the book sellers. Bookshop management system has proven to be a reliable and user friendly program. The system has many features that booksellers will find very useful. The seller can manage the stock, list the customers and create catalogues. The system has built in update system which allows the user to make additions and customizations to the software.

It is not possible to develop a system that makes all the requirements of the user. Because user requirements keep changing as the system is being used. some of the future enhancements that can be done to this system are:


As the technology emerges, it is possible to upgrade the system and can be adaptable to desired features and environment. This system is based on object-oriented design, any further changes can be adaptable. We can provide the security issues, security can be improved using emerging technologies.


Ali Bahrami (2003),Object Oriented Analysis and Design using UML, 2nd Edition Tata McGraw-Hill.


Herbert Scheldt (2002),Java 2 Programmers Reference, 1st edition, McGraw -Hill companies.


Roger S.Pressman (2002),Software Engineering: A Practioners Approach, 5th Edition, Tata McGraw-Hill.


ORACLE 8I The Complete Reference - Kevin Loncy


5. Professional JSP 6. Java Server Pages 7. Thinking in Java 8. JSP in Nutshell

- Karl Avedal. - Ovilli. - Bruce Eckles. - Hans Bergsten.

9. www. w3schools .com

10. 11. 12. 13. 14.

www.visualbuilder.com www.java2s.com www.java.sun.com www.roseindia.net www.jsptut.com