0% found this document useful (0 votes)
18 views69 pages

Chapter - 1: Inroduction

The document outlines the design and implementation of a Toll Gate Automation system that tracks vehicle movements and automates toll collection using RF tags and a microcontroller. It discusses the existing manual and smart card systems, proposes a new automated solution, and evaluates its technical, operational, and economic feasibility. Additionally, it covers system analysis, design principles, and the use of UML for modeling the system's architecture and workflows.

Uploaded by

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

Chapter - 1: Inroduction

The document outlines the design and implementation of a Toll Gate Automation system that tracks vehicle movements and automates toll collection using RF tags and a microcontroller. It discusses the existing manual and smart card systems, proposes a new automated solution, and evaluates its technical, operational, and economic feasibility. Additionally, it covers system analysis, design principles, and the use of UML for modeling the system's architecture and workflows.

Uploaded by

Sri M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Chapter -1

INRODUCTION

1
INTRODUCTION

1.1 PROJECT DESCRIPTION

Toll gate Automation is designed to automatically keep track of the vehicle’s


movement, record the time and the details like Owner’s name, date of registration,
vehicle model etc.

This system is very useful for automatic vehicle tracking, time management and
also for automation of Toll gate. This project explains the implementation of Toll
Gate Automation which is a step of monitoring of vehicles, traveling in
predetermined routes.

Then this information about the source (vehicle) is displayed and Toll is deducted
and stored for future use. But this system does not make toll collection completely
automatic when there is need of recharging the user’s account. Hence, in order to
make toll collection system completely automatic and to avoid corruption at Toll
Plazas some unique

2
Chapter -2

PROBLEM DEFINITION

3
PROBLEM DEFINITION

2.1 Existing System

First is the traditional manual method where one person collects the money and
issues a receipt. There are two ways of collecting toll tax being in practice at
present. other is two way receipt exists for 24 hours

The other one is Smart Card system where the person needs to show the smart
card to the system installed at the toll tax depot to open the barrier

.
2.2 Proposed System
Each vehicle will be provided by an RF TX tag containing a unique ID. When the
vehicle will reach at the toll booth the RF receiver will detect these RF signals.
The signals are amplified and are passed to microcontroller. Now, with the help of
PC interface unit the data collected is passed to PC through serial port.

Software developed will show all the details about the vehicle on the screen.
Details like date time and id will be stored in the access database. Microcontroller
will check whether the user is valid or not, if valid the microcontroller will
intimate the gate control which is supported by a stepper motor.

Advantages:

• Toll gate Automation is designed to automatically keep track of the vehicle’s


movement

• record the time and the details like Owner’s name

• Date of registration, vehicle model etc.

• This system is very useful for automatic vehicle tracking, time management and
also for automation of Toll gate.

• This project explains the implementation of Toll Gate Automation which is a step
of monitoring of vehicles, traveling in predetermined routes.

4
MODULES:

Admin:

Toll gate Automation is designed to automatically keep track of the vehicle’s


movement, record the time and the details like Owner’s name, date of registration,
vehicle model etc.

Registration of owner:

Automation of toll gate records the time and the details like Owner’s name, date of
registration, vehicle model

Track details:

It explains the implementation of Toll Gate Automation which is a step of monitoring


of vehicles, traveling in predetermined routes. In this system, a computerized system
automatically identifies an approaching vehicle and records the vehicle number &
Time.

Search:

Automation which is a step of monitoring of vehicles, traveling in predetermined


routes. In this system, a computerized system automatically identifies an approaching
vehicle and records the vehicle number & Time.

5
Chapter -3

6
FEASIBILITY STUDY:

The next step in analysis is to verify the feasibility of the proposed


system. “All projects are feasible given unlimited resources and infinite
time“. But in reality both resources and time are scarce. Project should
confirm to time bounce and should be optimal in there consumption of
resources. These places a constant are approval of any project.

Feasibility has applied to Maintenance of Elementary School Data pertains


to the following areas:

 Technical feasibility
 Operational feasibility
 Economical feasibilty

3.1 TECHNICAL FEASIBILITY:

To determine whether the proposed system is technically feasible, we


should take into consideration the technical issues involved behind the
system.

Maintenance of Elementary School Data uses the web technologies,


which is rampantly employed these days worldwide. The world without the

7
web is incomprehensible today. That goes to proposed system is technically
feasible.

3.2 OPERATIONAL FEASIBILITY:

To determine the operational feasibility of the system we should


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

3.3. ECONOMIC FEASIBILITY

To decide whether a project is economically feasible, we have to consider


