Submitted to:SANJEEV GUPTA: Submitted by:MOHITA MOHINDROO

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 58

Submitted to:SANJEEV GUPTA

Submitted by:MOHITA MOHINDROO


ACKNOWLEDGMENT

I take this opportunity to express our


deep sense of gratitude to our
honorable Training Guide,Mr Sanjeev
k Gupta ,who has always been a source
of inspiration for all of us. Under his
able guidance, I have learnt how to
overcome and succeed against the odds
and trying circumstances.

I am also thankful to our lab


instructors Mr Vijay Kumar guidance
to make this project work successfully.
Many thanks go to my friends Mr.Rohit
Gupta, Mr.Varun khanna ,Ms Nidhi
khanna who have been a great
guidance and source of inspiration
throughout my project. I am very
grateful for their valuable input.

Most of all, thanks to my parents, who


have been really very supporting and
encouraging throughout our project.

-Mohita Mohindroo
Summary

Team size :1

Name of project : Yellow pages of Chandigarh

Technology to be used :Java

Backend : Java Server Pages,Ms access


ABOUT DOEACC

DOEACC Society is an autonomous


Scientific Society of the Department of
Information and Technology, Ministry
of Communications & information
Technology, government of India, set up
to carry out Human Resource
Development and related activities in
the area of Information, Electronics and
Communication Technology (IECT).

The DOEACC Society is functioning


under the overall control and guidance
of the Governing Council. Hon’ble
Minister, for Communications and
Information Technology, Govt. of India,
is the Chairman of the Council. The
members of the Council are from the
varied field of academia, Govt.
Organizations, industrial sectors and
representatives from various
professional bodies. The society has a
Management Board headed by
Secretary, Department of Information
Technology, Govt. of India. It has a
nationwide presence with 11 centres
across the country. Each Centre has an
Executive Committee with
representatives of respective State
Governments and local industries, for
effective implementation of the decisions
of the Council.

The Society is engaged both in the


formal and non formal education in the
area of IECT besides development on
industry oriented quality education in
the area of IECT besides development of
industry oriented quality education and
training in the state-of-art areas.
YELLOW PAGES FOR
CHANDIGARH CITY

INTRODUCTION

A particular Yellow Pages(YP) is a print directory which


provides all the listeing of businesses within a specific
geographical area(e.g ,delhi or Chandigarh)which are
segregated under heading for similar type of businesses.
Today, the expression Yellow Pages is used globally, in
both  English-speaking  and non-English speaking
countries. In the United States, it refers to the category,
while in some other countries it is a registered name and
therefore a proper noun. The term Yellow Pages is not a
registered name within the United States and is freely used
by many companies.
In  Belgium, the  Czech Republic, the Republic of
Ireland, Israel, the  Netherlands, and  Romania the 'Yellow
Pages' are known as theGolden Pages.

Purpose

This documentation describes the software requirement


and specification for a online directory ie ”YELLOW
PAGES”.The document is intended for the customers ie,
the inet users.The users are assumed to have the basic
knowledge of using internet.
System interfaces

Interface :
The software provides good graphical interface for the
front end of the database and a good informative interface
for the rear end.

Hardware Interface :-

The system should have these hardware requirements :


 The processor should be at least Pentium 3 or above
 The processor speed should be greater than 400Mhz
 The video device should support graphics
 Ram should be or greater than 120 mb

Software Requirements

The software requires the support of the following soft


wares for the database and other requirements

 html editor for web interface


 text editor (notepad)
 Mysql for database
 Server(windows 2000,apache tomcat or…)

Site adaption requirements

 The browser should support java.


 The browser should be at least netscape navigator v
4.0.
User characteristics

 No pre knowledge of html


 No pre knowledge of database management
 No pre knowledge of Java server Pages
 Should be familiar with internet
 Should know English

Performance Requirements :-

Performance requirements are :


1. good working pc with all the requirements as stated
in the hardware interfaces
2. works for medium size information databases
3. should not be overloaded

Future Developments :-
 multiple user interface
 support for large database
Apache Tomcat Server

Apache Tomcat  (or Jakarta Tomcat  or simply Tomcat) is


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

Experienced users can build and install Tomcat manually


from source code after installing such dependencies as
the Java Development Kit  and the Apache Ant build tool.
Depending on the usage scenario, Tomcat may either be
deployed as a standalone pure-Java web server or as a
component in a more complex configuration in which it
serves as a back-end which handles requests passed to it
from a general purpose web server such as  Apache.
MICROSOFT ACCESS AS DATABASE

Microsoft Office Access, previously known as Microsoft


