Social Networking Site: Computer Science and Engineering

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 65

“SOCIAL NETWORKING SITE”

A
PROJECT REPORT
SUBMITTED IN FULFILLMENT FOR THE
AWARD OF THE DEGREE
OF
BATHELOR OF ENGINEERING
IN
COMPUTER SCIENCE AND ENGINEERING
ON
“SOCIAL NETWORKING SITE”

2010

RAJIV GANDHI PRODHYOGIKI


VISHWAVIDHALAY,
BHOPAL (M.P.)

Guided by: Submitted by:


Mr. Roopesh Kumar Roshni Mittal
Mr. Jitendra Dangra Sangeeta Sewani
(Lect. CSE Dept.) CSE 3rd year
MANDSAUR INSTITUTE OF TECHNOLOGY,
MANDSAUR

DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE

This is to certify that this project work entitled


“SOCIAL NETWORKING SITE”
Has been carried out successfully by
Sangeeta Sewani
of
Third Year B.E. Computer Science and Engineering
In partial fulfillment of requirement of
RAJIV GANDHI PRODHYOGIKI VISHWAVIDHALAY, BHOPAL(M.P.)
For the award of Bachelor’s Degree

Mr. Roopesh Kumar Mr. Amit Jain


Mr. Jitendra Dangra (H.O.D)
Project Guide Department of CSE
Department of CSE
Mr. Ramgopal
Director
MANDSAUR INSTITUTE OF TECHNOLOGY,
MANDSAUR

DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE

This is to certify that this project work entitled


“SOCIAL NETWORKING SITE”
Has been carried out successfully by
Roshni Mittal
of
Third Year B.E. Computer Science and Engineering
In partial fulfillment of requirement of
RAJIV GANDHI PRODHYOGIKI VISHWAVIDHALAY, BHOPAL(M.P.)
For the award of Bachelor’s Degree

Mr. Roopesh Kumar Mr. Amit Jain


Mr. Jitendra Dangra (H.O.D)
Project Guide Department of CSE
Department of CSE
Mr. Ramgopal
Director
DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

APPROVAL
CERTIFICATE

This is to certify that this project work entitled


“SOCIAL NETWORKING SITE”

Has been carried out successfully by


Sangeeta Sewani
of
B.E. Third Year CSE
During the academic year 2009-2010
In partial fulfillment of requirement of

RAJIV GANDHI PRODHYOGIKI VISHWAVIDHALAY,


BHOPAL(M.P.)
For the award of Bachelor’s Degree

Internal Examiner External Examiner


DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

APPROVAL
CERTIFICATE

This is to certify that this project work entitled


“SOCIAL NETWORKING SITE”

Has been carried out successfully by


Roshni Mittal
of
B.E. Third Year CSE
During the academic year 2009-2010
In partial fulfillment of requirement of

RAJIV GANDHI PRODHYOGIKI VISHWAVIDHALAY,


BHOPAL (M.P.)
For the award of Bachelor’s Degree

Internal Examiner External Examiner


ACKNOWLEDGMENT
The completion of any task depends upon the cooperation, coordination and
consol dative efforts of several resources of knowledge, energy, time and
above all, the proper guidance of the veterans. Therefore, we approach this
matter of acknowledgement thorough the following lines.

First and foremost, we would like to pay our sincere homage and regards to
the almighty God, with whose blessings we have successfully completed our
project work. We wish to thank the Authorities of Mandsaur Institute Of
Technology, and also express our deepest sense of gratitude toward our
project incharge, Mr. Jitendra Dangra (Lect. CSE) and Mr. Roopesh Kumar
(Lect. CSE) for their invaluable guidance, encouragement criticism and
helpful suggestions.

We are also thankful to Mr. Amit Jain (HOD, CSE) for his kind and sincere
coordination for the project.

We are very thankful to our parents for their sacrifices, devotion and love
during the course of this project work.

Last but the least, we wish to thank all those noble hearts who directly or
indirectly helped us to complete this project work.

