You are on page 1of 68

GNEC

Table of Contents

1. Abstract 3
2. Introduction 4
2.1. Essence of the project 4
2.2. Problems in existing system
4
2.3. Proposed system 4
2.4. Intended Audience and Reading Suggestions 4
2.5. Language Scope 5
2.6. Project Scope 5
2.7. References 5
3. Overall Description 6
3.1. Product Perspective 6
3.2. Product Functions 6
3.3. User Classes and Characteristics 6
3.4. Design and Implementation Constraints 7
3.5. User Documentation 7
4. Requirement Analysis 8
4.1. Functional Requirements 8
4.2. Software and Hardware Requirements 9
4.3. Non Functional Requirements 10
5. External Interface Requirements 11
5.1. User Interfaces 11
5.2. Hardware Interfaces 11
5.3. Software Interfaces 11
5.4. Communication Interfaces 11
6. Design 12
6.1. Architecture of the system 12
6.2. Use case Diagram 15

1
GNEC

6.3. Class Diagram 16


6.4. Object Diagram 17
6.5. Sequence Diagrams 18
6.6. Activity Diagram 23
7. Implementation 24
7.1. Introduction to Technologies Used 24
8. Pseudo Code 34
9. Implementation Screens 50
10. Testing 64
10.1 Introduction 64
10.2 Test Cases 67
11. Conclusion 68

2
GNEC

1. ABSTRACT

In this system, the complaints can be given through the online facility provided to
the residents through their employee codes. The employees of the electrical department can
trace the complaints given by the residents to which an appropriate and immediate response can be
given to the residents. The work is handled later and is maintained online. This enables them to refer
the information in the future also.when compared to present system, the residents gives the complaints
to the electrical department through off line i.e. in person. The employees of the electrical department
goes to the complained residents house and perform the necessary repaired works and maintain these
details in registers which makes it complicated for future reference or at the analysation time of reports
every month or over the given period. There are other problems with the non availability of electrical
equipments required for handling the given complaint. This information passing to the residents may
be difficult. Lack of paper movements provides complaint management operations a speed which was
never envisaged in manual mode at all. Software allows a booking operator to book and lodge
complaints and automatically schedules and prompts operators to source complaint to concerned
departments. While lodging a complaint through a medium of telecommunication like telephone as it is
not helpful to rectify your problems. As sometimes the electrical department phones will be busy or out
of signal. So online electrical complaint monitoring system will rectify the problems through online
registration which will give information regarding their area zonal manager and will provide linemen
to their residents which will overcome their problems. As this will also help in future purpose.

3
GNEC

2. INTRODUCTION

2.1 Essence of the project:

To Track the complaints given by the residents online and providing them with respective solutions.

2.2 Problems in existing system:

In the current scenario, the residents give the complaints to the electrical department through off
line i.e. in person. The employees of the electrical department goes to the complained residents house
and perform the necessary repaired works and maintain these details in registers which makes it
complicated for future reference or at the analyzation time of reports every month or over the given
period. There are other problems with the non-availability of electrical equipments required for
handling the given complaint. This information passing to the residents may be difficult.

2.3 Proposed System:

In the proposed system, the complaints can be given through online facility provided to the
residents through their employee codes. The employees of the electrical department can trace the
complaints given by the residents to which an appropriate and immediate response can be given to the
residents. The work is handled later and is maintained online. This enables them to refer the
information in the future also.

2.4 Intended Audience and Reading Suggestions


Document intended for Project Managers, Developers, End users and Quality Assurance engineers
[Testing]. Suggested reading the document would be overall document description, starting from
product based information gathering followed by infrastructure requirement.

2.5 Language Scope

Language : Java [Multi tier architecture – Web based solution]

4
GNEC

2.6 Project Scope

1. Extend an online facility for the public to address their electrical grievances.
2. The application addresses issues and provides solutions zone wise.
3. Effective communication between the consumers and the state electricity board – suggestions &
feedback.

2.7 References

1) Java a) JSP Black Book, Dreamtech Publications


b) Java 2.0, Oreilly Publications

2) Database a) Databases in Java, Korth


b) Database, C.J Dates

3) Html a) E.Stephen mack janan platt


b) Html, Complete Reference

3. OVERALL DESCRIPTION

3.1 Product Perspective

5
GNEC

In today’s scenario, the consumers of electricity report problems and issues physically or personally
with the respective regional office. An oral confirmation is provided to the complainant and is assured
of solution shortly.
The application proposes an online facility to address consumer complaints. The system is managed by
an administrator who creates the zonal offices each identified by location and a user. Every zonal user
in turn has userid & password identifying him from the other. The zonal manager is responsible for
complaints in his jurisdiction. The system maintains a list of customers and associated meter numbers.
When a complaint is accepted, the system ensures the meter number is provided. A compliant number

1
which is auto generated by the application is associated with the complaint. These complaints are then
visible to the zonal manager. The zonal manager associates the complaint to a lineman. The lineman is
managed and created by the zonal manager. Each lineman can login and find associated tasks day wise.
The lineman on attending the complaints needs to furnish the status of the compliant. The consumer

)
can optionally post his feedback.

3.2 Product Functions