various factors as:
 Cost benefit analysis
 Long-term returns
 Maintenance costs

The proposed Maintenance of Elementary School Data is computer


based. It requires average computing capabilities and access to
internet, which are very basic requirements and can be afforded by any
organization hence it doesn’t incur additional economic overheads, which
renders the system economically feasible.

8
HARDWARE AND SOFTWARE REQUIREMENTS

Hardware Requirements
Processor : Dual Core
Ram : 1GB (or) Higher
Hard disk : 160GB

Software Requirements

Technology : Java 2 Standard Edition, JDBC


Web Server : Tomcat 7.0
Client Side Technologies: HTML, CSS, JavaScript
Server Side Technologies: Servlets, JSP
Data Base : MySQL
Operating System : Microsoft Windows
IDE : Eclipse

9
Chapter – 4

SYSTEM ANALYSIS

10
SYSTEM ANALYSIS

SOFTWARE REQUIREMENT SPECIFICATION

Question: What is SRS?


Answer: Software Requirement Specification (SRS) is the starting point
of the software developing activity. As system grew more
complex it became evident that the goal of the entire system
cannot be easily comprehended. Hence the need for the
requirement phase arose. The software project is initiated by
the client needs. The SRS is the means of translating the ideas
of the minds of clients (the input) into a formal document (the
output of the requirement phase.)

The SRS phase consists of two basic activities:

1) Problem/Requirement Analysis:

The process is order and more nebulous of the two, deals


with understand the problem, the goal and constraints.

2) Requirement Specification:

Here, the focus is on specifying what has been found


giving analysis such as representation, specification languages and
tools, and checking the specifications are addressed during this
activity.

11
The Requirement phase terminates with the production of the
validate SRS document. Producing the SRS document is the basic
goal of this phase.

ROLE OF SRS
The purpose of the Software Requirement Specification is to
reduce the communication gap between the clients and the
developers. Software Requirement Specification is the medium
though which the client and user needs are accurately specified. It
forms the basis of software development. A good SRS should
satisfy all the parties involved in the system.

SCOPE

This document is the only one that describes the requirements


of the system. It is meant for the use by the developers, and will also
by the basis for validating the final delivered system. Any changes
made to the requirements in the future will have to go through a
formal change approval process. The developer is responsible for
asking for clarifications, where necessary, and will not make any
alterations without the permission of the client.

12
Chapter -5

SYSTEM DESIGN

13
SYSTEM DESIGN

System design is transition from a user oriented document to


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

The database tables are designed by analyzing functions


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

SOFTWARE DESIGN

In designing the software following principles are followed:

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

system should consists of hierarchy of modules and serve to partition into

separate function.

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

system.

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

4. Shared use: avoid duplication by allowing a single module be called by

other that need the function it provides

UML Concepts

The Unified Modelling Language (UML) is a standard language for writing


software blue prints. The UML is a language for
 Visualizing
 Specifying
 Constructing
 Documenting the artefacts of a software intensive system.
The UML is a language which provides vocabulary and the rules for combining words in
that vocabulary for the purpose of communication. A modelling language is a language
whose vocabulary and the rules focus on the conceptual and physical representation of a
system. Modelling yields an understanding of a system.
Building Blocks of the UML:
The vocabulary of the UML encompasses three kinds of building blocks:
 Things
 Relationships
 Diagrams
Things are the abstractions that are first-class citizens in a model; relationships tie these
things together; diagrams group interesting collections of things.

Things in the UML:

15
There are four kinds of things in the UML:
 Structural things
 Behavioral things
 Grouping things
 Annotational things

Structural things are the nouns of UML models. The structural things used in the project
design are:
First, a class is a description of a set of objects that share the same attributes, operations,
relationships and semantics.

Window
origin
size
open()
close()
move()
display()

Fig: Classes

Second, a use case is a description of set of sequence of actions that a system performs
that yields an observable result of value to particular actor.

Fig: Use Cases

Third, a node is a physical element that exists at runtime and represents a computational
resource, generally having at least some memory and often processing capability.

16
Fig: Nodes