Roshni Mittal
ACKNOWLEDGMENT
The completion of any task depends upon the cooperation, coordination and
consol dative efforts of several resources of knowledge, energy, time and
above all, the proper guidance of the veterans. Therefore, we approach this
matter of acknowledgement thorough the following lines.

First and foremost, we would like to pay our sincere homage and regards to
the almighty God, with whose blessings we have successfully completed our
project work. We wish to thank the Authorities of Mandsaur Institute Of
Technology, and also express our deepest sense of gratitude toward our
project incharge, Mr. Jitendra Dangra (Lect. CSE) and Mr. Roopesh Kumar
(Lect. CSE) for their invaluable guidance, encouragement criticism and
helpful suggestions.

We are also thankful to Mr. Amit Jain (HOD, CSE) for his kind and sincere
coordination for the project.

We are very thankful to our parents for their sacrifices, devotion and love
during the course of this project work.

Last but the least, we wish to thank all those noble hearts who directly or
indirectly helped us to complete this project work.

Sangeeta Sewani
CONTENTS

1. INTRODUCTION
1.1. Project definition
1.2. Project description
1.3. Team structure
1.4. Need and scope
2. REQUIREMENT ANALYSIS
2.1. Software requirement
2.2. Hardware requirement
2.3. Non functional requirements
3. FEASIBILITY ANALYSIS
3.1. Technical feasibility
3.2. Economical feasibility
3.3. Operational feasibility
4. TECHNOLOGY USED
5. RISK ANALYSIS
6. PLANNING AND DESIGNING
6.1. Planning
6.2. Design principles
6.3. Process model used
6.4. Use case diagram
6.5. ER diagram
6.6. Data flow diagram
7. CODING
8. PROJECT SCREENS
9. TESTING
10. FUTURE ENHANCEMENT
11. LIMITATIONS OF PROJECT
12. BIBLIOGRAPHY
Books & Material

1. Complete Reference of JAVA


Author: Herbert Schieldt
Publisher: Tata McGraw Hill

2. Software Engineering
Author: Pressman Rogers

Web References
• http://www.w3schools.com
• http://www.converyourasp.com
• http://www.microsoft.com/education/Tutorials.aspx
• http://www.msdn.microsoft.com
• http://www.google.com
INTRODUCTION
INTRODUCTION

1.1 DEFINITION
Social Networking Site basically means any type of relationship-building amongst
a group of people with a common interest (business or personal). However, that
term has taken on a whole new dimension online, where social networking sites
(My Space, Linked In, Face book) are popping up faster than you can say "Will
you be my friend?" These Web sites are designed around helping people network
and build relationships via online, instead of the more traditional face-to-face
networking meetings.

1.2 PROJECT DESCRIPTION

A social networking site is web based service that allow individuals to interact via
online across the world .It allow group of people to interact socially ,allowing one or
more individual interacting directly or indirectly with others.The project describes
the capabilities that will be provided by the software application “social networking
site” It basically means any type of relationship-building amongst a group of people
with a common interest (business or personal). However, that term has taken on a
whole new dimension online, where social networking sites (My Space, Linked In,
Face book) are popping up faster than you can say "Will you be my friend?"
These Web sites are designed around helping people network and build
relationships via online, instead of the more traditional face-to-face networking
meetings.
1.3 TEAM STRUCTURE
A typical development team includes software engineers, QA and testing
specialists, as well as dedicated or part-time graphic designers, technical writers, system
engineers, and other supporting professionals. Each team has a Project Leader, who is
responsible for technical leadership, task assignments, supervision of team members, and
daily communications with the client.

Project teams are organized into Development Departments. A Software Department


Manager leads each group, managing the performance of several project teams and their
project leaders.

These were the individual part done by all of us while completing the project, but we help
each other in all the part in making it better.

Catalyst – We hit the ground running and sprint to the finish

Culture- our different experiences and backgrounds brings diversity to the group.

Appreciation- we appreciate each other’s ideas treat one another with respect.

Talents- as a team we combine our talents while we complete our objectives.

Animated- When we work together we are alert and energetic.

Linked- unity will be a fundamental component of our team’s successfulness.

Yesterday- punctuality and evaluation of our efficiency is high among our values.