Access, is a pseudo-relational database management
system  from Microsoft  that combines the
relational Microsoft Jet Database Engine  with a graphical
user interface  and software-development tools. It is a
member of the  Microsoft Office  suite of applications,
included in the Professional and higher editions or sold
separately. In mid-May 2010, the current version Microsoft
Office Access 2010 was released by Microsoft in Office
2010; Microsoft Access 2007 was the prior version.
Microsoft Access is used to create
simple  database solutions. 
Access also includes a  query interface, forms to display
and enter data, and reports for printing.It is  multiuser-
aware and handles  record-locking  and referential integrity
including  cascading,  updates and  deletes.

Microsoft Access offers several ways to secure the


application while allowing users to remain productive.
The most basic is a database password. Once entered, the
user has full control of all the database objects. This is a
relatively weak form of protection which can be easily
cracked.
A higher level of protection is the use of workgroup
security requiring a  user name and password. Users and
groups can be specified along with their rights at
the object type or individual object level. This can be used
to specify people with readonly or data entry rights but
may be challenging to specify.
Database Design:-

A decade ago, database was unique to large corporations


with mainframes. Today it is recognized as a standard of
MIS and is available for virtually every size of computer.
Before the database concept became operational, users
had programs that own data independent of other users. It
was a conventional file environment, common data are
available and used by several users. Instead of each
program managing its own data, data across application
are shared by authorized users with the database software
managing the data as an entity.
A program now requests data through the data base
management system, which determines data sharing. For
storing the data of the users, the database design becomes
very crucial and important part of the system.

Objectives Of Database:

The general theme behind a database is to handle


information as an integrated whole. There is none of
artificiality that is normally embedded in separate files or
applications. A database is a collection of interrelated data
stored with minimum redundancy to serve many users
quickly and efficiently. The general objective is to make
information access easy, quick, and inexpensive and
flexibility for the user. In database design, several specific
objectives are considered:

Controlled Redundancy

Redundancy in data occupies space and therefore, is


wasteful. If versions of the same data are in different
phases of updating, the system often gives conflicting
information.
A unique aspect of database design is storing only once,
which controls redundancy and improves system
performance.

Accuracy And Integrity

The accuracy of a database ensures that quality and


contents remain constant. Integrity controls and detects
inaccuracies where they occur.

Data Integration

It refers to the fact that data is stored physically at


different locations, but logically the information is
centralized.

Data Integrity
It means storing all the data. This leads to more
consistency, less redundancy and reduces direct access
storage requirement.

Data Independence

It is the insulation of application programs from changing


aspects of physical data organization
Explanation of modules
header
First is the Header file,which includes sign up and login
buttons.by clicking on the SIGN UP button,the New
Registeration form is opened.and if are already a member
for using the software,u can opt for the LOGIN button.

Newuser
This is the new user registeration form.user have to fill it
up because without it,the processing of the software
cannot be judged.

Newuserv
This is the backend form for newuser,which connects the
form with the database(yellowpages).the values entered at
the time of registeration are now added to the
database.next the user have to click on the okay button
after verifying the values he had entered.The page then
goes to the LOGIN screen.

Login
The login screen asks the Userid and password with the for
the authentication
CHKLOGIN
The chklogin frame verifies the userid and password from
the database and if it is verified,it opens the homepage.and
the controls goes to index file.

INDEX
The index file checks the session for the user,and displays
the contents of the homepage by referring the control to
advsdisp frame.

ADVSDISP
The advsdisp frame gets the advertisement id and name
from the database ,checks the content and display it on the
screen.
SHOWSUB
The showsub frame displays the sub contents of the
homepage that is the title of of sub-category choosen.

SHOWADV
This frame displays the details and information of the
subcategory choosen

Source code
Header

<html>
<head>
<title>Untitled Document</title>
<link href="c.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
background-color: #FFFF01;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
</style>
</head>

<body>
<div class="whole">
<div class="new"><img src="top.jpg" border="0"
usemap="#Map" />
<map name="Map" id="Map">
<area shape=rect coords=269,26,467,145
href=newuser.jsp />");
<area shape=rect coords=531,12,769,137
href=login.jsp />");

}
%>

</map>
</div>
<div class="middle"><img src="mid.jpg"
width="995" height="389" /></div>
<div class="bot"></div>
</div>
</body>
</html>
Headers.jsp
<body background=mid.jpg>
<br><h2 align=right><a href=logoff.jsp>logoff</a>
</h4>
</body>

Index.jsp

<%@ include file="headers.jsp" %>