.  Register and identify Zonal Managers.


 Register and identify linemen.
 Post complaints and queries.
 Day wise schedule for lineman
 View pending complaints and solutions
 Customer feedback.

U
3.3User Classes and Characteristics

Used by Administrator, zonal manager, lineman & consumers to perform their co-related tasks.

s
3.4 Design and Implementation Constraints

e
The software will be required to be maintained by the server (ISP). The application is web
distributable. The system should have JVM for execution. As the application is web based, the web
server (Tomcat) should be available and executing. Network connection, a domain/workgroup model
should be in place. It requires the MS-Access database to store and retrieve information from.

c
GNEC

3.5 User Documentation

The product is provided with built-in manual that would help the end user use the system for
functioning. Additional training would not be required as the user manuals acts as self learning aid. It
provides an easy to act system.

4. REQUIREMENT ANALYSIS

4.1 Functional Requirements

1. Login Module

7
GNEC

The login module facilitates to sign-in for existing users or register them if they do not have
one. There are four user typ
es, namely, Administrator, Zonal Manager, Lineman and residents. The Administrator, Zonal Manager
and Lineman have to login using their passwords whereas the consumer signs in using their unique
meter ids.

2. Administrator
The Administrator creates the Zones, Zonal manager, can transfer the Zonal Managers. He
has the authority to view the complaints of all the zones at a given time periodically. He can even
associate with the Zonal Manager, if necessary. The Admin also has the information of the customer’s
feedback.

3. Zonal Manager
The Zonal Manager appoints the Lineman in his specific area to handle the registered
complaints. As such, he can only view the pending as well as cleared complaints in his jurisdiction
given a specified duration. He can also view the user’s feedback in the particular area.

4. Lineman

The day wise schedule given by the Zonal Manager is handled by the Lineman i.e. he attends
the problems to provide the respective solutions in his area. The Lineman after addressing the work
sets the status of the complaints as pending or cleared.

5. Consumer:
The electricity consumer reports the problems to the Electricity Department online. After
raising the complaint, he is issued with a complaint number for further reference. Accordingly, he even
gives the feedbacks and suggestions.

4.2 Software and Hardware Requirements

8
GNEC

Hardware Requirement (Minimum)


Processor : P IV
Ram : 512 Mb
Hard Disk : 10 Gb space
Monitor : VGA Color (256)

Software Requirement
Operating System : Windows 2000 or Higher

Platform : Java

Scripting : JSP

Backend : Ms-Access/SQL Server

Web Server : Tomcat

4.3 NON FUNCTIONAL REQUIREMENTS

Performance Requirements
Good bandwidth, less congestion on the network it improves performance. Identifying the shortest
route to reach the destination URL and also improves performance.

Safety Requirements

No harm is expected from the use of the product either to the OS or to any data.

9
GNEC

Product Security Requirements


The product is protected from un-authorized users from using it. The system allows only authenticated
users to work on the application.

Software Quality Attributes

The product is user friendly and its accessibility is from the client. The application is reliable and
ensures its functioning maintaining the news and having it accessible to the public. As it is developed
in Java it is highly interoperable with OS that have provided support for JVM(Server side). The system
requires less maintenance as it is not installed on the client but hosted on the ISP. The firewall,
antivirus protection etc is provided by the ISP.

5. EXTERNAL INTERFACES REQUIRMENTS

10
GNEC

5.1 User Interfaces


The application provides with keyboard shortcuts and a facility to use the mouse to trigger the required
actions. They act as shortcuts and provide an easy navigation within the software. All inputs are from
these input devices and as such no other external hardware or interface is required. The entire
application is constructed using web forms. They act as GUI interface for the user to interact with.
Appropriate controls are used to identify selection and data processing. Components such as grid etc
are used to provide tabulated outputs.

5.2 Hardware Interfaces


The application concentrates on handling text on the network. As the application is web based network
configuration, ip address information has to be set. A modem, cable or router etc is required to set up
for the internet connection or a hub is required to set it up for the intranet deployment.

5.3 Software Interfaces


The incoming data to the product would be text outgoing data would also be text information. The data
is stored across the database in MS-Access. A compatible version such as Ms-Access Office 2003 is
required at the minimum. Tomcat version 5.5 at the minimum is required.
5.4 Communication Interfaces
The application will be finally hosted on a centralized server such as the ISP. The server should be
configured with the Tomcat web server, the TCP/IP protocol should be configured and the
communication is set to occur using the http protocol. The client on the other hand requires a browser,
communication lines, ip address and the URL to the server.

6. DESIGN
6.1 Architecture of The System

Software Architecture

11
GNEC

HTML,JSP,Jdb
c

OECMS Logi
n Administrato
r
Administratio
n
Zonal Zonal
operations manager
Lineman
operations
Linema
Customer n
operations

Custome
r

JDBC ODBC URL


(HTTP)
(Ms-Acess)
- OECDB

Technical Architecture

12
GNEC

OEC T
Website O
M
Internet C
A
T
Admin
8080

Database
ISP Server
Internet

Software Layer
Network A Architecture
Network B

Zonal Zonal
Manager1 Manager2
Customer1 Customer2

LineMan1 LineMan2 LineMan1 LineMan2

13
GNEC

Clients
Administrator Zonal Lineman Customer
Manager