Skills- we understand we have much strength within the group. We plan to use it.

Target- in our ascent to the peak, our focus will be a great motivator.

There is the possibility that we will spend too much time finalizing ideas and completing
projects because we all have different end products in mind. However, that will ensure
that everybody is happy with the final project and that we all feel like we contributed
something positive to the project. We also feel that our team composition will be

beneficial to the team because our different skill sets and backgrounds will allow us to
generate and share different perspectives amongst the team.

1.4 NEED & SCOPE:


While developing this project it has been seen that following objectives must be

achieved:

• User Friendliness:

The primary objective of this project is User Friendliness, because


User interface design creates an effective communication medium between a human
and a computer. If the software is difficult to use, then it would tend to arise many
problems.. Keeping al these things in view in view, I have designed thee screen
layouts which are east to use and it allows user interaction to be interruptible.

• Least Maintainability:

Software maintainability concerns with the ease with which repair


may be made to the software as indicated by the following sub attributes:
analyzability, changeability, stability and testability.
Reliability:

Since software reliability is defined in statistical terms as “the probability


of failure-free operation of a computer program in a specified environment for a
specified time”. This project will be a reliable one based on the existing
information of Project.

• Portability:

Portability concerns with the ease with which the software can be
transported from one environment to another as indicated by the following sub
attributes: adaptability, install ability, conformance, and replace ability.
REQUIIRMENT
ANALYSIS
REQUIIRMENT
ANALYSIS
2.1 SOFTWARE REQUIREMENTS
• Operating system platform Microsoft Windows
2000/XP/NT

• Development Environment ECILPSE TOOL

• Language JAVA

• Database MYSQL SERVER 5.0

2.2 HARDWARE REQUIREMENTS


• Hardware Pentium processor
• Hard disk 40 GB
• RAM 512 MB

2.3 NON-FUNCTIONAL REQUIREMENTS


Describe a verification system that limits our choice for developing a solution to
the problem.The system must be reliable enough in most situations .The system
must be correct to a high degree. Extensibility is also a key requirement to make
the application compatible with the ever-changing world of present day computers
and to enhance its functionality from time to time as desired.

FEASIBILITY
ANALYSIS
FEASIBILITY
ANALYSIS
In any project, feasibility study is a very important stage. Feasibility study is system
proposal according to its workability, impact on the operation, ability to meet user needs
and efficient use of resources. Any project may face scarcity in resources, time or
workforce. An important outcome of the preliminary investigation is the determination
whether the system requested is feasible or not. The key considerations involved in the
feasibility analysis are technical, operational, and economic.

3.1 Technical Feasibility


Technical feasibility is the most important of all types of feasibility analysis.
Technical feasibility deals with hardware as well as software requirements. An idea from
the outline design to system requirements in terms of inputs outputs, files and procedures
is drawn and the type of hardware, software, and the methods required for running the
system are analyzed. Keeping in mind of the above considerations, the resource
availability for this project is observed and is found that the project team has sufficient
resources to develop the current project; hence the system is technically feasible.

3.2 Economic Feasibility


Economic analysis is the most frequently used method for evaluating the
effectiveness of the software, more commonly known as the cost /benefit analysis. The
procedure is to determine the benefits and savings that are expected from a candidate
system and compare them with costs. If the benefits outweigh cost, the decision is made
to design and implement the system; otherwise further alternatives have to be made.

Here it is seen that no new hardware or software is needed for the development of the
system. Hence the project is economically feasible for development.

3.3 Operational Feasibility


The purpose of the operational feasibility study was to determine whether the
new system will be used if it is developed and implemented? Will there be resistance
from users that will undermine the possible application benefits? From the different
benefit gained from the software, it is found that the positive response will come from the
user as well as operations in the system are very easy which will make it more popular
among administrator as well as users so system is Operational feasible.
TECNOLOGY USED
TECNOLOGY
USED
4.1 JAVA
4.2 Development environments:
• ECILPSE TOOL
RISK ANALYSIS
RISK ANALYSIS
Every system must provide built-in features for security and integrity of data. Without
safeguards against unauthorized access, fraud, embezzlement, fire, and natural disaster, a
system could be so vulnerable as to threaten the survival of the organization. Systems
security refers to the technical innovations and procedures applied to the hardware and
operating system to protect against deliberate or accidental damage from a defined threat.
It is the protection of data from loss, disclosure, modification, and destruction.

