Professional Documents
Culture Documents
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
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
To Track the complaints given by the residents online and providing them with respective solutions.
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.
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.
4
GNEC
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
3. OVERALL DESCRIPTION
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.
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
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
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.
8
GNEC
Software Requirement
Operating System : Windows 2000 or Higher
Platform : Java
Scripting : JSP
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
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.
10
GNEC
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
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
13
GNEC
Clients
Administrator Zonal Lineman Customer
Manager
Application OECMS
Integrate Jdbc-odbc
14
Data SQL
GNEC
15
GNEC
16
GNEC
17
GNEC
18
GNEC
19
GNEC
20
GNEC
21
GNEC
22
GNEC
7. IMPLEMENTATION
23
GNEC
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.
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.
24
GNEC
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.
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 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
28
GNEC
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.
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
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>
</HEAD>
<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>
<%
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>" );
}
%>
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
<%
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>
%>
<%
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() );
}
%>
<%
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
48
GNEC
9. IMPLEMENTATION SCREENS
Home Page
49
GNEC
Administrator Page
50
GNEC
51
GNEC
View Lineman
52
GNEC
53
GNEC
Add Lineman
View Lineman
54
GNEC
Complaints
55
GNEC
Figure: Complaints
Lineman Login
56
GNEC
57
GNEC
View Reports
58
GNEC
Consumer Login
59
GNEC
Post Complaint
60
GNEC
61
GNEC
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
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
1. Test Plan
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.
66
GNEC
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