Security Firewall / Proxy

6.2 Use Case Diagram


Presentation HTML, JSP, JDBC

Application OECMS

Integrate Jdbc-odbc
14

Data SQL
GNEC

6.3 Class Diagram

15
GNEC

6.4 Object Diagram

16
GNEC

6.5 Sequence Diagrams


User Login Sequence Diagram

17
GNEC

Admin Sequence Diagram

18
GNEC

Zonal Manager Sequence Diagram

19
GNEC

Lineman Sequence Diagram

20
GNEC

Consumer Sequence Diagram

21
GNEC

6.6 Activity Diagram

22
GNEC

7. IMPLEMENTATION

23
GNEC

7.1 Introduction to Technologies Used:

Java
Java was conceived by James Gosling, Patrick Naughton, ChrisWarth, Ed Frank and Mike Sheridan at
SUN Micro Systems Incorporation in 1991. It took 18 months to develop the first working version.
This language was initially called “OAK”, but was renamed “JAVA” in 1995. Before the initial
implementation of OAK in 1992 and the public announcement of Java in 1995, many more contributed
to the design and evolution of the language.

An Object Oriented Programming Language(OOPL) developed at Sun Microsystems. A Virtual


Machine Run Time Environment that can be embedded in web browser (IE, NN). Java is a powerful
but lean object oriented programming language. It has generated a lot of excitement because it makes it
possible to program for Internet by creating applets, programs that can be embedded in web page.

The context of an applet is limited only by one’s imagination. For example, an applet can be an
animation with sound, an interactive game or a ticker tape with constantly updated stock prices.
Applets can be serious application like word processor or spreadsheet.

But Java is more than a programming language for writing applets. It is being used more and more for
writing standalone applications as well. It is becoming so popular that many people believe it will
become standard language for both general purpose and Internet programming. There are many
buzzwords associated with Java, but because of its spectacular growth in popularity, a new buzzword
has appeared ubiquitous. Indeed, all indications are that it will soon be everywhere.

Java builds on the strength of C++. It has taken the best features of C++ and discarded the more
problematic and error prone parts. To this lean core, it has added garbage collection (automatic memory
management), multithreading(the capacity for one program to do more than one thing at a time),
security capabilities. The result is simple, elegant, powerful and easy to use.

Java is actually a platform consisting of three components:


 Java Programming Language.

24
GNEC

 Java Library of Classes and Interfaces.


 Java Virtual Machine.

It also has a Standardized set of Packages (Class, Interfaces):


 Creating Graphical User Interfaces
 Controlling Multimedia Data
 Communicating over Network

The Internet helped catapult Java to the forefront of programming and Java in turn has a profound
effect on the Internet. The reason is simple. Java expands the universe of objects that can move about
freely in cyberspace. In a network, there are two broad categories of objects transmitted between the
server, your personal computer, passive information and dynamic, active programs. For example, when
you read your e-mail, you are viewing passive data. Even when you download a program, the
program’s code is still only passive data until you execute it. However, there is a second type of object
that can be transmitted to your computer, a dynamic, self executing program. Such a program would be
an active agent on the client computer, yet it would be initiated by the server. As desirable as dynamic,
networked programs are, they also present serious problems in the areas of security and portability.
Prior to Java cyberspace was effectively closed to half the entities that now live there. Java addresses
these concerns and doing so, has opened the door to an exiting a new form of program.

Java Server Pages(JSP)

Introduction

25
GNEC