The objective of data security can be divided into three separate, but interrelated, areas as
follows.

Secrecy

It is concerned with improper disclosure of information. The terms


confidentiality or non-disclosure are synonyms for secrecy.

Integrity

It is concerned with improper modification of information or processes.

Availability

It is concerned with improper denial of access to information. The term denial of


service is also used as a synonym for availability.

What is it? Risk analysis and management are a series of steps that help a software team
to understand and manage uncertainty. Many problems can plague a software project. A
risk is a potential problem—it might happen, it might not. But, regardless of the outcome,
it’s a really good idea to identify it, assess its probability of occurrence, estimate its
impact, and establish a contingency plan should the problem actually occur. Who does it?

Everyone involved in the software process—managers, software engineers, and


customers— participate in risk analysis and management. Why is it important? Think
about the Boy Scout motto: “Be prepared.” Software is a difficult undertaking. Lots of
things can go wrong, and frankly, many often do. It’s for this reason that being prepared
— understanding the risks and taking proactive measures to avoid or manage them—is a
key element of good software project management. What are the steps? Recognizing
what can go wrong is the first step, called “risk identification.” Next, each risk is
analyzed to determine the likelihood that it will occur and the damage that it will do if it
does occur. Once this information is established, risks are ranked, by probability and
impact. Finally, a plan is developed to manage those risks with high probability and high
impact.
PLANING AND DESIGNING

PLANING AND DESIGNING

6.1 Planning

Planning involves estimation—your attempt to determine how


much money, how much effort, how many resources, and how much
time it will take to build a specific software-based system or product.
Who does it? Software managers—using information solicited from
customers and software engineers and software metrics data collected
from past projects. Why is it Important? Would you build a house
without knowing how much you were about to spend?
Of course not, and since most computer-based systems and products
cost considerably more to build than a large house, it would seem
reasonable to develop an estimate before you start creating the
software. What are the steps? Estimation begins with a description of
the scope of the product. Until the scope is “bounded” it’s not possible
to develop a meaningful estimate. The problem is then decomposed
into a set of smaller problems and each of these is estimated using
historical data and experience as guides. It is advisable to generate
your estimates using at least two different methods (as a cross check).
Problem complexity and risk are considered before a final estimate is
made.

6.2 Design Principles


Design is a meaningful engineering representation of something that is to be built.
It can be traced to a customer's requirements and at the same time assessed for for quality
against a set of predefined criteria for 'good' design. In the software engineering context,
design focuses on four major areas of concern, data, architecture, interfaces, and

components. In this section, we present design-engineering resources that address:

Tools developed to assist students in understanding at this micro level should address the
following design principles:

Literate
 programming (Knuth, 1984; Shum & Cook, 2002) provides a perspective on
the programming process where the focus is on integrating (formally) the informal
descriptions of the program’s functions with the formality of the programming language
instructions. While the inclusion of comments in code is generally accepted as good
practice there are few tools that require, or support, it in a tightly coupled and formal
way. There is some evidence ((Bonar & Soloway, 1983; Bruckman & Edwards, 1999)) to
indicate that a significant proportion of errors in novice programming are caused by a
confusion of natural language semantics with the more limited (but precise) semantics of
the programming language. As a result there may be some value in leveraging the use of
natural language expressions to better support the programming process Armarego &
Roy
Stepwise
 refinement. The task of creating a program from a specification is an open
problem: of the many concepts, ideas, strategies and processes that can be proposed none
provide all the answers. However, stepwise, or progressive, refinement is one strategy
that appears often (Reynolds, Maletic, & Porvin, 1992; Wirth, 1971). Quoting from
Reynolds et al (1992; p 80): stepwise refinement can be viewed as a sequence of
elaborations that result in the formation of a program in a target language from an initial
function specification In some ways this principle is still at the core of teaching novice
designers, and central to the goals for the use and development of pseudocode based
technologies/tools. Novices struggle with understanding how a computation should be
performed - the problem needs to be approached gradually and progressively