Behavioural things are the dynamic parts of UML models. The behavioural thing used
is:
Interaction:
An interaction is a behaviour that comprises a set of messages exchanged among a set of
objects within a particular context to accomplish a specific purpose. An interaction
involves a number of other elements, including messages, action sequences (the
behaviour invoked by a message, and links (the connection between objects).

Fig: Messages
5.1.3 Relationships in the UML:

There are four kinds of relationships in the UML:


 Dependency
 Association
 Generalization
 Realization
A dependency is a semantic relationship between two things in which a change to one
thing may affect the semantics of the other thing (the dependent thing).

Fig: Dependencies

17
An association is a structural relationship that describes a set links, a link being a
connection among objects. Aggregation is a special kind of association, representing a
structural relationship between a whole and its parts.

Fig: Association

A generalization is a specialization/ generalization relationship in which objects of the


specialized element (the child) are substitutable for objects of the generalized element
(the parent).

Fig: Generalization

A realization is a semantic relationship between classifiers, where in one classifier


specifies a contract that another classifier guarantees to carry out.

Fig: Realization

Sequence Diagrams:

UML sequence diagrams are used to represent the flow of messages, events and actions
between the objects or components of a system. Time is represented in the vertical
direction showing the sequence of interactions of the header elements, which are
displayed horizontally at the top of the diagram.
Sequence Diagrams are used primarily to design, document and validate the architecture,
interfaces and logic of the system by describing the sequence of actions that need to be
performed to complete a task or scenario. UML sequence diagrams are useful design
tools because they provide a dynamic view of the system behaviour which can be
difficult to extract from static diagrams or specifications.

18
Actor
Represents an external person or entity that interacts with the system

Object
Represents an object in the system or one of its components

Unit
Represents a subsystem, component, unit, or other logical entity in the system (may or
may not be implemented by objects)

Separator
Represents an interface or boundary between subsystems, components or units (e.g., air
interface, Internet, network)

Group
Groups related header elements into subsystems or components

19
Sequence Diagram Body Elements

Action
Represents an action taken by an actor, object or unit

Asynchronous Message

An asynchronous message between header elements

Block
A block representing a loop or conditional for a particular header element

Call Message
A call (procedure) message between header elements

Create Message

20
A "create" message that creates a header element (represented by lifeline going from
dashed to solid pattern)

Diagram Link
Represents a portion of a diagram being treated as a functional block. Similar to a
procedure or function call that abstracts functionality or details not shown at this level.
Can optionally be linked to another diagram for elaboration.

Else Block Represents an "else" block portion of a diagram block

Message

A simple message between header elements

Return Message

A return message between header elements

21
a:admin t:tracker s:search v:vowner d:database

registerowner
added

submitdocuments

verifydoc
accept owner

trackvehicle details

search card validity

deduct amount deducted

pay money

update plans monthly yearly

view plans

22
Use Case Diagram
A use case diagram is a graph of actors set of use cases enclosed by a system boundary,
communication associations between the actors and users and generalization among use
cases. The use case model defines the outside(actors) and inside(use case) of the system’s
behavior.
use case diagram is quite simple in nature and depicts two types of elements: one
representing the business roles and the other representing the business processes.

Figure 3.1: an actor in a use case diagram


To identify an actor, search in the problem statement for business terms that portray roles
in the system. For example, in the statement "patients visit the doctor in the clinic for
medical tests," "doctor" and "patients" are the business roles and can be easily identified
as actors in the system.

Use case: A use case in a use case diagram is a visual representation of a distinct
business functionality in a system. The key term here is "distinct business functionality."
To choose a business process as a likely candidate for modelling as a use case, you need
to ensure that the business process is discrete in nature.
As the first step in identifying use cases, you should list the discrete business functions
in your problem statement. Each of these business functions can be classified as a
potential use case. Remember that identifying use cases is a discovery rather than a
creation. As business functionality becomes clearer, the underlying use cases become
more easily evident. A use case is shown as an ellipse in a use case diagram (see Figure
3.2).

23
Figure 3.2: use cases in a use case diagram

Figure 3.2 shows two uses cases: "Make appointment" and "Perform medical tests" in the
use case diagram of a clinic system. As another example, consider that a business process
such as "manage patient records" can in turn have sub-processes like "manage patient's
personal information" and "manage patient's medical information." Discovering such
implicit use cases is possible only with a thorough understanding of all the business
processes of the system through discussions with potential users of the system and
relevant domain knowledge.

Use Case diagram

register

login

submitvdetails

paymoney
owner
admin
viewUsers
submitdocuments

recordownerdetails
viewdetails

trackvehicledetails
verifyvalidity verifydetails

<<include>>

viewvehiclevalidity

deductamount

24
Activity Diagram

Activity diagrams represent the business and operational workflows of a system. An


Activity diagram is a dynamic diagram that shows the activity and the event that causes
the object to be in the particular state.
So, what is the importance of an Activity diagram, as opposed to a State diagram? A
State diagram shows the different states an object is in during the lifecycle of its
existence in the system, and the transitions in the states of the objects. These transitions
depict the activities causing these transitions, shown by arrows.
An Activity diagram talks more about these transitions and activities causing the changes
in the object states.

Activity Diagram:

Defining an Activity diagram

Let us take a look at the building blocks of an Activity diagram.

Elements of an Activity diagram

An Activity diagram consists of the following behavioural elements:

Initial Activity: This shows the starting point or first activity of the flow. Denoted by a
solid circle. This is similar to the notation used for Initial State.

25
Activity: Represented by a rectangle with rounded (almost oval) edges.

.
Decisions: Similar to flowcharts, a logic where a decision is to be made is depicted by a
diamond, with the options written on either sides of the arrows emerging from the
diamond, within box brackets.

Signal: When an activity sends or receives a message, that activity is called a signal.
Signals are of two types: Input signal (Message receiving activity) shown by a concave
polygon and Output signal (Message sending activity) shown by a convex polygon.

Concurrent Activities: Some activities occur simultaneously or in parallel. Such


activities are called concurrent activities. For example, listening to the lecturer and
looking at the blackboard is a parallel activity. This is represented by a horizontal split
(thick dark line) and the two concurrent activities next to each other, and the horizontal
line again to show the end of the parallel activity.

26
Final Activity: The end of the Activity diagram is shown by a bull's eye symbol, also
called as a final activity.

Admin:

27
Vehicle Owner:

vehicleowner

submitdocuments
viewplans paymoney verifydetails checkvalidity

Class Diagram

An object is any person, place, thing, concept, event, screen, or report applicable
to your system. Objects both know things (they have attributes) and they do things (they
have methods).

A class is a representation of an object and, in many ways; it is simply a template


from which objects are created. Classes form the main building blocks of an object-
oriented application. Although thousands of students attend the university, you would
only model one class, called Student, which would represent the entire collection of
students.

28
Class diagram

Admin vehicleOwner
+uname +name
+password +password
+trackVehicleDetails() +address
+findVehicleMovement() +phoneno
+recordOwnerDetails() +dateofRegistration
+viewRegistration() +vehicleModel
+viewVehicleModel() +emailid
+vehicleno

+payMoney()
+submitDetails()
+viewDetails()
+verifyDetails()

TrackDetails
Search
+id
+name +name
+password +id Vehicle
+location +date
+date +time +vno
+time +location +vname
+vmodel
+trackDetails() +searchVehicle() +regdetails
+deductAmount() +submitDetails() +vowner
+verifyValidity() +cardno
+sendMails()

Responsibilities

Classes are typically modeled as rectangles with three sections: the top section for the
name of the class, the middle section for the attributes of the class, and the bottom section
for the methods of the class. Attributes are the information stored about an object, while
methods are the things an object or class do. For example, students have student numbers,
names, addresses, and phone numbers. Those are all examples of the attributes of a
student. Students also enroll in courses, drop courses, and request transcripts. Those are
all examples of the things a student does, which get implemented (coded) as methods.
You should think of methods as the object-oriented equivalent of functions and
procedures.

Object diagram

An object diagram in the Unified Modeling Language (UML), is a diagram that


shows a complete or partial view of the structure of a modeled system at a specific time.

29
An Object diagram focuses on some
particular set of object instances and attributes, and the links between the instances.
A correlated set of object diagrams provides insight into how an arbitrary view of a
system is expected to evolve over time. Object diagrams are more concrete than class
diagrams, and are often used to provide examples, or act as test cases for the class
diagrams. Only those aspects of a model that are of current interest need be shown on an
object diagram.

Deployment Diagram

Deployment diagrams are used to visualize the topology of the physical components of a
system where the software components are deployed.

So deployment diagrams are used to describe the static deployment view of a system.
Deployment diagrams consist of nodes and their relationships.

The purpose of deployment diagrams can be described as:

The name Deployment itself describes the purpose of the diagram. Deployment diagrams
are used for describing the hardware components where software components are
deployed.

 Visualize hardware topology of a system.


 Describe the hardware components used to deploy software components.

 Describe runtime processing nodes.

 Deployment Diagram

30
client

databaseserver

webbrowser
applicationserver

Component Diagram

In the Unified Modelling Language, a component diagram depicts how


components are wired together to form larger components and or software systems. They
are used to illustrate the structure of arbitrarily complex systems.
Components are wired together by using an assembly connector to connect the
required interface of one component with the provided interface of another. This
illustrates the service consumer - service provider relation between the two components.

31
admin owner

vehiclesearch

database
tracker

32
5.2INPUT/OUTPUT DESIGN

Input design: considering the requirements, procedures to collect the


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

Also the measures are taken for the following

 Controlling the amount of input


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

Output design: All the screens of the system are designed with a
view to provide the user with easy operations in simpler and efficient
way, minimum key strokes possible. Instructions and important
information is emphasized on the screen. Almost every screen is
provided with no error and important messages and option
selection facilitates. Emphasis is given for speedy processing and
speedy transaction between the screens. Each screen assigned to make
it as much user friendly as possible by using interactive procedures.
So to say user can operate the system without much help from the
operating manual.

33
Chapter -6

IMPLEMENTATION

34
OVERVIEW OF SOFTWARE DEVELOPMENT
TOOLS

6.1 HTML

Html is a language which is used to create web pages with html


marking up a page to indicate its format, telling the web browser
where you want a new line to begin or how you want text or images
aligned and more are possible.

We used the following tags in our project.

TABLE:

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

TR:
TR is used to create a row in a table encloses <TH> and
<TD> elements. <TR> contain many attributes. Some of them are,
 ALIGN: specifies the horizontal alignment of the text in the table row.
 BGCOLOR: Specifies the background color for the row.
 BORDERCOLOR: Sets the external border color for the row.
 VALIGN: Sets the vertical alignment of the data in this row.

35
TH:
TH is used to create table heading.
 ALIGN: Sets the horizontal alignment of the content in the table cell.
Sets LEFT, RIGHT, CENTER.
 BACKGROUND: Species the back ground image for the table cell.
 BGCOLOR: Specifies the background color of the table cell
 VALIGN: Sets the vertical alignment of the data. Sets to TOP,
MIDDLE, BOTTOM or BASELINE.
 WIDTH: Specifies the width of the cell. Set to a pixel width or a
percentage of the display area.
TD:
TD is used to create table data that appears in the cells of a
table.
 ALIGN: Species the horizontal alignment of content in the table cell.
Sets to LEFT, CENTER, RIGHT.
 BGCOLOR: Specifies the background image for the table cell.
 BGCOLOR: sets the background color of the table cells.
 WIDTH: Species the width of the cell

FRAMES:
Frames are used for either run off the page or display only small
slices of what are supposed to be shown and to configure the frame we can
use <FRAMESET>There are two important points to consider when
working with <FRAMESET>.
 <FRAMESET> element actually takes the place of the <BODY>
element in a document.
 Specifying actual pixel dimensions for frames .

36
<FRAME> Elements are used to create actual frames.
From the frameset point of view dividing the browser into tow vertical
frames means creating two columns using the <FRAMESET> elements
COLS attribute.
The syntax for vertical fragmentation is,
<FRAMESET COLS =”50%, 50%”>
</FRAMESET>
Similarly if we replace COLS with ROWS then we get horizontal
fragmentation.
The syntax for horizontal fragmentation is,
<FRAMESET ROWS=”50%, 50%”>
</FRAMESET>
FORM:
The purpose of FORM is to create an HTML form; used
to enclose HTML controls, like buttons and text fields.

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

 NAME: Gives the name to the form so you can


reference it in code set to an alphanumeric string.

 METHOD: method or protocol is used to sending


data to the target action URL. The GET method is the default, it is
used to send all form name/value pair information in an URL.

37
Using the POST method, the content of the form are encoded as with
the GET method, but are sent in environment variables.

CONTROLS IN HTML

<INPUT TYPE =BUTTON>:


Creates an html button in a form.
ATTRIBUTES:
 NAME: gives the element a name. Set to alphanumeric characters.
 SIZE: sets the size.
 VALUE: sets the caption of the element.

<INPUT TYPE = PASSWORD>:


Creates a password text field, which makes typed input.
ATTRIBUTES:
 NAME: gives the element a name, set to alphanumeric characters.
 VALUE: sets the default content of the element.

<INPUT TYPE=RADIO>:
Creates a radio button in a form.
ATTRIBUTE:
 NAME: Gives the element a name. Set to alphanumeric character.
 VALUE: Sets the default content of the element.

<INPUT TYPE=SUBMIT>:
Creates a submit button that the user can click to send data in the form
back to the web server.

38
ATTRIBUTES:
NAME: Gives the element a name. Set to alphanumeric characters.
VALUE: Gives this button another label besides the default, Submit Query.
Set to alphanumeric characters.
<INPUT TYPE=TEXT>:
Creates a text field that the user can enter or edit text in.
ATTRIBUTES:
NAME: Gives the element a name. Set to alphanumeric characters.
VALUE: Holds the initial text in the text field. Set to alphanumeric
characters.

39
6.2 JAVA SCRIPT
Java script originally supported by Netscape navigator is the
most popular web scripting language today. Java script lets you
embedded programs right in your web pages and run these programs
using the web browser. You place these programs in a <SCRIPT>
element, usually within the <HEAD> element. If you want the script
to write directly to the web page, place it in the <BODY> element.

JAVASCRIPT METHODS:
Writeln:
[Link]() is a method, which is used to write some text to
the current web page.
onClick:
Occurs when an element is clicked.
onLoad:
Occurs when the page loads.
onMouseDown:
Occurs when a mouse button goes down.
onMouseMove:
Occurs when the mouse moves.
onUnload:
Occurs when a page is unloaded.

40
6.3 MySql
JDBC DRIVERS:
The JDBC API only defines interfaces for objects used for
performing various database-related tasks like opening and
closing connections, executing SQL commands, and retrieving the
results. We all write our programs to interfaces and not
implementations. Either the resource manager vendor or a third
party provides the implementation classes for the standard JDBC
interfaces. These software implementations are called JDBC drivers.
JDBC drivers transform the standard JDBC calls to the external
resource manager-specific API calls. The diagram below depicts
how a database client written in java accesses an external resource
manager using the JDBC API and JDBC driver:

41
Depending on the mechanism of implementation, JDBC drivers are broadly
classified into four types.

TYPE1:
Type1 JDBC drivers implement the JDBC API on top of a
lower level API like ODBC. These drivers are not generally
portable because of the independency on native libraries. These
drivers translate the JDBC calls to ODBC calls and ODBC sends the
request to external data source using native library calls. The
JDBC-ODBC driver that comes with the software distribution for J2SE
is an example of a type1 driver.

TYPE2:
Type2 drivers are written in mixture of java and native code.
Type2 drivers use vendors specific native APIs for accessing the
data source. These drivers transform the JDBC calls to vendor specific
calls using the vendor’s native library.
These drivers are also not portable like type1 drivers because
of the dependency on native code.

TYPE3:
Type3 drivers use an intermediate middleware server for
accessing the external data sources. The calls to the middleware
server are database independent. However, the middleware
server makes vendor specific native calls for accessing the data
source. In this case, the driver is purely written in java.

42
TYPE4:
Type4 drivers are written in pure java and implement
the JDBC interfaces and translate the JDBC specific calls to vendor
specific access calls. They implement the data transfer and network
protocol for the target resource manager. Most of the leading
database vendors provide type4 drivers for accessing their database
servers.

DRIVER MANAGER AND DRIVER:

The [Link] package defines an interface called [Link]


that makes to be implemented by all the JDBC drivers and a class
called [Link] that acts as the interface to the
database clients for performing tasks like connecting to external
resource managers, and setting log streams. When a JDBC client
requests the DriverManager to make a connection to an external
resource manager, it delegates the task to an approate driver
class implemented by the JDBC driver provided either by the
resource manager vendor or a third party.

43
[Link]:

The primary task of the class driver manager is to manage the


various JDBC drivers register. It also provides methods for:
 Getting connections to the databases.
 Managing JDBC logs.
 Setting login timeout.

MANAGING DRIVERS:

JDBC clients specify the JDBC URL when they request a


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

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

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

CONNECTIONS:

The interface [Link] defines the methods required for a


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

CREATING STATEMENTS:
The interface [Link] defines a set of methods for
creating database statements. Database statements are used for sending SQL
statements to the database:
Public Statement createStatement () throws SQLException

45
This method is used for creating instances of the interface
[Link]. This interface can be used for sending SQL statements to
the database. The interface [Link] is normally used for sending
SQL statements that don’t take any arguments. This method throws an
instance of SQLException if a database access error occur:
Public Statement createStatement (int resType, int resConcurrency)
throws SQLException.

JDBC RESULTSETS:

A JDBC resultset represents a two dimentional array of data


produced as a result of executing SQL SELECT statements
against databases using JDBC statements. JDBC resultsets are
represented by the interface [Link]. The JDBC vendor
provider provides the implementation class for this interface.

SCROLLING RESULTSETS:

public boolean next() throws SQLException


public boolean previous() throws SQLException
public boolean first() throws SQLException
public boolean last() throws SQLException

46
ACCESSING RESULTSET DATA:

Method name and Purpose

public boolean getBoolean (int i)

Gets the data in the specified column as a boolean.

public boolean getBoolean (String col)


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

public int getInt (String col)

public String getString (int I) Gets the data in the specied column as
a string.

Public String getString


(String col)

STATEMENT:

The interface [Link] is normally used for sending


SQL statements that do not have IN or OUT parameters. The JDBC driver
vendor provides the implementation class for this interface. The
common methods required by the different JDBC statements are
defined in this interface. The methods defined by [Link]. Statement
can be broadly categorized as follows:
 Executing SQL statements
 Querying results and resultsets

47
 Handling SQL batches
 Other miscellaneous methods

The interface [Link] defines


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

Public Resultset execute Query (string sql) throws SQLException


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

DriverManager

Driver Driver
Layer

Application
Layer Connection

Prepared Statement Statement Callable Statement

Result Set Result Set Result Set

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

THE NEED FOR JSP:


Servlets are indeed useful, and JSP by no means makes them obsolete.
However,
 It is hard to write and maintain the HTML.
 You cannot use standard HTML tools.
 The HTML is inaccessible to non-Java developers.

BENEFITS OF JSP:
JSP provides the following benefits over servlets alone:
 It is easier to write and maintain the HTML: In this no extra
backslashes, no double quotes, and no lurking Java syntax.
 You can use standard Web-site development tools:
We use Macromedia Dreamweaver for most of the JSP pages.
Even HTML tools that know nothing about JSP can used because they
simply ignore the JSP tags.
 You can divide up your development team:

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

CREATING TEMPLATE TEXT:

A large percentage of our JSP document consists of static text


known as template text. In almost all respects, this HTML looks just
likes normal HTML follows all the same syntax rules, and
simply “passed through” to that client by the servlet created to handle
the page. Not only does the HTML look normal, it can be created
by whatever tools you already are using for building Web pages.
There are two minor exceptions to the “template
text passed through” rule. First, if you want to have <% 0r %> in
the out port, you need to put <\% or %\> in the template text. Second,
if you want a common to appear in the JSP page but not in the
resultant document,

<%-- JSP Comment -- %>

HTML comments of the form:

<!—HTML Comment -->

are passed through to the client normally.

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

1. Expressions of the form <%=Java Expression %>, which are


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

USING JSP EXPRESSIONS:

A JSP element is used to insert values directly into the output. It has
the following form:
<%= Java Expression %>
The expression is evaluated, converted to a string, and inserted in the
page. This evaluation is performed at runtime (when the page is
requested) and thus has full access to the information about the request.
For example, the following shows the date/time that the page was
requested.
Current time: <%=new [Link] () %>

51
PREDEFINED VARIABLES:
To simplify expressions we can use a number of predefined variables (or
“implicit objects”). The specialty of these variables is that, the system
simple tells what names it will use for the local variables in _jspService.The
most important ones of these are:
 request, the HttpServletRequest.
 response, the HttpServletResponse.
 session, the HttpSession associated with the request
 out, the writer used to send output to clients.
 application, the ServletContext. This is a data structure shared by all
servlets and JSP pages in the web application and is good for storing
shared data.
Here is an example:

Your hostname: <%= [Link] () %>

COMPARING SERVLETS TO JSP PAGES


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

52
WRITING SCRIPTLETS
If you want to do something more complex than output the value of a
simple expression .JSP scriptlets let you insert arbitrary code into the
servlet’s _jspService method. Scriptlets have the following form:
<% Java code %>
Scriptlets have access to the same automatically defined variables as do
expressions (request, response, session, out , etc ) .So for example you want
to explicitly send output of the resultant page , you could use the out
variable , as in the following example:
<%
String queryData = [Link] ();
[Link] (“Attached GET data: “+ queryData);
%>
SCRIPTLET EXAMPLE:
As an example of code that is too complex for a JSP expression alone,
a JSP page that uses the bgColor request parameter to set the background
color of the page .Simply using
<BODY BGCOLOR=”<%= [Link] (“bgcolor”) %> “>
would violate the cardinal rule of reading form data.

USING DECLARATIONS
A JSP declaration lets you define methods or fields that get inserted
into the main body of the servlet class .A declaration has the following form:
<%! Field or Method Definition %>
Since declarations do not generate output, they are normally used in
conjunction with JSP expressions or scriptlets. In principle, JSP declarations

53
can contain field (instance variable) definitions, method definitions, inner
class definitions, or even static initializer blocks: anything that is legal to put
inside a class definition but outside any existing methods. In practice
declarations almost always contain field or method definitions.
We should not use JSP declarations to override the standard servlet life cycle
methods. The servlet into which the JSP page gets translated already makes
use of these methods. There is no need for declarations to gain access to
service, doget, or dopost, since calls to service are automatically dispatched
to _jspService , which is where code resulting from expressions and
scriptlets is put. However for initialization and cleanup, we can use jspInit
and jspDestroy- the standard init and destroy methods are guaranteed to call
these methods in the servlets that come from JSP.

6.5Apache Tomcat
Apache Tomcat is a web [Link] is the Servlet/JSP container
that implements the Servlet 2.4 and JavaServer Pages 2.0 specification. It
also includes many additional features that make it a useful platform for
developing and deploying web applications and web services.

TERMINOLOGY:
Context – a Context is a web application.
$CATALINA_HOME – This represents the root of Tomcat
installation.
DIRECTORIES AND FILES:
/bin – Startup, shutdown, and other scripts. The *.sh files (for Unix
systems) are functional duplicates of the *.bat files (for Windows systems).

54
Since the Win32 command-line lacks certain functionality, there are some
additional files in here.

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

/logs – Log files are here by default.

/webapps – This is where webapps go\

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

DEPLOYMENT DIRECTORIES FOR DEFAULT WEB


APPLICATION:

HTML and JSP Files

 Main Location
$CATALINA_HOME/webapps/ROOT
 Corresponding URLs.
[Link]
[Link]

55
 More Specific Location (Arbitrary Subdirectory).
$CATALINA_HOME/webapps/ROOT/SomeDirectory

 Corresponding URLs
[Link]
[Link]

Individual Servlet and Utility Class Files

 Main Location (Classes without Packages).


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

 Corresponding URL (Servlets).


[Link]

 More Specific Location (Classes in Packages).


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

 Corresponding URL (Servlets in Packages).


[Link]

Servlet and Utility Class Files Bundled in JAR Files

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

 Corresponding URLs (Servlets)


[Link]
[Link]

56
Chapter -7

TESTING

57
SOFTWARE TESTING

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

7.1 TESTING OBJECTIVES

 To ensure that during operation the system will perform as per


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

The software developed has been tested successfully using the


following testing strategies and any errors that are encountered are corrected
and again the part of the program or the procedure or function is put to

58
testing until all the errors are removed. A successful test is one that uncovers
an as yet undiscovered error.

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

7.2 TEST CASE DESIGN:

White box testing

White box testing is a testing case design method that uses


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

Black Box Testing

Black Box Testing attempts to find errors in following areas or


categories, incorrect or missing functions, interface error, errors in data
structures, performance error and initialization and termination error. Here
all the input data must match the data type to become a valid entry.
The following are the different tests at various levels:

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

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

Validation Testing

This testing concentrates on confirming that the software is error-free


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

This testing is a series of different tests whose primary is to fully


exercise the computer-based system. This involves:

60
 Implementing the system in a simulated production environment and
testing it.
 Introducing errors and testing for error handling.

61
TEST CASE 1 :

Test case for Login form:

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


incorrect Password then it displays an error message “NOT A VALID
USER NAME”.

TEST CASE 2:

Test case for User Registration form:

When a user enters user id to register and ID already exists, then


this result in displaying error message “USER ID ALREADY EXISTS”.

TEST CASE 3 :

Test case for Change Password:

When the old password does not match with the new password, then
this results in displaying an error message as “OLD PASSWORD
DOES NOT MATCH WITH THE NEW PASSWORD”.

TEST CASE 4 :

Test case for Forget Password:

When a user forgets his password he is asked to enter Login name, ZIP code,
Mobile number. If these are matched with the already stored ones then user
will get his Original password.

62
Chapter – 8

OUTPUT SCREENS

63
OUTPUT SCREENS

Proposed Automatic System:

64
Toll Gate Station:

65
Central Station:

66
CONCLUSION

The Automation Of Toll Gate project has been successfully


completed. The goal of the system is achieved and the problems are solved.
This project is developed in this manner that is user friendly and required
help is provided at different levels.
By doing automation of toll plaza we can have the best solution over
money loss at toll plaza by reducing the man power required for collection
of money and also can reduce the traffic indirectly resulting in reduction of
time at toll plaza.

67
APPENDIX

ABBREVATIONS:

HTML : Hyper Text Markup language.


JSCRIPT : Java Script
DFD : Data Flow Diagrams
HTTP : Hyper Text Transfer Protocol
JDBC : Java Data Base Connectivity.

FAQ’S

Question: What is java script?


Answer: Java script is a compact; object based scripting
language for developing client and server internet
applications.

Client vs server side java script?

Client side java script is interpreted only within the browser


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

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

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

68
BIBILIOGRAPHY

Advanced Java Programming - Dietel and Dietel

Mastering JAVA 2 - John Zukowski

Java Server Programming - Apress

Software Engineering - Roger S Pressman

Análysis & Design of InformationSystems – Senn

Websites
[Link]
[Link]
[Link]
[Link]

69

You might also like