Java Server Pages (JSP's) permit server side Java logic to reside within the requested document. Upon
request of a JSP document the server activates the specified JSP. The JSP then becomes responsible for
providing an HTML response.

The server side logic within a JSP is written in Java. The Java code segments, referred to as scriptlets,
are generally responsible for providing dynamic HTML content to the JSP's response HTML. The JSP
itself is compiled by the server, and is executed as an object that extends the Java Servlet API. As such,
the HTTP Servlet request and response objects are available by the scriptlets defined within the JSP.

This document reviews client-server design considerations in respect to the use of JSP’s.
Implementation options, particularly the use of JSP language extensions and use of Enterprise Java
Beans (EJB's) will also be discussed. Focus will be placed on the presentation layer and how the JSP is
used to provide a user interface and communicate business logic requests to the supporting system.

Technology

JSP technology uses XML - like tags and scriptlets. They are used to encapsulate presentation logic
within the JSP. They can also initiate messages to distributed or server-side applications. The logical
separation of presentation and business logic lies in the implementation of the JSP.

Enterprise Java Beans provide a distinct relationship between the implementation of business logic and
the remote interfaces provided to the EJB client. The use of an EJB typically follows the pattern:

 The client application identifies itself to the server.

 The client application uses the Java Naming Directory service to locate the desired EJB.

 The client application retrieves a handle to the EJB Home and subsequently Remote
interfaces.

The remote interface contains methods that the client is permitted to use. They represent a summary of
the business logic that is implemented by the bean. The implementation logic is defined within the
primary bean class. All IPC, database and resource details are restricted to the bean class.

26
GNEC

In constructing a JSP document, the creation of the HTML base is a prudent step. It becomes the visual
template that JSP scriptlets are merged into. The post execution HTML produced from the completed
JSP should be that of the original HTML document. With the exception of comment, dynamically
generated HTML sections and JSP content substitutions. The scripting logic, except for where desired,
is completely non visual in regard to the response HTML text.

The construction of the HTML layout conceivably begins with a Web developer. The creation of the
JSP pages would be similar if not identical to the methods used to construct industry HTML pages. The
next step would be the addition of JSP specific logic to identify the sections of the HTML that might be
generated dynamically. This conversion step from pure HTML to JSP is where server side logic is
added to the page.

A completed JSP logically embodies presentation layer services and business functionality. Physically
they are blended within the JSP in an as needed swapping of HTML and JSP code. Continued
maintenance of the application and changes in the business logic need not affect the presentation
layout. Likewise, changes in the presentation layout need not affect the scriptlet logic, it will however
require that the WEB developer, not necessarily a JAVA programmer, show care in the handling of this
file which is no longer pure HTML should any HTML maintenance become necessary.

Apache Tomcat

Apache Tomcat (or Jakarta Tomcat or simply Tomcat) is an open source developed by the Apache
Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP)
specifications from Sun Microsystems, and provides a "pure Java” HTTP web server environment for
Java code to run.

27
GNEC

Components

Tomcat version 4.x was released with Jasper (a redesigned JSP engine), Catalina (a redesigned servlet
container) and Coyote (an HTTP connector).

1. Catalina

Catalina is Tomcat's servlet container. Catalina implements Sun Microsystems' specifications for
servlet and JavaServer Pages (JSP). The architect for Catalina was Craig McClanahan.

2. Coyote

Coyote is Tomcat's HTTP Connector component that supports the HTTP 1.1 protocol for the web
server or application container. Coyote listens for incoming connections on a specific TCP port on the
server and forwards the request to the Tomcat Engine to process the request and send back a response
to the requesting client.

3. Jasper

Jasper is Tomcat's JSP Engine. Tomcat 5.x uses Jasper 2, which is an implementation of the Sun
Microsystems’s JavaServer Pages 2.0 specification. Jasper parses JSP files to compile them into Java
code as servlets (that can be handled by Catalina). At runtime, Jasper is able to automatically detect
JSP file changes and recompile them.

Tomcat 5.x

• Implements the Servlet 2.4 and JSP 2.0 specifications

• Reduced garbage collection, improved performance and scalability

• Native Windows and Unix wrappers for platform integration

• Faster JSP parsing

28
GNEC

Java Data Base Connectivity

Introduction
Java Database Connectivity(JDBC) is a front-end tool for connecting to a server to ODBC in that
respect, However JDBC can connect only Java clients and it uses ODBC for the connectivity. JDBC is
essentially a low-level application programming interface. It is called a low-level API since any data
manipulation, storage and retrieval has to be done by the program itself. Some tools which provide a
higher-level abstraction or expected shortly.

The next question that needs to be answered is why we need JDBC, once we have ODBC on hand. We
can use the same ODBC to connect the entire database and ODBC is a proven technology. Problem for
doing this is ODBC gives a ‘C’ language API, which uses pointers extensively. Since Java does not
have any pointers and is object-oriented sun Microsystems, inventor of Java developed to suit its needs.

REQUIREMENTS TO USE JDBC:


To use JDBC you need a basic knowledge of database and SQL. Apart from this you need the jdk1.1
(Java Development Kit 1.1) or a version of Java since jdk1.1 and above come bundled with JDBC
software.

After that you need to have a back-end database engine for which a JDBC driver is available. When
JDBC drivers are not available JDBC-ODBC bridge drivers are used to access the database through
ODBC. Back-end is not need when JDBC driver is capable of storing and retrieving the data itself, or if
JDBC-ODBC bridge and the ODBC driver can be store and retrieve the information.
.
JDBC DRIVER TYPES:
The JDBC drivers that we are aware of at this time fit into one of four categories:

 JDBC-ODBC bridge plus ODBC driver: The Java Soft bridge product provides JDBC
access via ODBC drivers. Note that ODBC binary code and in many cases database client
code must be loaded on each client machine that uses this driver. As a result, this kind of

29
GNEC

driver is most appropriate on a corporate network where client installations are not a major
problem, or for application server code written in Java in a three-tier architecture.

 Native-API partly-Java driver: This kind of driver converts JDBC calls into calls on the
client API for Oracle, Sybase, Informix, DB2, or other DBMS. Note that, like the bridge
driver, this style of driver requires that some binary code be loaded on each client machine.
 JDBC-Net all-Java driver: This driver translates JDBC calls into a DBMS-independent net
protocol that is then translated to a DBMS protocol by server. This net server middle ware
is able to connect its all-Java clients to many different databases. The specific protocol used
depends on the vendor. In general, this is the most flexible JDBC alternative. It is likely that
all vendors of this solution will provide products suitable for Internet use. In order for these
products to also support Internet access, they must handle the additional requirements for
security, access through firewalls, etc., that the Web imposes. Several vendors are adding
JDBC drivers to their existing database middle ware products.
 Native-protocol all-Java driver: This kind of driver converts JDBC calls into the network
protocol used by DBMS directly. This allows a direct call from the client machine to the
DBMS server and is a practical solution for Internet access. Since many of these protocols
are proprietary, the database vendors themselves will be the primary source. Several
database vendors have these in progress.
Eventually, we expect the last two drivers will be preferred way to access database from JDBC. And
the first two driver categories are interim solutions where direct all-Java drivers are not yet available.
The last driver is in some sense the ideal one. However, there are many cases where JDBC-Net all-Java
driver may be preferable. For example, where a thin DBMS- independent client is desired, or if a
DBMS-independent protocol is standardized and implemented directly by many DBMS vendors.

HTML

Introduction
The Hyper Text Markup Language (HTML) is a simple markup language used to create hypertext
documents that are portable from one platform to another. HTML documents are SGML documents
with generic semantic that are appropriate for representing information from a wide range of

30
GNEC

applications. This specification defines HTML version 3.2. HTML 3.2 aims to capture recommended
practice as of early ‘96 and as such to be used as a replacement for HTML 2.0(RF1866).

A set of instructions embedded in a document is called Markup Language. These instructions describe
what the document text means and how it should look like in a display. Hyper Text Markup Language
(HTML) is the language used to encode World Wide Web documents. It is a document layout and
hyperlink specification language that defines the syntax and placement of special embedded directions
that are not displayed by a web browser, but tells it how to display the contents of the documents
including text, images and other supported media.

Use of HTML
Web site is a collection of pages, publications, and documents that reside on web sever. While these
page publications, and a document as a formatted in any single format. You should use HTML for
home page and all primary pages and the site. This will enable the millions of web users it easily
access and to take advantage of your website. HTML is considered first for formatting any new
material you plan to publish on the web. HTML documents are platform independent, meaning that
they don’t confirm to any standard. If they are created properly you can move home to any server
platform or you can access them with any complaint www browser.

Block of HTML:

HTML elements perform a defined task. HTML uses two types of elements

 Empty tags(open tags)


 Container tags

These tags differ because of what they represent. Empty tags represent formatting constructs such as
line breaks and Horizontal rules. Container tags define a section of text and specify the formatting the
container dot all of the selected text. A container tag has both a beginning and an ending.

31
GNEC

HTML Layout

An HTML document consist of text, which comprises the content of the document and tags which,
defines the structure and appearance of the document. The structure of an HTML document is simple.

<HTML>

<HEAD>

<TITLE> the title of the HTML document </TITLE>

</HEAD>

<BODY>

This is where the actual HTML documents


Text lies which is displayed in the browser
</BODY>

</HTML>

Program Description
The first line i.e., <HTML> tag, HTML tag is beginning tag and second line is starting tag for head
section is <HEAD> The third line i.e., <TITLE> form example program </TITLE> is the title of the
program. It defines a text string that is interpreted as the HTML title of the document. The tag
</HEAD> will end the HEAD section of the program. Next tag is <BODY> the beginning of the body
section where HTML document text lies, which is displayed in the browser. Next tags </BODY>
</HTML> are the ending tags for the body section and html program respectively.

Each document has a head and body delimited by the <HEAD> and <BODY> tag. The head is where
you give your HTML document a title and where you indicate other parameters the browser may use
when displaying the document. The body is where you put the actual contents of the HTML
documents. This include the text for displaying the text. Tag also references special and hot spots that
link your document to other documents.

32
GNEC

8. PSEUDOCODE

Add Linemen
<%@ page import="java.sql.*" %>
<%
Connection con;

33
GNEC

Statement stmt;
ResultSet rs;
int nzmid;
%>
<%
nzmid=2001;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:oecmsdsn");
stmt=con.createStatement();
rs=stmt.executeQuery("select max(lid) from lms");
try
{
if(rs.next())
{
nzmid=rs.getInt(1)+1;
if(nzmid<2000)
nzmid=2001;
}
}
catch(Exception ee)
{
nzmid=2001;
}
}
catch(Exception ee)
{
out.println(ee.getMessage());
}
%>