Encapsulation
 and information hiding. Encapsulation is concerned with the
containment of code within program elements that can stand alone and integrate with
other program elements through well defined interfaces (Blair, Gallagher, Hutchison, &

Sheperd, 1991; Booch, 1991; Wirfs-Brock, Wilkerton, & Weiner, 1990). This facilitates
separate compilation and the effective management of large and complex systems.
Information hiding is aimed at ensuring that attributes and operations are defined so that:
o their visibility is limited to those parts of the system where they are needed o the ability
to observe and/or modify data or behaviour is restricted to those parts of the system
where the designer explicitly allows such capabilities. These principles are integral to the
effective re-use of proven and well tested components in the large software libraries that
form essential tools for the software designer. Most engineering design tasks rely on
standard components: software should be no different
Modularization.
 Most complex design tasks are solved by breaking them down into
manageable parts. These modules must be of a size or complexity so their functional
requirements can be clearly stated and implemented without being too concerned about
the operation of the whole system (Yourdon & Constantine, 1979). This requires a clear
definition of how the module interfaces with other parts of the system and a description
of any conditions that can be applied to ensure the integrity of the module. Developing
skills in modular design is essential for teaching novices. “Rules of thumb” like limiting
the complexity of an operation to a single task can assist in knowing when further
modularisation is required

Model
 representations. The design process for software, like other areas of
engineering, requires the designer to have an appropriate mental model. For software this
is commonly taken as the textual representa tion. In reality this is just one view of the
design solution, and often not the most effective. Hence the emergence of modelling
languages such as UML to describe the complex behaviour of software. The idea that an
underlying model can have several views to explain different elements of the semantics
of the program is central to the development of a good appreciation of the role of the
design model and should be introduced at an early stage of teaching. Regardless of what
programming paradigm is adopted, early progress and ultimate success for the novice

will be closely related to how well the fundamentals of computational primitives (ie
sequence, iteration,selection and recursion) are understood. Our approach has been to
develop a model for software designthat focuses on these basic elements, while
introducing a limited subset of O-O concepts. The goal is toprovide a framework that can
be extended as the student’s understanding and design sophistication grows.

6.3 PROCESS MODEL USED

Description:
To produce a solution for any client specific problem the team of software engineers must
adopt a development strategy that encompasses the processes, tools and layers. This
strategy is called process modeling. The model is chosen on basis of the nature of
project. There are various models used to analyze the projects. The model we had
selected for our project is described as below:
The process model used for our project is Linear Sequential Model. It is better known as
Classic Lifecycle Model or Waterfall Model. It suggests a systematic, sequential
approach to software development that begins at the system level and progresses through
analysis, design, coding, testing and maintenance. It is illustrated as such.

System / information Design


Analysis Code Testing
engineering

The main activities involved in this model are as follows:


1. System / information engineering and modeling
Work begins by establishing requirements for all system elements and then
allocating some subset of these requirements to software. It encompasses requirement
gathering at the system level with small amount of top-level analysis and design.
2. Software requirement analysis
Requirement gathering processes intensified and focused specifically on software.
The Information domain for the software, behavior, performance and interface is needed
to be understood. Requirements for both the system and the software are documented and
reviewed with the customer.
3. Design
Software design is actually a multi-step process that concentrates on four distinct
attributes of a program: data structure, software architecture, interface presentations, and
procedural details. Like requirements, the design is documented and becomes part of the
software configurations.
4. Code generation
The design must be translated into a machine-readable form. The code generation
performs this task. If design is performed in a detailed manner, code generation can be
accomplished mechanistically.
5. Testing
It begins after the code has been generated. It focuses on logical internals of the
software. It ensures that all statements have been tested, and on the functional externals;
i.e., conducting tests to uncover errors and ensure that defined input will produce actual
results that agree with the required results.
6. Maintenance
Software undergoes changes after it is delivered to the customer. Changes occur,
as the software must be adapted to accommodate changes in its external environment.
Software maintenance reapplies each of the preceding phases to an existing program
rather than a new one.