<%
if (session.getAttribute("tuserid") != null)
{
%>
<center>
<%@ include file="advsdisp.jsp" %>
</center>
<%
}
else
{
out.println(" <a href=login.jsp> Login Again</a>
");
}

%>

Login.jsp

<%@ include file="headers.jsp" %>


<style type="text/css">
<!--
.style6 {font-size: xx-large}
-->
</style>

<body background="mid.jpg"
<h1 class="new"><span class="new">Login Screen
</span></h1>
<span class="new"><b><font color=red> <i> <span
class="mn">UserId and Password is Case
Sensitive</span></i></font></b></span><b><font
color=red><i><span class="mn"></span><br>
</i>
</font></b>
</center>
<form align="right" cname=myform method="post"
action="chklogin.jsp">
<table width="601" height="244" border=1
align=center cellpadding="1" cellspacing="2"
bgcolor="#ffffff">
<tr>
<td width="237" height="74" align="right"> <span
class="style6"><font color="#FFFF00">
UserId:</font></span>
<td width="218"><input type=text name=uid
maxlength=50>
<tr>
<td height="94" align="right"><p><font
color="#FFFF00"><b><span class="style2
style6">P</span></b><span class="style4
style6">assword </span><span
class="style4">:</span></font> </p>

<td> <input type=password name=pass


maxlength=50>
<tr>
<td height="66" colspan="2" align="center">
<input type=submit name=submit value="Login">
</table>
</form>
LOGOFF.jsp
<%
session.setAttribute("tuserid",null );
response.sendRedirect("header.jsp");
%>
Newuser

<html>
<head> <title> New User </title>
</head>
<body background="mid.jpg">

<center>
<h2><font color="#339900" size="+3" face="Verdana,
Arial, Helvetica, sans-serif">New User Registeration
Form</font></h2>
</h1></center>

<Form name="myform" method="get"


action="newuserv.jsp">
<table background="yel.jpg" height="500"
width="500" border =2 align="center">
<tr>
<td height="25">First Name:<td width="25"
height="25">
<input type="text" name="firstname"
maxlength=20>
<tr>
<td height="25"> Last Name:<td height="25">
<input type="text" name="lastname"
maxlength=200>
<tr>
<td height="23"> User Id:<td height="23">
<input type="text" name="uid" maxlength=30
size=30>
<tr>
<td height="25">Password:<td height="23">
<input type="password" name="pass"
maxlength="20">

<tr>
<td height="23"> Gender: <td height="23">
<input type="radio" name="sex" value="M"
checked> Male
<input type="radio" name="sex" value="F">
Female
<tr>
<td height="25">Date of Birth:<td height="25"><select
name="date1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<select name="month1">
<option value="jan">January</option>
<option value="feb">February</option>
<option value="march">March</option>
<option value="april">April</option>
<option value="may">May</option>
<option value="june">June</option>
<option value="july">July</option>
<option value="aug">August</option>
<option value="sept">September</option>
<option value="oct">October</option>
<option value="nov">November</option>
<option value="dec">December</option>
</select>

<select name="year1">
<option value="1900">1990</option>
<option value="1901">1991</option>
<option value="1900">1992</option>
<option value="1900">1993</option>
<option value="1900">1994</option>
<option value="1900">1995</option>
<option value="1900">1996</option>
<option value="1900">1997</option>
<option value="1900">1998</option>
<option value="1900">1999</option>
<option value="1900">2000</option>
<option value="1900">2001</option>
<option value="1900">2002</option>
<option value="1900">2003</option>
<option value="1900">2004</option>
<option value="1900">2005</option>
<option value="1900">2006</option>
<option value="1900">2007</option>
<option value="1900">2008</option>
<option value="1900">2009</option>
<option value="1900">2010</option>
</select>
<tr>
<td height="23"> Email : <td height="23">
<input type="text" name="email" size=40
maxlength=40>
<tr>
<td height="23" colspan="2" align="center"
valign="bottom">
<input type="submit" name="submit"
value="Submit">
<input type="reset" name="reset" value="Clear
Form">
</table>
</form>
</body>
</html>

NEWUSERV

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


<%
out.println("<body background=mid.jpg>");

try
{
String sql = "Insert into newuser
(fname,lname,uid,pass,sex,date1,month1,year1,email)
values('"+ request.getParameter("firstname")+"','"+
request.getParameter("lastname") + "','" +
request.getParameter("uid") + "','"+
request.getParameter("pass") + "','" +
request.getParameter("sex")
+"','"+request.getParameter("date1") + "','"
+request.getParameter("month1") + "','"
+request.getParameter("year1") + "','"
+request.getParameter("email")+"');";
out.println( sql) ;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:odbc:YellowPages");
Statement stmt = con.createStatement();
stmt.executeUpdate( sql ) ;
stmt.close();
con.close();
}
catch(Exception e)
{
out.println(e);
}

out.println("<br><h2 align=center>Account Successfully


Registered .... </h2>") ;

out.println(" <br><h4 align=center><a


href=login.jsp>OK</a> </h4>");
%>

SHOWADV
<%@ page import="java.sql.*" %>
<br />
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
Connection con2 =
DriverManager.getConnection("jdbc:odbc:YellowPages") ;
Statement stmt2 = con2.createStatement() ;

String sql2 = new String("select * from advertisement


where advsid=" +
request.getParameter("txtadvsid") + "
and subadvsid=" +
request.getParameter("tsubadvsid")) ;

out.print(sql2) ;
ResultSet rs2 = stmt2.executeQuery(sql2) ;
if (rs2.next() == false)
{
out.print("Sorry No INFORMATION HAS
UPLOADED YET") ;
}
else
{
int cnt=0 ;
out.print("<table border=1 bgcolor=#FFFF33
bordercolor=#000000 align=center>") ;

out.print("<tr><th>Sr.No.</th><th>TITLE</th><th>Detai
l</th><th>View Adv.</th></tr>") ;
do
{

out.print("<tr><td>" + (++cnt) + "</td>");


out.print("<td>" + rs2.getString("title") +
"</td>");
out.print("<td> " + rs2.getString("detail") +
"</td>");

} while(rs2.next()) ;
out.print("</table>");
}

rs2.close() ;
con2.close() ;
}catch(Exception e){
out.println("error occured: "+e);}
%>

Showsub

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


<%@ include file="headers.jsp" %>

<%
if (session.getAttribute("tuserid") != null)
{ %>
<table width="100%" border="1">
<tr>
<td colspan="2" ><%@ include file="advsdisp.jsp"
%></td>
</tr>
<tr>
<td width="25%" valign="top" >
<%

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
Connection con1 =
DriverManager.getConnection("jdbc:odbc:YellowPages") ;
Statement st1 = con1.createStatement() ;

String sql1 = new String("select * from subadvs where


advsid=" +
request.getParameter("txtadvsid")) ;

ResultSet rs1 = st1.executeQuery(sql1) ;


if (rs1 != null)
{
rs1.next() ;
do
{
String tadvsid = rs1.getString("advsid") ;
String tsubadvsname =
rs1.getString("subadvsname");
String tsubadvsid = rs1.getString("subadvsid");
out.print("<br><a href=showsub.jsp?txtadvsid="
+ tadvsid + " + "+tsubadvsid + "+ " + tsubadvsname + "</a>
") ;

} while(rs1.next()) ;
}
rs1.close() ;
con1.close() ;
%>

</td>
<td width="75%" >
<%
if (request.getParameter("tsubadvsid") != null)
{
%>
<%@ include file="showadv.jsp" %>
<% }
%>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<%
}
else
response.sendRedirect("login.jsp") ;
%>

Advs
<%@ page import="java.sql.*" %>
<form name=myform method=post
action=showsub.jsp>
<select name=txtadvsid>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
;
Connection con =
DriverManager.getConnection("jdbc:odbc:YellowPag
es") ;
Statement st = con.createStatement() ;

String sql = new String("select * from advs") ;


ResultSet rs = st.executeQuery(sql) ;
if (rs != null)
{
rs.next() ;

do
{
String tadvsid = rs.getString("advsid") ;
String tadvsname =
rs.getString("advsname");
out.print("<option value=" + tadvsid + ">" +
tadvsname + "</option>") ;

} while(rs.next()) ;

}
rs.close() ;
con.close() ;
}
catch(Exception e){
out.println("error occured: "+e);}

%>
</select>
<input type=submit>
</form>

ADVSDISP
<%@ page import="java.sql.*" %>
<%
try{
if (session.getAttribute("tuserid") != null)
{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
;
Connection con =
DriverManager.getConnection("jdbc:odbc:YellowPag
es") ;
Statement st = con.createStatement() ;

String sql = new String("select * from advs") ;


ResultSet rs = st.executeQuery(sql) ;
if (rs != null)
{
rs.next() ;
do
{
String tadvsid = rs.getString("advsid") ;
String tadvsname =
rs.getString("advsname");
out.print("<a href=showsub.jsp?txtadvsid="
+ tadvsid + ">" + tadvsname + "</a> || ") ;
} while(rs.next()) ;

}
rs.close() ;
con.close();
}
else
response.sendRedirect("login.jsp") ;
}
catch(Exception e){
out.println("error occurred:” +e);
}
%>
Snapshots of database
BIBLIOGRAPHY

 Java server pages by LarnePekowsky

 Jsp Complete Reference

 Pure JSP Java Server Pages A code intensive


premium Reference

You might also like