34
GNEC

<html>
<body background='fl.jpg'>
<h2> <font color="red"> ADD LINEMAN </h2>
<hr>
<form method=post action='addlm2.jsp'>
<table>
<tr><td>Lineman Id</td><td><input type=text name=zid size=5 value= <%=nzmid %>
></td></tr>
<tr><td>Password</td><td><input type=password name=zpwd size=15></td></tr>
<tr><td>Name</td><td><input type=text name=lname size=15></td></tr>
<tr><td>Address</td><td><input type=text name=addr size=50></td></tr>
<tr><td>Contact No</td><td><input type=text name=cno size=15></td></tr>

</table>
<hr>
<input type=submit value='Create'><input type=reset>
</form>
</html>

<%@ page import="java.sql.*,java.lang.*" %>


<%
Connection con;
Statement stmt,stmt1;
String f1,f2,f3,f4,f5,f6,zn;
int tuid;
ResultSet rs1;
%>

<%
try

35
GNEC

{
con=null;
stmt1=null;
stmt=null;
rs1=null;

zn="";
tuid=Integer.parseInt((String)session.getAttribute("logid"));

f1=request.getParameter("zid");
f2=request.getParameter("zpwd");
f4=request.getParameter("lname");
f5=request.getParameter("addr");
f6=request.getParameter("cno");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:oecmsdsn");

stmt1=con.createStatement();
rs1=stmt1.executeQuery("select zone from zms where uid=" + tuid );
if(rs1.next())
zn=rs1.getString(1);
rs1.close();

stmt=con.createStatement();
stmt.executeUpdate("insert into lms values(" + f1 + ",'" + f2 + "','" + f4 + "','" + f5 + "'," + f6 + ",'"
+ zn + "')");
out.println(" <body background='good3.JPG'><b> <font color='red'> Lineman Successfully
Added.<a href='addlm.jsp'>Add Another?</a>");
con.close();

36
GNEC

}
catch(Exception ee)
{
out.println("<body background='good3.JPG'> <font color='red'> Invalid or incomplete data.<a
href='addzm.jsp'>Try Another?</a>" );

}
%>

Add Zonal Manager


<%@ page import="java.sql.*" %>
<%
Connection con;
Statement stmt;
ResultSet rs;
int nzmid;
%>
<%
nzmid=1001;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:oecmsdsn");
stmt=con.createStatement();
rs=stmt.executeQuery("select max(uid) from zms");
try
{
if(rs.next())
{
nzmid=rs.getInt(1)+1;
if(nzmid<1000)

37
GNEC

nzmid=1001;
}
}
catch(Exception ee)
{
nzmid=1001;
}
}
catch(Exception ee)
{
out.println(ee.getMessage());
}
%>

<html>
<body background='fl.jpg'>
<h2> <font color="red"> ADD ZONAL MANAGER </h2>
<hr>
<form method=post action='addzm2.jsp'>
<table>
<tr><td>Manager Id</td><td><input type=text name=zid size=5 value= <%=nzmid %>
></td></tr>
<tr><td>Password</td><td><input type=password name=zpwd size=15></td></tr>
<tr><td>Zone</td><td><input type=text name=zone size=15></td></tr>
<tr><td>Manager Name</td><td><input type=text name=uname size=15></td></tr>
<tr><td>Address</td><td><input type=text name=addr size=50></td></tr>
<tr><td>Contact No</td><td><input type=text name=cno size=15></td></tr>
</table>
<hr>
<input type=submit value='Create'><input type=reset>
</form>
</html>

38
GNEC

<%@ page import="java.sql.*" %>


<%
Connection con;
Statement stmt;
String f1,f2,f3,f4,f5,f6;
%>

<%
try
{
f1=request.getParameter("zid");
f2=request.getParameter("zpwd");
f3=request.getParameter("zone");
f4=request.getParameter("uname");
f5=request.getParameter("addr");
f6=request.getParameter("cno");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:oecmsdsn");
stmt=con.createStatement();
stmt.executeUpdate("insert into zms values(" + f1 + ",'" + f2 + "','" + f3 + "','" + f4 + "','" + f5 + "',"
+ f6 + ")");
out.println("<body background='l4.jpg'><b>Zonal Manager Successfully Added.<a
href='addzm.jsp'>Add Another?</a>");
con.close();
}
catch(Exception ee)
{
out.println("<body background='l4.jpg'>Invalid or incomplete data.<a href='addzm.jsp'>Try
Another?</a>" );
}
%>

39
GNEC

Associate Complaints
<%@ page import="java.sql.*" %>
<%
Connection con;
Statement stmt,stmt1;
ResultSet rs1;
String f1,f2,f3,f4,zn,sdat;
java.util.Date dt;
int dd,dm,dy;
%>
<%
dt=new java.util.Date();
dd=dt.getDate();
dm=dt.getMonth()+1;
dy=dt.getYear()+1900;
sdat=dd+"/"+dm+"/"+dy;
%>
<%
try
{

f1=request.getParameter("cid");
f2=request.getParameter("lm");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:oecmsdsn");

stmt=con.createStatement();
stmt.executeUpdate("insert into associate values(" + f2 + "," + f1 + ",'" + sdat + "')");
out.println("<body background='l4.jpg'><b>Complaint " + f1+ "associated to lineman " + f2 + "<a
href='newcomp.jsp'>Associate Another?</a>");

40
GNEC

con.close();
}
catch(Exception ee)
{
out.println("<body background='l4.jpg'>Invalid or incomplete data.<a href='complaint.jsp'>Try
Again?</a>" + ee.getMessage() );
}
%>

Customer Login
<%@ page import="java.sql.*" %>
<%
Connection con;
Statement stmt = null;
ResultSet rs;
String tmno;
%>

<%
try
{
tmno=request.getParameter("mno");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:oecmsdsn");

stmt=con.createStatement();
rs=stmt.executeQuery("select * from customer where mno=" + tmno);

41
GNEC

if(rs.next())
{
session.setAttribute("smno",tmno);
response.sendRedirect("coptions.htm");
}
else
out.println("<body background='l4.jpg'>Intruder, Login denied.<a href='index.htm'>Try Another?
</a>" );
}
catch(Exception ee)
{
out.println(ee.getMessage());
}
%>

Post Complaints
<%@ page import="java.sql.*" %>
<%
Connection con;
Statement stmt,stmt1;
ResultSet rs;
int ncomp;
String tmno;
java.util.Date dt;
int dd,dm,dy;
String sdat,zn;
%>
<%
dt=new java.util.Date();
dd=dt.getDate();
dm=dt.getMonth()+1;
dy=dt.getYear()+1900;

42
GNEC

sdat=dm+"/"+dd+"/"+dy;
%>
<%
tmno="";
ncomp=10;
try
{
tmno=(String)session.getAttribute("smno");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:oecmsdsn");
stmt=con.createStatement();
rs=stmt.executeQuery("select max(compno) from complaints");
try
{
if(rs.next())
{
ncomp=rs.getInt(1)+1;
if(ncomp<11)
ncomp=10;
}
}
catch(Exception ee)
{
ncomp=10;
}
}
catch(Exception ee)
{
out.println(ee.getMessage());
}

%>

43
GNEC

<html>
<body background='fl.jpg'>
<h2> <font color="red"> POST COMPLAINT </h2>
<hr>
<form method=post action='complaint2.jsp'>
<table>
<tr><td>Complaint No</td><td><input type=text name=cid size=5 value= <%=ncomp %>
></td></tr>
<tr><td>Meter No</td><td><input type=text name=mno size=15 value= <%=tmno
%>></td></tr>
<tr><td>Complaint</td><td><textarea name=com rows=5 cols=50></textarea></td></tr>
<tr><td>Complaint Date</td><td><input type=text name=cdate size=15 value= <%=sdat
%>></td></tr>
</table>
<hr>
<input type=submit value='Create'><input type=reset>
</form>
</html>

<%@ page import="java.sql.*" %>


<%
Connection con;
Statement stmt,stmt1;
ResultSet rs1;
String f1,f2,f3,f4,zn;

%>

<%
try
{

44
GNEC

zn="";
f1=request.getParameter("cid");
f2=request.getParameter("mno");
f3=request.getParameter("com");
f4=request.getParameter("cdate");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:oecmsdsn");

stmt1=con.createStatement();
rs1=stmt1.executeQuery("select zone from customer where mno=" + f2 );
if(rs1.next())
zn=rs1.getString(1);
rs1.close();

stmt=con.createStatement();
stmt.executeUpdate("insert into complaints values(" + f2 + ",'" + f3 + "','Pending',0,'" + f4 +
"','',"+f1 + ",'" + zn +"')");
out.println("<body background='l4.jpg'><b>YOUR COMPLAINT IS SUCCESSFULLY
REGISTERED! PLEASE PRESERVE YOUR COMPLAINT NUMBER FOR FUTURE
REFERENCE....<a href='complaint.jsp'>Raise Another?</a>");
con.close();
}
catch(Exception ee)
{
out.println("<body background='l4.jpg'>Invalid or incomplete data.<a href='complaint.jsp'>Try
Again?</a>" + ee.getMessage() );
}
%>

Customer Options
<%@ page import="java.sql.*" %>
<%

45
GNEC

Connection con;
Statement stmt,stmt1;
ResultSet rs1;
String f1,f2,f3,f4,zn;

%>

<%
try
{
zn="";
f1=request.getParameter("cid");
f2=request.getParameter("mno");
f3=request.getParameter("com");
f4=request.getParameter("cdate");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:oecmsdsn");

stmt1=con.createStatement();
rs1=stmt1.executeQuery("select zone from customer where mno=" + f2 );
if(rs1.next())
zn=rs1.getString(1);
rs1.close();

stmt=con.createStatement();
stmt.executeUpdate("insert into complaints values(" + f2 + ",'" + f3 + "','Pending',0,'" + f4 +
"','',"+f1 + ",'" + zn +"')");
out.println("<body background='l4.jpg'><b>YOUR COMPLAINT IS SUCCESSFULLY
REGISTERED! PLEASE PRESERVE YOUR COMPLAINT NUMBER FOR FUTURE
REFERENCE....<a href='complaint.jsp'>Raise Another?</a>");
con.close();
}

46
GNEC

catch(Exception ee)
{
out.println("<body background='l4.jpg'>Invalid or incomplete data.<a href='complaint.jsp'>Try
Again?</a>" + ee.getMessage() );
}
%>

<body background='flower.jpg'><img src="comp.jpg" height="250" width=200" align=" left" >


<%@ page import="java.sql.*" %>
<%
Connection con;
Statement stmt = null;
ResultSet rs;
String tmno,cname;
%>

<%
try
{
cname="";
tmno=(String)session.getAttribute("smno");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:oecmsdsn");

stmt=con.createStatement();
rs=stmt.executeQuery("select cname from customer where mno=" + tmno);
if(rs.next())
{
cname=rs.getString(1);

47
GNEC

out.println("<b>Welcome " +cname );


}
catch(Exception ee){}
%>
<br><font color="red"> <b><a href='complaint.jsp' target="main">Register Complaint</a><br>
<a href='vzms.jsp' target="main">View Solution</a><br>
<a href='' target="main">Set Feedback</a><br></b>
<a href='index.htm' target='_top'>Logout</a>
<hr>
</body>
</html>

48
GNEC

9. IMPLEMENTATION SCREENS
Home Page

Figure: Home Page

49
GNEC

Administrator Page

Figure: Add Zonal Manager

50
GNEC

View Zonal Managers

Figure: View Zonal Managers

51
GNEC

View Lineman

Figure: View Lineman

Zonal Manager Login

52
GNEC

Figure: Login Zonal Manager

53
GNEC

Add Lineman

Figure: Add Lineman

View Lineman

54
GNEC

Figure: View Lineman

Complaints

55
GNEC

Figure: Complaints

Lineman Login

56
GNEC

Figure: Login Lineman

View Complaints and Set Status

57
GNEC

Figure: View Complaints and Set Status

View Reports

58
GNEC

Figure: View Reports

Consumer Login

59
GNEC

Figure: Consumer Login

Post Complaint

60
GNEC

Figure: Post Complaint

61
GNEC

Set Feedback

Figure: Set Feedback

62
GNEC

10. TESTING
10.1 Introduction:
Testing is the process of detecting errors for which the required open web application secure
employment portal specifications stated. 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 the software
maintenance.

The aim of testing is often used 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 doesn’t work. The main objective of testing is to uncover an error in
systematic way with minimum effort and time.

Levels of testing
In order to uncover the errors present in different phases the different levels of testing are:
• System Testing
• Function testing

The different types of testing are:


• Unit testing
• Link testing
.

63
GNEC

Unit testing:

This test focuses on verification effort on the smallest unit of software module. Using the detailed
design and the process specifications testing is done to uncover errors within the boundary of the
module. All the modules must be successful in the unit test before the start of the integration testing
begins.

In this project each service is a module like Login, Forms etc. Each module has to be tested by giving
different sets of inputs. The inputs are validated when accepting from user.

Integration testing:
After the unit testing the integration of modules ahs to be done and then integration testing can
be done. The goal here is to see if modules can be integrated properly, the emphasis being on testing
interfaces between different modules.

System Testing:
In the system testing the entire web portal is tested according the software requirement
specifications document.

Acceptance testing:
The acceptance testing is performed with realistic data of the client, which focus on the external
behavior of the system; the internal logic of the program is emphasized.
Software testing is a critical element of software quality assurance and represents the ultimate review
of specification, design and coding. Testing is the exposure of the system to trial input to see whether it
produces correct output.

Testing Phases:
Software testing phases include the following:
• Test activities are determined and test data selected.
• The test is conducted and test results are compared with the expected results.

64
GNEC

Testing Methods:
Testing is a process of executing a program to find out errors. If testing is conducted
successfully, it will uncover all the errors in the software.
Any testing can be done basing on two ways:
• White Box Testing
• Black Box Testing

White Box Testing:


It is a test case design method that uses the control structures of the procedural design to derive
test cases.
Using this testing a software Engineer can derive the following test cases:
• Exercise all the logical decisions on either true or false sides.
• Execute all loops at their boundaries and within their operational boundaries.
• Exercise the internal data structures to assure their validity.
Black Box Testing
It is a test case design method used on the functional requirements of the software. It will help a
software engineer to derive sets of input conditions that will exercise all the functional requirements of
the program.
Black Box testing attempts to find errors in the following categories:
• Incorrect or missing functions
• Interface errors
• Errors in data structures
• Performance errors
• Initialization and termination errors
By black box testing we derive a set of test cases that satisfy the following criteria:
• Test cases that reduce by a count that is greater than one
• The number of additional test cases that must be designed to achieve reasonable testing.

1. Test Plan

Testing can be done in two ways:


Bottom up approach
Top down approach

65
GNEC

Bottom up approach:
Testing can be performed starting from smallest and lowest level modules and proceeding one at a
time. For each module in bottom up testing a short program executes the module and provides the
needed data so that the module is asked to perform the way it will when embedded with in the larger
system. When bottom level modules are tested attention turns to those on the next level that use the
lower level ones they are tested individually and then linked with the previously examined lower level
modules.

Top down approach:


This type of testing starts from upper level modules. Since the detailed activities usually performed in
the lower level routines are not provided stubs are written. A stub is a module shell called by upper
level module and that when reached properly will return a message to the calling module indicating
that proper interaction occurred. No attempt is made to verify the correctness of the lower level
module.

66
GNEC

10.2 Test Cases

Module: login security


File Name: Login.jsp
Test Input ExpOutput ActOutput Desc
Case
Valid Uid,pwd, Success Success Test Passed. Control
login utype transferred to menu.
Invalid Uid, pwd, Failed Failed Test Passed. Try again.
Login utype

File Name: lineman.jsp


Test Input ExpOutput ActOutput Desc
Case
Create Linemen Success Success Test Passed. Linemen saved
Linemen Info to db and provided id,pwd.
Create Linemen Failed Failed Test Passed. Invalid or
Linemen Info incomplete details.

File Name: feedback.jsp


Test Input ExpOutput ActOutput Desc
Case
Set Meter, Success Success Test Passed. Feedback
Feedbac feedback Saved.
k info
Set Meter, Failed Failed Test Passed. Incomplete
Feedbac feedback details, try again.
k info

11. CONCLUSION

67
GNEC

This application effectively handles customer complaints and provides solutions. This model can
now be extended to different states for the implementation of Electrical Complaint Monitoring
system. The system has reduced the physical communication between the citizen and the various
departments of the Electricity Board. It has also reduced the physical communication between the
various staff of the Electricity Board. As the system is transparent, the citizen is sure to benefit from
a timely reply when complaints are placed.

68

You might also like