ADVANTAGES
♦ Easy to explain to the user.
♦ Activities and the stages are well defined.
♦ Ensures that information is obtained before it is required.
♦ Helps to plan and schedule project.
♦ Verification at each stage shows up early detection of errors.
♦ Ensures that system meets user needs.

DISADVANTAGES
♦ Assumes that requirements are stable.
♦ Next stage begins only after the previous stage is completed.
♦ User training is not given importance.
♦ Implementation is ignored.
6.4 USE CASE DIAGRAM
Use case diagram

6.5 ER DIAGRAM
6.6 DATA FLOW DIAGRAM
HOME PAGE
SCRAPBOOK
SEARCH USER
CODING

CHECKUSER.JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%@ page import="java.io.*,java.sql.*" %>
<%
String u=request.getParameter("email_id");
String p=request.getParameter("password");
Connection cn=null;
ResultSet rs=null;
PrintWriter pw=response.getWriter();
PreparedStatement ps=null;
try
{

Class.forName("com.mysql.jdbc.Driver");

cn=DriverManager.getConnection("jdbc:mysql://localhost:3306/project","r
oot","");
ps=cn.prepareStatement("select * from registration where
email_id=? and password=?");
ps.setString(1,u);
ps.setString(2,p);
rs=ps.executeQuery();
if(rs.next())
{
session.setAttribute("log",u);
%>
<script type="text/javascript">
alert("Login Successfull");
document.location="welcome.jsp";
</script>
<%
}
else
{
%>
<script type="text/javascript">
alert("Inavlid User");
document.location="index.jsp";
</script>
<%
}

}
catch(Exception e)
{
pw.println(e);
}
%>

REGISTRATION SERVLET

import java.io.*;
import java.sql.*;

import javax.servlet.*;
public class regi extends GenericServlet
{
public void service(ServletRequest rq,ServletResponse rp) throws
ServletException ,IOException
{
PrintWriter pw=rp.getWriter();

Connection cn=null;
PreparedStatement ps=null;

pw=rp.getWriter();
String f=rq.getParameter("fn");
String l=rq.getParameter("ln");
String ed= rq.getParameter("eid");
String p=rq.getParameter("pwd");
String r=rq.getParameter("rpwd");

try
{
Class.forName("com.mysql.jdbc.Driver");

cn=DriverManager.getConnection("jdbc:mysql://localhost:3306/project","r
oot","");
ps=cn.prepareStatement("insert into
registration values(?,?,?,?,?)");
ps.setString(1,f);
ps.setString(2,l);
ps.setString(3,ed);
ps.setString(4,p);
ps.setString(5,r);

ps.execute();
pw.println("you have been succesfully
registered");
pw.println("<a href=index.jsp>login</a>");
pw.close();

}
catch(Exception e)
{
pw.println(e);
}

PROFILE SERVLET
import javax.servlet.*;
import java.io.*;
import java.sql.*;
public class profile extends GenericServlet
{

public void service(ServletRequest rq,ServletResponse rp) throws


ServletException ,IOException
{
PrintWriter pw;
Connection cn=null;
pw=rp.getWriter();
String n=rq.getParameter("nm");
String l=rq.getParameter("nm1");
String s=rq.getParameter("st");
String c=rq.getParameter("cr");
int d1=Integer.parseInt(rq.getParameter("d"));
String m1=rq.getParameter("m");
int y1=Integer.parseInt(rq.getParameter("y"));
String dob=d1+"/"+m1+"/"+y1;
String r=rq.getParameter("in");
String k=rq.getParameter("la");
String o=rq.getParameter("re");
String m=rq.getParameter("p");
String b=rq.getParameter("book");
String f=rq.getParameter("movie");

try
{
Class.forName("com.mysql.jdbc.Driver");

cn=DriverManager.getConnection("jdbc:mysql://localhost:3306/project","r
oot","");
PreparedStatement ps=cn.prepareStatement("insert into
profile values(?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,n);
ps.setString(2,l);
ps.setString(3,s);
ps.setString(4,c);
ps.setString(5,dob);
ps.setString(6,r);
ps.setString(7,k);
ps.setString(8,o);
ps.setString(9,m);
ps.setString(10,b);
ps.setString(11,f);
ps.execute();
pw.println("data saved");
}
catch(Exception e)
{
pw.println(e);
}

SEARCH USER
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

import java.sql.*;

/**
* Servlet implementation class for Servlet: searchFrnd
*
*/
public class searchf extends javax.servlet.http.HttpServlet implements
javax.servlet.Servlet {
static final long serialVersionUID = 1L;

/* (non-Java-doc)
* €@see javax.servlet.http.HttpServlet#HttpServlet()
*/
public searchf() {
super();
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest
request, HttpServletResponse response)
*/

protected void doGet(HttpServletRequest request,


HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub

/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest
request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
Connection cn=null;
PreparedStatement ps=null;
ResultSet rs=null;
PrintWriter pw=response.getWriter();
String f=request.getParameter("fname");
String eid=request.getParameter("email_id");
HttpSession hs=request.getSession(true);
String m=(String)hs.getAttribute("log");

try
{
Class.forName("com.mysql.jdbc.Driver");

cn=DriverManager.getConnection("jdbc:mysql://localhost:3306/project","r
oot","");
ps=cn.prepareStatement("select * from registration
where fname=? && email_id=? ");
ps.setString(1,f);

ps.setString(2,eid);
rs=ps.executeQuery();
if(rs.next())
{

String n=rs.getString("fname");
String ed =rs.getString("email_id");

//String cn1=rs.getString("country");
//String s=rs.getString("sex");
//String cnn=rs.getString("city");
pw.println("<div style=float:left><div
float:left>Name ="+n+"<br>Email id= ="+ed+"<br><div style=float:left><a
href=addnewfriend.html>add new friend<hr></div>");
//pw.println("<div style=float:left><div
float:left>Name ="+n+"<br><br>Email_id="+ed"<div style=float:left><a
href=addnewfriend.html>add as a friend<hr></div>");

}
else
{
//pw.println("sry!!!! no record found");
//pw.println("<br><a
href=searchf.html>back</a>");

response.sendRedirect("http://localhost:8080/minorproject/searchacknowl
egment.jsp");
}
}
catch(Exception e)
{
pw.println(e);
}
}
}

POSTSCRAP SERVLET
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* Servlet implementation class for Servlet: newscrap
*
*/
public class newscrap extends javax.servlet.http.HttpServlet implements
javax.servlet.Servlet {
static final long serialVersionUID = 1L;

/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
*/
public newscrap() {
super();

/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest
request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}

/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest
request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
Connection cn=null;
PreparedStatement ps=null;
int scno=0;
PrintWriter pw=response.getWriter();
String myid=request.getParameter("nm");
String msg=request.getParameter("ab");
String fid=request.getParameter("nm1");

try
{
Class.forName("com.mysql.jdbc.Driver");

cn=DriverManager.getConnection("jdbc:mysql://localhost:3306/project","r
oot","");
ps=cn.prepareStatement("select max(sid) from
scrapbook where email_id=?");
ps.setString(1, myid);
ResultSet rs=ps.executeQuery();
rs.next();
scno=rs.getInt(1);
rs.close();
scno=scno+1;
ps=cn.prepareStatement("insert into scrapbook
values(?,?,?,?)");
ps.setString(1,fid);
ps.setString(2,msg);
ps.setString(3,myid);
ps.setInt(4,scno);
ps.execute();

response.sendRedirect("http://localhost:8080/minorproject/scrapacknowle
dge.jsp");
//pw.println("Your scrap has been sent succesfully");
//pw.println("<a href=scrapbook.html> scrapbook</a>");

}
catch(Exception e)
{
pw.println(e);
}
}

SEARCH ACKNOWLEGNMENT.JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<link href="style.css" rel="stylesheet" type="text/css" />

<!-- HEADER STARTS -->


<div id="header">
<div> <a href="index.html"></a>
<h2>social networking site.</h2>
</div>
<ul>
<li><a href="welcome.jsp" title="Home">Home</a></li>
<li><a href="scrapbook.html" title="scrapbook">Scrapbook</a></li>
<li><a href="profile.jsp" >ViewProfile</a></li>
<li><a href="profileupdate.html" >updateProfile</a></li>
<li><a href="searchf.html" title="Search">Search</a></li>
<li><a href="#" title="friends">friends</a></li>
<li><a href="requestdisplay.jsp">Friend Request</a></li>
<li><a href="signout.jsp" title="Log out">Log out</a></li>
</ul>
</div>
<!-- HEADER ENDS -->
<br><br>
<font face="Script MT Bold" size="5"
color="black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Sorry!!!!! no record found.......<br><br><br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="searchf.html">back</a>
</font></body>
</html>

SCRAPBOOKACKNOWLEGNMENT.JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<link href="style.css" rel="stylesheet" type="text/css" />

<!-- HEADER STARTS -->


<div id="header">
<div> <a href="index.html"></a>
<h2>social networking site.</h2>
</div>
<ul>
<li><a href="welcome.jsp" title="Home">Home</a></li>
<li><a href="scrapbook.html" title="scrapbook">Scrapbook</a></li>
<li><a href="profile.jsp" >ViewProfile</a></li>
<li><a href="profileupdate.html" >updateProfile</a></li>
<li><a href="searchf.html" title="Search">Search</a></li>
<li><a href="#" title="friends">friends</a></li>
<li><a href="requestdisplay.jsp">Friend Request</a></li>
<li><a href="signout.jsp" title="Log out">Log out</a></li>
</ul>
</div>
<!-- HEADER ENDS -->
<br><br>
<font face="Script MT Bold" size="5"
color="black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
your Scrap has been sent succesfully posted...<br><br><br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a
href="scrapbook.html">Scrapbook</a>
</font></body>
</html>
PROJECT SCREENS
TESTING

9.1 Testing Objective:


There are certain rules that can serve well as testing objectives:
1. Testing is a process of executing a program with the intent of finding an error.
2. A good test case is one that has a high probability of finding an as-yet
undiscovered
3. Error.
4. A successful test is one that uncovers an as-yet undiscovered error.

Our objective is to design tests that systematically uncover different classes of errors and
do so with a minimum amount of time and effort. As a secondary benefit, testing
demonstrates that software functions appear to be working according to specifications
and that performance requirements appear to have been met. In addition, data collected as
testing is conducted provides a good indication of software reliability and some
indication of software quality as a whole.

9.2 Testing Principles:


1. All the tests should be traceable to the customer requirements
2. Tests should be planned long before the testing begins
3. Testing should begin in small and progress towards testing in large
4. Exhaustive testing is not possible
5. To be effective testing should be conducted by an independent 3rd party

9.3 Testing involved:

Unit testing deals with testing a unit as a whole. This would test the interaction of many
functions but confine the test within one unit. The exact scope of a unit is left to
interpretation. Supporting test code, sometimes called scaffolding, may be necessary to
support an individual test. This type of testing is driven by the architecture and
implementation teams. This focus is also called black-box testing because only the details
of the interface are visible to the test. Limits that are global to a unit are tested here.
FUTURE ENHANCEMENTS

There are various suggestions that we would like to give for the future enhancement of
this project:

• Extend more useful features .


• Get notifications and updates of user by its yahoo or gmail account.
• Get registered on the website.
• Post comments and ask queries related to the software.
• Applications such as games will be provided.
• Features such phto uploading,visiting friends profile,scrapbook,post comments
etc will be provided
LIMITATIONS

Although we have tired our best to implement every possible concept to our project but
as every possible concept to our project but as every system is not complete in itself , it
continuous to evolve with time.
The task given to us performed by keeping in mind the goals we have to achieve, these
are to provide user-friendliness.
1. The main limitation of our project is that we can see our friend profile and
scrapbook
2. Many features such photo uploading, creating albums etc are not present .
3. Email id is registered for our site only
4. Confirmation through mail is not provided.
BIBLIOGRAPHY

You might also like