100% found this document useful (1 vote)
172 views

College Connect

This document describes a project for a social networking website called "College Connect" that will connect students, staff, alumni and industry professionals associated with a college campus. The website will allow different user categories to socialize and share information. Students will be required to provide parent contact details for teachers to access easily if needed. Users will only be able to view details relevant to them for academic or professional purposes, protecting privacy. The project aims to promote teaching and learning through a dynamic online platform without compromising privacy. It includes sections on objectives, existing systems, requirements, design diagrams, coding, testing and future enhancements.

Uploaded by

Sonal Prasad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
172 views

College Connect

This document describes a project for a social networking website called "College Connect" that will connect students, staff, alumni and industry professionals associated with a college campus. The website will allow different user categories to socialize and share information. Students will be required to provide parent contact details for teachers to access easily if needed. Users will only be able to view details relevant to them for academic or professional purposes, protecting privacy. The project aims to promote teaching and learning through a dynamic online platform without compromising privacy. It includes sections on objectives, existing systems, requirements, design diagrams, coding, testing and future enhancements.

Uploaded by

Sonal Prasad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 318

College Connect

“A Social Networking Website”

PATNA UNIVERSITY

3rd Cycle NAAC Accredited at A grade with CGPA 3.58/4

“College
College with Potential for Excellence”
Ex (CPE) status accordance by UGC..

DEPARTMENT OF MCA

Project Report
ON

COLLEGE CONNECT
“A social network
networking website”

SEMESTER :- IV GROUP :- 3rd SESSION :-


: 2016-19

Submitted By :-

NAME ROLL NO .

SIMA SINHA 22

SHRADHA SUMAN 26

PRIYANKA 16

SHAHIDA SIDDIQUEE 18

KUMARI PRATIBHA ANAND 33 Guided By :-

TARANNUM PRAVEEN 24 _________________

PRIYA SHARMA 35 PRAVEEN KUMAR

Page | 1
College Connect
“A Social Networking Website”

PATNA
ATNA WOMENS’COLLEGE
NAAC Re-Accredited
Accredited ‘A’ Grade with CGPA 3.58/4

“College with Potential for Excellence” (CGPA) status accorded by UGC

Patna
Bailey Road, Patna-800001

CERTIFICATE OF APPROVAL

This is to certify that mini project entitled “ College Connect -A Social networking
webstie” has been submitted by “Sima Sinha (22),Shradha
Suman(26),
uman(26), Priyanka (16), Shahida Shiddhique(18), Tarannum
Praveen(24), Kumari Pratibha Ananad(33), Priya Sharma(35 Sharma(35) to
Patna Women’s College in ppartial fulfillment of the requirement award
ward of the degree
of Master
aster of Computer Applications (MCA), is an original Work carried out under
the guidance of Mr.Praveen Kumar.

………………………………….. ……………………………………. …………………….


…………………

Internal Signature Dr.Bhawna Sinha External signature

Head of Department

(Department Of
O Computer Application)

Page | 2
College Connect
“A Social Networking Website”

Acknowledgement
We are thankful to our college Patna Women’s College for considering our project and
extending help at all stages needed during our work of collecting information regarding
the project. It gives us immense pleasure to express our deep and sincere gratitude to
Assistant Professor Praveen Kumar (Project Guide) for her kind help and valuable advice
during the development of project synopsis and for her guidance and suggestions. We are
deeply indebted to Head of the Computer Department Dr.(Mrs.)Bhawna Sinha Ma’am and
our Principal Dr. Sister Marie Jessie A.C, for giving us this valuable opportunity to do this
project. We express our hearty thanks to them for their assistance without which it would
have been difficult in finishing this project synopsis and project review successfully. We
convey our deep sense of gratitude to all teaching and non-teaching staff for their constant
encouragement, support and selfless help throughout the project work. It is great pleasure
to acknowledge the help and suggestion, which we received from the Department of
Computer Science. We wish to express our profound thanks to all those who helped us in
gathering information about the project. Our families too have provided moral support and
encouragement at several times.

Page | 3
College Connect
“A Social Networking Website”

PREFACE

It is a great opportunity of me to automate the whole task of my


project“ College Connect A social networking website “.

I would like to thank the project guide who helped me to understand


theworking step of Social Networking.

During developing of our project, I went through various aspects as to how to


automate the work of login & registration property which is performed there
conduct the brief knowledge about Social Networking System. This project
briefly describes the whole systematic approach step by step taken to develop
projects. The Project contains information about project development life cycle
other details of the developed project.

Page | 4
College Connect
“A Social Networking Website”

CONTENTS

S.NO. TOPIC PAGE NUMBER


1. Introduction of project 6
2. About Project 7
3. Literature Survey 8
4. Objective Of Project 9
5. Study of Existing System 10
6. Characteristics of Project System 10
7. Project Methodology 11-12
8. Time Frame Of Project 13
9. Specific Requirements(Functional & Non-Functional) 14-16
10. Data Flow Diagram 17-21
11. Entity Relationship Diagram 22
12. Database Design 23-24
13. Class Diagram 25
14. Activity Diagram 26
15. Expected Output 27
16. Coding In SQL 28-31
17. Coding In HTML + SERVLET 32-288
18. Runtime Window 289-306
19. Testing 307-312
20. Evaluation 313
21. Maintainance 314
22. Future Scope and Further Enhancement 315
23. Limitations of the Project 316
24. Conclusion 317
25. Bibliography 318

Page | 5
College Connect
“A Social Networking Website”

INTRODUCTION OF PROJECT
We know about the increasing use of social networking sites, people use various social
media platforms depending on their requirements and interest. Social media is a dynamic
platform that can be used in so many ways to share news, knowledge, entertainment etc. In
this project a social media platform for college campus has been created where everyone
associated with the college campus such as students, staff members, associated industry
professionals and passed out alumni can socialize with each other and share their
knowledge about academics, projects, placements and all other activities going on in the
campus. The functions of various categories of users are going to be segregated and each
category of user will have its own privileged tasks. A hierarchy of these categories of users
is created such as The Principal, General Staff, Passed out alumni, Current Students ( in
descending order ) where. It is very inconvenient for teachers to find students’ parent
contact information, our website will have an exclusive option for teachers to find
parent’s contact details with a click of button. All campus students when registering will
compulsorily need to fill their parent’s contact details so that it becomes easy for teachers
to contact them when needed. Also taking into account the fact that parent’s contact
information is something which is too personal for a student this social networking site will
not be allowing a particular student to view other student’s parent contact details as it
can be misused. Similarly, students would not be able to view all the personal details of
faculty or industry people. They’ll be only allowed to view the details which are relevant
to them from academic or professional point of view. They’ll be able to view the research
conducted by teachers, their department and subjects etc. It will promote teaching and
learning through a more dynamic platform without causing any threat to privacy.

Page | 6
College Connect
“A Social Networking Website”

ABOUT PROJECT

A college social networking project where students may create their account and make
their profile online. Students may create their online profile with their data as well as
upload their profile image. After making a profile students may login to the system. After
that students may chat with each other through social networking website. Student once
logged in appears online else appears offline. Students may also post their status online
and may check each other’s status message.

Features:

 Students can register and login into the system once their registration is approved by the
admin.
 Once the student logged in into the system, he/she can write and post an articles on
various topic of his/her choice.
 Students can also upload images with their post.
 All students can view News Feed posted by individual student.
 All the student registration will be approved/rejected by the admin as well as, all the post
will be kept pending until admin approves/rejects each and every post.
 Admin Login has full authority on system, he/she can add/delete Faculty.
 Staff can view student profiles and also can post event who’s details will get by
students.

Page | 7
College Connect
“A Social Networking Website”

Literature Survey
Comparison of various social networking sites We have gone through the features of various social
networking sites and made a list of some basic functions which are or are not available in these
sites. This analysis helped us to understand which social media we can refer to in order to add our
desired features. The following table provides an overall summary for some of the most popular
sites.

Page | 8
College Connect
“A Social Networking Website”

OBJECTIVE OF PROJECT

 Students can make more friends within short span of time.


 Students will be updated with new thoughts and views.
 Student can share as well as obtain knowledge by using this application.
 Builds a strong communication between the students and the faculty.
 Students can only see placement related post which is posted by admin.
 Students can view examination schedule and result online very easily .

STUDY OF EXISTING SYSTEM

 There is a gap between students and faculties which leads to lack of interaction
while learning.
 Many of the students hesitate in asking queries to the faculties.
 Students can’t interact with each other among different departments.
 Sharing of information is difficult in such environment.
 For any notice from the department of college students have to ask many
individuals.
 Some notices aren’t delivered to each student on time.
 Loss of time and man power.
 Hard to operate and maintain.
 Searching of individual result is quite difficult task and time consuming.

Page | 9
College Connect
“A Social Networking Website”

CHARACTERISTICS OF PROPOSED SYSTEM

The main goal of the system is to automate the process carried out in the organization with improved
performance. The aim of the proposed system is to address the limitations of the current
system. The requirements for the system have been gathered from the defects recorded in
the past and also based on the feedback from users of previous metrics tools. Some of the
goals of the system are listed below:

 Works 24 x 7
 No Geographical Boundary :
o Remote Work – Students need not worry about the extra classes to solve their
problems or any queries. They can discuss it via college connect website
 Less Paper Work :
o College no longer require printing & storing results and examination schedule.
 Centralized data handling.
o Transfer the data smoothly to all the departments involved and handle the data
centralized way.
 Only College Students and Faculty Can Register:
o Minimizes Data Redundancy - Checks can be provided so that only college students
and faculty can register. Besides, the members data is to be entered only once.
 Dynamic and User Friendly :
o The entire process is very dynamic - any changes can be reflected in real time & will
be immediately reached the members.
o The process is simple & user friendly – provides user friendly interface and needs
less human interactions.
 Greater Flexibility:
o Various types of reports can be generated in quick time with minor changes in the
design.

Page | 10
College Connect
“A Social Networking Website”

PROJECT METHODOLOGY
In the Iterative model, iterative process starts with a simple implementation of a small
set of the software requirements and iteratively enhances the evolving versions until
the complete system is implemented and ready to be deployed.

An iterative life cycle model does not attempt to start with a full specification of
requirements. Instead, development begins by specifying and implementing just part
of the software, which is then reviewed to identify further requirements. This process
is then repeated, producing a new version of the software at the end of each iteration
of the model.

Iterative Model - Design


Iterative process starts with a simple implementation of a subset of the software
requirements and iteratively enhances the evolving versions until the full system is
implemented. At each iteration, design modifications are made and new functional
capabilities are added. The basic idea behind this method is to develop a system
through repeated cycles (iterative) and in smaller portions at a time (incremental).

The following illustration is a representation of the Iterative and Incremental model −

Iterative and Incremental development is a combination of both iterative


design or iterative method and incremental build model for development.
"During software development, more than one iteration of the software
development cycle may be in progress at the same time." This process may
be described as an "evolutionary acquisition" or "incremental build"
approach." release of the module adds function to the previous release. The process
continues till the complete system is ready as per the requirement.

The key to a successful use of an iterative software development lifecycle is rigorous


validation of requirements, and verification & testing of each version of the software
against those requirements within each cycle of the model. As the software evolves

Page | 11
College Connect
“A Social Networking Website”

through successive cycles, tests must be repeated and extended to verify each version
of the software.

Iterative Model - Application


Like other SDLC models, Iterative and incremental development has some specific
applications in the software industry. This model is most often used in the following
scenarios −

In this incremental model, the whole requirement is divided into various


builds. During each iteration, the development module goes through the
requirements, design, implementation and testing phases. Each subsequent
Requirements of the complete system are clearly defined and understood.

 Major requirements must be defined; however, some functionalities or


requested enhancements may evolve with time.

 There is a time to the market constraint.

 A new technology is being used and is being learnt by the development team
while working on the project.

 Resources with needed skill sets are not available and are planned to be used on
contract basis for specific iterations.

 There are some high-risk features and goals which may change in the future.

Iterative Model - Pros and Cons


The advantage of this model is that there is a working model of the system at a very
early stage of development, which makes it easier to find functional or design flaws.
Finding issues at an early stage of development enables to take corrective measures in
a limited budget.

The disadvantage with this SDLC model is that it is applicable only to large and bulky
software development projects. This is because it is hard to break a small software
system into further small serviceable increments/modules.

The advantages of the Iterative and Incremental SDLC Model are as follows −

 Some working functionality can be developed quickly and early in the life cycle.

 Results are obtained early and periodically.

 Parallel development can be planned.

 Progress can be measured.

Page | 12
College Connect
“A Social Networking Website”

 Less costly to change the scope/requirements.

 Testing and debugging during smaller iteration is easy.

 Risks are identified and resolved during iteration; and each iteration is an easily
managed milestone.

 Easier to manage risk - High risk part is done first.

 With every increment, operational product is delivered.

 Issues, challenges and risks identified from each increment can be


utilized/applied to the next increment.

 Risk analysis is better.

 It supports changing requirements.

 Initial Operating time is less.

 Better suited for large and mission-critical projects.

 During the life cycle, software is produced early which facilitates customer
evaluation and feedback.

The disadvantages of the Iterative and Incremental SDLC Model are as follows −

 More resources may be required.

 Although cost of change is lesser, but it is not very suitable for changing
requirements.

 More management attention is required.

 System architecture or design issues may arise because not all requirements are
gathered in the beginning of the entire life cycle.

 Defining increments may require definition of the complete system.

 Not suitable for smaller projects.

 Management complexity is more.

 End of project may not be known which is a risk.

 Highly skilled resources are required for risk analysis.

 Projects progress is highly dependent upon the risk analysis phase.

Page | 13
College Connect
“A Social Networking Website”

SPECIFIC REQUIREMENT

External Interface Requirements:

The interface should be simple and easy to understand and use. It should also be an
interactive interface.

User Interfaces:

 The software provides good GUI for the front end which is self -explanatory.
 The system contains convenient web pages, dropdown menus and options.
 The developer will have to study the designing of the product.
 Client gets the warnings with necessary assistance from the application.

Software Requirements:

 Operating system: Microsoft windows 8.1


 Front End Tools: NetBeans
 Back End Tools: DERBY

Hardware Requirements:

 CPU: Intel Core i5


 RAM: 4.00 GB
 HDD: 500 GB
 Keyboard, Monitor, Mouse, Printer

Page | 14
College Connect
“A Social Networking Website”

Functional Requirements:
This section provides the overview of the product. The project will require the NetBeans as
front end and at the back end the DERBY will be running.

Various functional modules that can be implemented by the product will be:

 Login Form
In this module, member register themselves and login to the site to gain the authorities to
view many more things which are not authorized for all public users.

 Registration Form
In this module, registration form filling work is done and after it the user is brought back to
the home page for login.

 Notice Board Form


In this module, admins are capable of update of notice regarding college placement, exam
details, results, holiday list etc and members are capable of viewing it.

 My Profile Form
In this module, the members after login can view this. They can update their information,
make post and comments, view examination schedule and results, see online friends and
logout.

 College social network unique Id Generation


After the registration process, the process unique college social network id has to be done
only for valid registration.

 Examination Schedule and Result Updation Form


When the process of faculty login is completed, they can update such details and discuss
with students regarding their queries.

Page | 15
College Connect
“A Social Networking Website”

 Admin Module
This module is only for admins. In this module, various tasks such as Managing Student’s
Records, Uploading General Instructions, Uploading Notices, managing pots etc. are done.

Non functional Requirements:

 PERFORMANCE:
Performance requirements define acceptable response times for system functionality.
 RELIABILITY:
Good validations for user inputs will be done.
Avoid incorrect storage of records.
 SECURITY:
Encrypted password.
Administrator has more rights than the sub user.
 PORTABILITY:
This website opens in any personal computer supporting windows, Linux, Unix operating
system.
 FLEXIBILITY:
The system keeps on updating the data according to the transactions that takes place.
 MAINTABILITY:
During maintenance stage, the SRS can be referred for the validation.

Page | 16
College Connect
“A Social Networking Website”

DATA FLOW DIAGRAM

Page | 17
College Connect
“A Social Networking Website”

Page | 18
College Connect
“A Social Networking Website”

LEVEL
EL 2 DFD FOR MEMBER

Page | 19
College Connect
“A Social Networking Website”

LEVEL 1 DFD FOR ADMIN

Page | 20
College Connect
“A Social Networking Website”

Page | 21
College Connect
“A Social Networking Website”

ENTITY RELATIONSHIP DIAGRAM

Page | 22
College Connect
“A Social Networking Website”

DATABASE DESGN

Member Details Database


S. No. Fields Data Size Description
type
1. Member number 10 Student/Faculty
Type
2. Account Id number 20 Auto generated,
Primary Key
3. Email Id varchar 30 Mandatory
4. Password varchar 30 Hidden, Mandatory
5. Name varchar 30
6. Date of date 10
Birth
7. Date of date 10 Hidden in Student
Joining Registration
8. Department varchar 10
9. Semester varchar 10 Hidden in Faculty
Registration
10. Registration varchar 10 Hidden in Faculty
Id Registration
11. Profile varchar 50
Image
12. Address varchar 50
13. Contact number 10
Number
14. Status number 10 Active/Deactive

Result Database
S. No. Fields Data Size Description
type
1. Roll No. varchar 10
2. Semester varchar 10
3. Paper1 integer 10
4. Paper2 integer 10
5. Paper3 integer 10
6. Paper4 Integer 10
7. Paper5 Integer 10
8. Paper6 Integer 10
9. Paper7 integer 10

Page | 23
College Connect
“A Social Networking Website”

Examination Details Database


S. No. Fields Data Size Description
type
1. Semester varchar 10 Primary Key
2. Paper 1 date 10
3. Paper2 date 10
4. Paper3 date 10
5. Paper4 date 10
6. Paper5 date 10
7. Paper6 date 10
8. Paper7 date 10

Notification Database
S. No. Fields Data Size Description
type
1. Notification number 10 Primary Key &
Id Auto generated
2. Notice varchar 100

Post Database
S.No. Fields Data Size Description
type
1. Post Id number 10 Primary Key &
Auto generated
2. Account Id varchar 10 Foreign Key
3. Post varchar 50

Comment Database
S. No. Fields Data Size Description
type
1. Comment number 10 Primary Key & Auto
Id generated
2. Account Id varchar 10 Foreign Key
3. Post Id number 10 Foreign Key
4. Post varchar 100

Admin Database
S. No. Fields Data Size Description
type
1. Email Id number 30 Primary Key
2. Password varchar 30
3. Name varchar 30

Page | 24
College Connect
“A Social Networking Website”

CLASS
LASS DIAGRAM

Page | 25
College Connect
“A Social Networking Website”

ACTIVITY DIAGRAM

Page | 26
College Connect
“A Social Networking Website”

EXPECTED OUTPUT
The system will help the administrator to manage recordings, monitoring and
tracking the activities of the students. The administrator can maintain a notice
board to show the status of the student.

The student/faculty can sign in and sign out for the different types of
activities. The student can make queries through posts and comments.

The most important thing of having this system is to reduce the difference
between the students and faculty ad connect them to a social platform for
exchange to knowledge and provide a new track toward learning.

College Connect social network website offers a private place for students to
interact and communicate with other students from their college. Students
can engage in a variety of services, including selling and buying in their own
marketplace, uploading videos and photos, and posting campus events,
discounts and special offers.

Page | 27
College Connect
“A Social Networking Website”

Page | 28
College Connect
“A Social Networking Website”

create table MEMBER_DETAILS

member_type integer,

account_id integer not null GENERATED ALWAYS AS IDENTITY (START WITH 1,INCREMENT
BY 1),

name varchar(20),

date_of_birth date,

department varchar(20),

address varchar(100),

contact_no varchar(10),

regid varchar(12),

email varchar(50) not null,

password varchar(16),

confirm_password varchar(16),

profile_pic varchar(1000),

status varchar(10),

CONSTRAINT PRIMARY_KEY PRIMARY KEY (account_id,email)

);

Page | 29
College Connect
“A Social Networking Website”

create table EXAMINATION_DETAILS

semester varchar(20) PRIMARY KEY,

start_date date,

time time,

center varchar(50)

);

create table ADMIN_DETAILS

email varchar(50) PRIMARY KEY,

name varchar(20),

password varchar(16),

confirm_password varchar(16)

);

create table Result

regid varchar(12) PRIMARY KEY

marks_obtained integer(4)

percentage(2,2)

division varchar(2)

);

Page | 30
College Connect
“A Social Networking Website”

create table POST

post_id integer not null GENERATED ALWAYS AS IDENTITY (START WITH 101,INCREMENT BY
1)PRIMARY KEY,

account_id integer,

post varchar(1000),

image varchar(1000),

FOREIGN KEY(account_id)REFERENCES member_details(account_id)

);

create table COMMENT

comment_id integer not null GENERATED ALWAYS AS IDENTITY (START WITH


1000,INCREMENT BY 1)PRIMARY KEY,

account_id integer,

post_id integer,

comment varchar(1000),

FOREIGN KEY(account_id)REFERENCES member_details(account_id),

FOREIGN KEY(post_id)REFERENCES post(post_id)

);

Page | 31
College Connect
“A Social Networking Website”

Page | 32
College Connect
“A Social Networking Website”

Home.html

<!DOCTYPE html>

<!--

To change this license header, choose License Headers in Project Properties.

To change this template file, choose Tools | Templates

and open the template in the editor.

-->

<html>

<head>

<title>Home</title>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">

<style>

ul {

list-style-type: none;

margin: 0;

padding: 0;

overflow: hidden;

Page | 33
College Connect
“A Social Networking Website”

li {

float: left;

li a {

display: block;

color: black;

text-align: center;

padding: 14px 16px;

text-decoration: none;

</style>

<style>

body {

font-family: Arial;

margin: 0;

Page | 34
College Connect
“A Social Networking Website”

*{

box-sizing: border-box;

img {

vertical-align: middle;

/* Position the image container (needed to position the left and right arrows) */

.container {

position: relative;

/* Hide the images by default */

.mySlides {

display: none;

/* Add a pointer when hovering over the thumbnail images */

.cursor {

cursor: pointer;

Page | 35
College Connect
“A Social Networking Website”

/* Next & previous buttons */

.prev,

.next {

cursor: pointer;

position: absolute;

top: 40%;

width: auto;

padding: 16px;

margin-top: -50px;

color: white;

font-weight: bold;

font-size: 20px;

border-radius: 0 3px 3px 0;

user-select: none;

-webkit-user-select: none;

/* Position the "next button" to the right */

.next {

right: 0;

border-radius: 3px 0 0 3px;

Page | 36
College Connect
“A Social Networking Website”

/* On hover, add a black background color with a little bit see-through */

.prev:hover,

.next:hover {

background-color: rgba(0, 0, 0, 0.8);

/* Number text (1/3 etc) */

.numbertext {

color: #f2f2f2;

font-size: 12px;

padding: 8px 12px;

position: absolute;

top: 0;

/* Container for image text */

.caption-container {

text-align: center;

background-color: #222;

padding: 2px 16px;

color: white;

Page | 37
College Connect
“A Social Networking Website”

.row:after {

content: "";

display: table;

clear: both;

/* Six columns side by side */

.column {

float: left;

width: 16.66%;

/* Add a transparency effect for thumnbail images */

.demo {

opacity: 0.6;

.active,

.demo:hover {

opacity: 1;

</style>

Page | 38
College Connect
“A Social Networking Website”

</head>

<body>

<form method="post" action="login">

<div align="center">

<table width="1340px" border="1" align="center">

<tr width="1340px"><td> <img src="pwc.JPG" height="100px" width="1340px"


align="center"/></td></tr>

<tr ><td colspan="3" background="6.jpg"> <img src="download.png" height="100px"


width="200px" align="right"> <h1 align="center">COLLEGE CONNECT "A social networking
website"</h2></td></tr>

<tr><td colspan="3" background="7.jpg">

<ul>

<li><a class="active" href="home.html">Home</a></li>

<li><a href="login.html">Member Login</a></li>

<li><a href="adminlogin.html">Admin</a></li>

<li><a href="registration.html">Register</a></li>

<li><a href="notice">Notice</a></li>

<li><a href="http://www.patnawomenscollege.in/index.php/notices/281-admission-notice-
2018.html">Admission Notice</a><li>

</ul>

</td></tr>

Page | 39
College Connect
“A Social Networking Website”

<table width="1350px" border="1"> <tr width="1340px" height="400px"


background="14.jpg">

<td width="400px" valign="center" align="center" >

<h1> ABOUT US <h1>

<h3>A college social networking project where students may create their
account and make their profile online. Students may create their online profile with their data as
well as upload their profile image. After making a profile students may login to the system. After
that students may chat with each other through social networking website. Student once logged in
appears online else appears offline. Students may also post their status online and may check each
other’s status message.

</h3>

</td>

<td width="740px" >

<div class="container">

<div class="mySlides">

<div class="numbertext">1 / 6</div>

<img src="1111.jpg" style="width:100%">

</div>

<div class="mySlides">

<div class="numbertext">2 / 6</div>

<img src="2222.jpg" style="width:100%">

Page | 40
College Connect
“A Social Networking Website”

</div>

<div class="mySlides">

<div class="numbertext">3 / 6</div>

<img src="slider99.jpg" style="width:100%">

</div>

<div class="mySlides">

<div class="numbertext">4 / 6</div>

<img src="slider88.jpg" style="width:100%">

</div>

<div class="mySlides">

<div class="numbertext">5 / 6</div>

<img src="7777.jpg" style="width:100%">

</div>

<div class="mySlides">

<div class="numbertext">6 / 6</div>

<img src="55555.jpg" style="width:100%">

</div>

<a class="prev" onclick="plusSlides(-1)"> </a>

Page | 41
College Connect
“A Social Networking Website”

<a class="next" onclick="plusSlides(1)"> </a>

<div class="caption-container">

<p id="caption"></p>

</div>

<div class="row">

<div class="column">

<img class="demo cursor" src="1111.jpg" style="width:100%" onclick="currentSlide(1)" >

</div>

<div class="column">

<img class="demo cursor" src="2222.jpg" style="width:100%" onclick="currentSlide(2)" >

</div>

<div class="column">

<img class="demo cursor" src="slider99.jpg" style="width:100%" onclick="currentSlide(3)" >

</div>

<div class="column">

<img class="demo cursor" src="slider88.jpg" style="width:100%" onclick="currentSlide(4)" >

</div>

<div class="column">

<img class="demo cursor" src="7777.jpg" style="width:100%" onclick="currentSlide(5)" >

</div>

<div class="column">

Page | 42
College Connect
“A Social Networking Website”

<img class="demo cursor" src="55555.jpg" style="width:100%" onclick="currentSlide(6)" >

</div>

</div>

</div>

<script>

var slideIndex = 1;

showSlides(slideIndex);

function plusSlides(n) {

showSlides(slideIndex += n);

function currentSlide(n) {

showSlides(slideIndex = n);

function showSlides(n) {

var i;

var slides = document.getElementsByClassName("mySlides");

var dots = document.getElementsByClassName("demo");

var captionText = document.getElementById("caption");

if (n > slides.length) {slideIndex = 1}

if (n < 1) {slideIndex = slides.length}

Page | 43
College Connect
“A Social Networking Website”

for (i = 0; i < slides.length; i++) {

slides[i].style.display = "none";

for (i = 0; i < dots.length; i++) {

dots[i].className = dots[i].className.replace(" active", "");

slides[slideIndex-1].style.display = "block";

dots[slideIndex-1].className += " active";

captionText.innerHTML = dots[slideIndex-1].alt;

</script>

</td>

</tr>

</table>

</table>

<table width="1350px" height="200" border="2" align="center" cellpadding="10"


cellspacing="20" background="bottom_background.jpg">

<td> <div id="user2-wrap"><div id="user2" class="container row clr">

<div class="module span_4 col clr">

Page | 44
College Connect
“A Social Networking Website”

<h3 class="module-title" align="center">Contact Us</h3>

<div class="module-body">

<div class="custom" >

<p style="text-align: center;"><img src="patna-womens-college-small.jpg" alt=""


border="0" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>

</div>

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Location</h3>

<div class="module-body">

<div class="custom" align="center" >

<iframe width="450" height="150" frameborder="0" scrolling="no"


marginheight="0" marginwidth="0"
src="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&amp;h
near=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwloc=A&amp;
output=embed"></iframe><br /><small><a
href="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&amp;
hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwloc=A&am
p;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small></div>

Page | 45
College Connect
“A Social Networking Website”

</div>

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Important Links</h3>

<div class="module-body">

<div class="custom" >

<ul>

<li><a href="http://www.ugc.ac.in" target="_blank">University Grants Commission</a></li>

<li><a href="http://www.patnauniversity.ac.in/" target="_blank">Patna University</a></li>

<li><a href="http://www.patnauniversity.ac.in/colleges.html" target="_blank">College of Patna


University</a></li>

<li><a href="http://india.gov.in" target="_blank">National Portal of India</a></li>

<li><a href="http://righttoinformation.gov.in" target="_blank">RTI</a></li>

<li><a href="/index.php/component/content/article/14-annnual-result/84-annual-
result.html">Annual Result</a></li>

<li><a href="/index.php/component/content/article/15-media-response/85-media-
response.html">Media Response</a></li>

</ul></div>

</div>

</div>

Page | 46
College Connect
“A Social Networking Website”

</td>

</table>

</form>

</body>

</html>

Registration.html
<!DOCTYPE html>

<!--

To change this license header, choose License Headers in Project Properties.

To change this template file, choose Tools | Templates

and open the template in the editor.

-->

<html>

<head>

<title>Member Registration</title>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<style>

ul {

list-style-type: none;

margin: 0;

Page | 47
College Connect
“A Social Networking Website”

padding: 0;

overflow: hidden;

li {

float: left;

li a {

display: block;

color: black;

text-align: center;

padding: 14px 16px;

text-decoration: none;

</style>

</head>

<body>

<form method="post" action="registration" enctype="multipart/form-data">

Page | 48
College Connect
“A Social Networking Website”

<div align="center">

<table width="1340px" border="1">

<tr width="1340px"><td> <img src="pwc.JPG" height="100px" width="1340px"


align="center"/></td></tr>

<tr ><td colspan="2" background="6.jpg"> <img src="download.png" height="100px"


width="200px" align="right">

<h1 valign="center" align="center" >COLLEGE CONNECT "A social networking


website"</h2></td>

</tr>

<tr> <td background="7.jpg">

<ul>

<li><a class="active" href="home.html">Home</a></li>

<li><a href="login.html">Member Login</a></li>

<li><a href="adminlogin.html">Admin</a></li>

</ul></td></tr>

<tr><td colspan="2" background="3.jpg"> <h1 align="center">MEMBER


REGISTRATION</h1></td></tr>

<table width="1340px" border="1" align="center">

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<table>

Page | 49
College Connect
“A Social Networking Website”

<tr><td> Member Type

<select name="memtype" >

<option value="1">Student</option>

<option value="2">Faculty</option>

</select><br><br>

<tr><td> Name <input type="text" name="txtname"


id="txtname"/><br><br></td></tr>

<tr><td> Date of birth &nbsp;<input type="date" name="dob"


id="dob"/><br><br></td></tr>

<tr><td>Department &nbsp;<input type="text" name="dept"


id="dept"/><br><br></td></tr>

<tr><td>Address &nbsp;<input type="text" name="txtadd"


id="txtadd"/><br><br></td></tr>

<tr><td>Contact no. &nbsp;<input type="text" name="cont"


id="cont"/><br><br></td></tr>

<tr><td>Registration id &nbsp;<input type="text" name="regid"


id="regid"/><br><br></td></tr>

<tr><td>Email &nbsp;<input type="text" name="email" id="email"/><br><br></td></tr>

<tr><td> Password &nbsp;<input type="password" name="pwd"


id="pwd"/><br><br></td></tr>

<tr><td> Confirm Password &nbsp;<input type="password" name="cpwd"


id="cpwd"/><br><br></td></tr>

<tr><td>Profile pic &nbsp;<input type="file" id="f" name="f"/><br><br></td></tr>

<tr><td> <input type="submit" name="btnsubmit" value="Submit"/>

<input type="reset" value="Reset"></td></tr>

Page | 50
College Connect
“A Social Networking Website”

<table>

</td>

</tr>

</table>

</table>

<table width="1350px" height="200" border="2" align="center" cellpadding="10"


cellspacing="20" background="bottom_background.jpg">

<td> <div id="user2-wrap"><div id="user2" class="container row clr">

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Contact Us</h3>

<div class="module-body">

<div class="custom" >

<p style="text-align: center;"><img src="patna-womens-college-small.jpg" alt=""


border="0" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>

</div>

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Location</h3>

<div class="module-body">

Page | 51
College Connect
“A Social Networking Website”

<div class="custom" align="center" >

<iframe width="450" height="150" frameborder="0" scrolling="no"


marginheight="0" marginwidth="0"
src="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&amp;h
near=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwloc=A&amp;
output=embed"></iframe><br /><small><a
href="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&amp;
hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwloc=A&am
p;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small></div>

</div>

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Important Links</h3>

<div class="module-body">

<div class="custom" >

<ul>

<li><a href="http://www.ugc.ac.in" target="_blank">University Grants Commission</a></li>

<li><a href="http://www.patnauniversity.ac.in/" target="_blank">Patna University</a></li>

<li><a href="http://www.patnauniversity.ac.in/colleges.html" target="_blank">College of Patna


University</a></li>

Page | 52
College Connect
“A Social Networking Website”

<li><a href="http://india.gov.in" target="_blank">National Portal of India</a></li>

<li><a href="http://righttoinformation.gov.in" target="_blank">RTI</a></li>

<li><a href="/index.php/component/content/article/14-annnual-result/84-annual-
result.html">Annual Result</a></li>

<li><a href="/index.php/component/content/article/15-media-response/85-media-
response.html">Media Response</a></li>

</ul></div>

</div>

</div>

</td>

</table>

</form>

</body>

</html>

registration.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.File;

Page | 53
College Connect
“A Social Networking Website”

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.io.OutputStream;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import javax.servlet.ServletException;

import javax.servlet.annotation.MultipartConfig;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

import javax.servlet.http.Part;

import static jdk.nashorn.internal.objects.NativeError.getFileName;

/**

* @author PWC

*/

@MultipartConfig

Page | 54
College Connect
“A Social Networking Website”

@WebServlet(urlPatterns = {"/registration"})

public class registration extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

try

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

String memtype=request.getParameter("memtype");

String txtname=request.getParameter("txtname");

Page | 55
College Connect
“A Social Networking Website”

String dob=request.getParameter("dob");

String dept=request.getParameter("dept");

String txtadd=request.getParameter("txtadd");

String cont=request.getParameter("cont");

String regid=request.getParameter("regid");

String email=request.getParameter("email");

String pwd=request.getParameter("pwd");

String cpwd=request.getParameter("cpwd");

Part filePart=request.getPart("f");

String profilepic=getFileName(filePart);

String
basePath="C:\\Users\\hp\\Documents\\NetBeansProjects\\college_connect\\web\\propic\\";

InputStream inputStream=null;

OutputStream outputStream=null;

try

File outputFilePath=new File(basePath + profilepic);

inputStream=filePart.getInputStream();

outputStream=new FileOutputStream(outputFilePath);

int read=0;

final byte[]bytes=new byte[1024];

while((read=inputStream.read(bytes))!=-1){

Page | 56
College Connect
“A Social Networking Website”

outputStream.write(bytes,0,read);

catch(Exception ex)

out.println(ex.toString());

finally

if(outputStream!=null){

outputStream.close();

if(inputStream!=null){

inputStream.close();

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeConnect
","CollegeConnect");

Page | 57
College Connect
“A Social Networking Website”

PreparedStatement ps=con.prepareStatement("insert into member_details


(member_type,name,date_of_birth,department,address,contact_no,regid,email,password,confirm
_password,profile_pic)values(?,?,?,?,?,?,?,?,?,?,?)");

ps.setString(1, memtype);

ps.setString(2, txtname);

ps.setString(3, dob);

ps.setString(4, dept);

ps.setString(5, txtadd);

ps.setString(6, cont);

ps.setString(7, regid);

ps.setString(8, email);

ps.setString(9, pwd);

ps.setString(10, cpwd);

ps.setString(11, profilepic);

ps.executeUpdate();

out.println("Successfully Registered");

response.sendRedirect("login.html");

catch(Exception ex)

out.println(ex.toString());

Page | 58
College Connect
“A Social Networking Website”

private String getFileName(Part part){

final String partHeader=part.getHeader("content-disposition");

System.out.println("*****partHeader:"+partHeader);

for(String content:part.getHeader("content-disposition").split(";")){

if(content.trim().startsWith("filename")){

return content.substring(content.indexOf('=')+ 1).trim().replace("\"","");

return null;

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the


left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

Page | 59
College Connect
“A Social Networking Website”

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

Page | 60
College Connect
“A Social Networking Website”

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

forgotpassword.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

Page | 61
College Connect
“A Social Networking Website”

/**

* @author PWC

*/

@WebServlet(urlPatterns = {"/forgetpassword"})

public class forgetpassword extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

out.println("<!DOCTYPE html>");

out.println("<html>");

Page | 62
College Connect
“A Social Networking Website”

out.println("<head>");

out.println("<title>Servlet forgetpassword</title>");

out.println("</head>");

out.println("<body>");

out.println("<html>\n" +

" <head>\n" +

" <title>Forget Password</title>\n" +

" <meta charset=\"UTF-8\">\n" +

" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n" +

" </head>\n" +

" \n" +

" <body>\n" +

" <form method=\"post\" action=\"hintpassword\">\n" +

" <div align=\"center\">\n" +

" <table width=\"1340px\" border=\"1\">\n" +

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\" width=\"1340px\"


align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"200px\" align=\"right\">\n" +

" <h1 valign=\"center\" align=\"center\" >COLLEGE CONNECT \"A social networking


website\"</h2></td>\n" +

" </tr>\n" +

" <tr><td colspan=\"2\" background=\"3.jpg\"> <h1 align=\"center\">Forget


Password</h1></td></tr>\n" +

Page | 63
College Connect
“A Social Networking Website”

" <table width=\"1340px\" border=\"1\" align=\"center\">\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n"+

" Member Type\n" +

" <select name=\"memtype\" >\n" +

" <option value=\"1\">Student</option>\n" +

" <option value=\"2\">Faculty</option>\n" +

" </select><br><br>\n" +

" Name <input type=\"text\" name=\"txtname\" id=\"txtname\"/><br>\n" +

" Date of birth<input type=\"date\" name=\"dob\" id=\"dob\"/><br>\n" +

" Department<input type=\"text\" name=\"dept\" id=\"dept\"/><br>\n" +

" Address<input type=\"text\" name=\"txtadd\" id=\"txtadd\"/><br>\n" +

" Contact no.<input type=\"text\" name=\"cont\" id=\"cont\"/><br>\n" +

" Email <input type=\"text\" name=\"email\" id=\"email\"/><br>\n" +

" <input type=\"submit\" name=\"btnsubmit\" value=\"Submit\"/><br><br>\n" +

" <a href=\"login.html\" class=\"lnk\">Back</a><br>\n" +

" </td>\n" +

" </tr>\n" +

Page | 64
College Connect
“A Social Networking Website”

" </table>\n" +

"<table width=\"1350px\" height=\"200\" border=\"2\" align=\"center\" cellpadding=\"10\"


cellspacing=\"20\" background=\"bottom_background.jpg\">\n" +

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row clr\">\n"


+

" <div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

"<div class=\"custom\" >\n" +

" <p style=\"text-align: center;\"><img src=\"patna-womens-college-small.jpg\"


alt=\"\" border=\"0\" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

Page | 65
College Connect
“A Social Networking Website”

" <iframe width=\"450\" height=\"150\" frameborder=\"0\" scrolling=\"no\"


marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&amp;
hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwloc=A&am
p;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&amp
;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwloc=A&am
p;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger Map</a></small></div>\n"
+

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

Page | 66
College Connect
“A Social Networking Website”

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

" \n" +

" \n" +

" \n" +

" \n" +

" </table>\n" +

" \n" +

" \n" +

" </form>\n" +

" </body>\n" +

" \n" +

"</html>\n" +

"" );

Page | 67
College Connect
“A Social Networking Website”

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the


left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

Page | 68
College Connect
“A Social Networking Website”

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

hintpassword.java
/*

* To change this license header, choose License Headers in Project Properties.

Page | 69
College Connect
“A Social Networking Website”

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

/**

* @author PWC

*/

@WebServlet(urlPatterns = {"/hintpassword"})

public class hintpassword extends HttpServlet {

Page | 70
College Connect
“A Social Networking Website”

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

try

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

String memtype=request.getParameter("memtype");

String txtname=request.getParameter("txtname");

String dob=request.getParameter("dob");

String dept=request.getParameter("dept");

Page | 71
College Connect
“A Social Networking Website”

String txtadd=request.getParameter("txtadd");

String cont=request.getParameter("cont");

String email=request.getParameter("email");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeConnect
","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select password from member_details


where member_type=? and name=? and date_of_birth=? and department=? and address=? and
contact_no=? and email=?");

ps.setString(1, memtype);

ps.setString(2, txtname);

ps.setString(3, dob);

ps.setString(4, dept);

ps.setString(5, txtadd);

ps.setString(6, cont);

ps.setString(7, email);

Page | 72
College Connect
“A Social Networking Website”

ResultSet rs=ps.executeQuery();

if(rs.next())

out.println("<html>\n" +

" <head>\n" +

" <title>TODO supply a title</title>\n" +

" <meta charset=\"UTF-8\">\n" +

" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n" +

" </head>\n" +

" \n" +

" <body>\n" +

" <form method=\"post\" action=\"login.html\">\n" +

" <div align=\"center\">\n" +

"<table width=\"1340px\" border=\"1\">\n" +

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\" width=\"1340px\"


align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"200px\" align=\"right\">\n" +

" <h1 valign=\"center\" align=\"center\" >COLLEGE CONNECT \"A social networking


website\"</h2></td>\n" +

" </tr>\n" +

Page | 73
College Connect
“A Social Networking Website”

" <tr><td colspan=\"2\" background=\"3.jpg\"> <h1 align=\"center\">Hint


Password</h1></td></tr>\n" +

" <table width=\"1340px\" border=\"1\" align=\"center\">\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n"+

" \n" +

" Password:"+rs.getString(1)+"\n" +

" <input type=\"submit\" name=\"btnsubmit\" value=\"OK\"/><br><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br>\n" +

" </td>\n" +

" </tr>\n" +

" <table width=\"1350px\" height=\"200\" border=\"2\" align=\"center\"


cellpadding=\"10\" cellspacing=\"20\" background=\"bottom_background.jpg\">\n" +

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row clr\">\n"


+

" <div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

"<div class=\"custom\" >\n" +

Page | 74
College Connect
“A Social Networking Website”

" <p style=\"text-align: center;\"><img src=\"patna-womens-college-small.jpg\"


alt=\"\" border=\"0\" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

" <iframe width=\"450\" height=\"150\" frameborder=\"0\" scrolling=\"no\"


marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&amp;
hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwloc=A&am
p;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&amp
;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwloc=A&am
p;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger Map</a></small></div>\n"
+

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

"<div class=\"module span_4 col clr\">\n" +

Page | 75
College Connect
“A Social Networking Website”

" <h3 class=\"module-title\" align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

" \n" +

Page | 76
College Connect
“A Social Networking Website”

" \n" +

" \n" +

" \n" +

" </table>\n" +

" \n" +

" \n" +

" </form>\n" +

" </body>\n" +

" \n" +

"</html>\n" +

"");

catch(Exception ex)

out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the


left to edit the code.">

Page | 77
College Connect
“A Social Networking Website”

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

Page | 78
College Connect
“A Social Networking Website”

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

Member Login.html
<!DOCTYPE html>

<!--

To change this license header, choose License Headers in Project Properties.

To change this template file, choose Tools | Templates

and open the template in the editor.

-->

Page | 79
College Connect
“A Social Networking Website”

<html>

<head>

<title>Member Login</title>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="mystyle.css" rel="stylesheet" type="text/css"/>

<style>

ul {

list-style-type: none;

margin: 0;

padding: 0;

overflow: hidden;

li {

float: left;

li a {

display: block;

color: black;

text-align: center;

Page | 80
College Connect
“A Social Networking Website”

padding: 14px 16px;

text-decoration: none;

</style>

</head>

<body >

<form method="post" action="login">

<div align="center">

<table width="1340px" border="1" align="center">

<tr width="1340px"><td> <img src="pwc.JPG" height="100px" width="1340px"


align="center"/></td></tr>

<tr ><td colspan="2" background="6.jpg"> <img src="download.png" height="100px"


width="200px" align="right"> <h1 align="center">COLLEGE CONNECT "A social networking
website"</h2></td></tr>

<tr> <td background="7.jpg">

<ul>

<li><a class="active" href="home.html">Home</a></li>

<li><a href="registration.html">Register</a></li>

<li><a href="adminlogin.html">Admin</a></li>

<li><a href="notice">Notice</a></li>

Page | 81
College Connect
“A Social Networking Website”

<li><a href="http://www.patnawomenscollege.in/index.php/notices/281-admission-notice-
2018.html">Admission Notice</a><li>

</ul></td></tr>

<tr><td colspan="2" background="3.jpg"> <h1 align="center">MEMBER


LOGIN</h1></td></tr>

<tr><td height="400px" valign="top" align="center" background="5.jpg">

<br>

<br>

<br>

<table >

<tr><td>Email id &nbsp;<input type="text" name="email" id="email"><br>


<br></tr></td>

<tr><td> Password &nbsp;<input type="text" name="pwd" id="pwd"> <br><br>


</tr></td>

<tr><td> Member Type &nbsp;

<select name="memtype" >

<option value="1">Student</option>

<option value="2">Faculty</option>

</select><br><br></tr></td>

<tr><td><a href="forgetpassword">Forget Password</a><br></tr></td>

Page | 82
College Connect
“A Social Networking Website”

<tr><td align="center"> <input type="submit" name="btnsubmit"


value="Login"><br><br></tr></td>

</table>

</td>

</tr>

<!--<tr><td colspan="2" height="10px" valign="top" background="3.jpg">


<h2>[email protected]</h2><h2 align="right">contact us :9987654333</h2></td></tr>-->

<tr><td background="bottom_background.jpg">

<table align="center" cellpadding="10"cellspacing="20">

<td> <div id="user2-wrap"><div id="user2" class="container row clr">

<div class="module span_4 col clr">

<h3 class="module-title">Contact Us</h3>

<div class="module-body">

<div class="custom" >

<p style="text-align: left;"><img src="patna-womens-college-small.jpg" alt=""


border="0" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>

Page | 83
College Connect
“A Social Networking Website”

</div>

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title">Location</h3>

<div class="module-body">

<div class="custom" >

<iframe width="295" height="170" frameborder="0" scrolling="no"


marginheight="0" marginwidth="0"
src="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&amp;h
near=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwloc=A&amp;
output=embed"></iframe><br /><small><a
href="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&amp;
hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwloc=A&am
p;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small></div>

</div>

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title">Important Links</h3>

<div class="module-body">

Page | 84
College Connect
“A Social Networking Website”

<div class="custom" >

<ul>

<li><a href="http://www.ugc.ac.in" target="_blank">University Grants Commission</a></li>

<li><a href="http://www.patnauniversity.ac.in/" target="_blank">Patna University</a></li>

<li><a href="http://www.patnauniversity.ac.in/colleges.html" target="_blank">College of Patna


University</a></li>

<li><a href="http://india.gov.in" target="_blank">National Portal of India</a></li>

<li><a href="http://righttoinformation.gov.in" target="_blank">RTI</a></li>

<li><a href="/index.php/component/content/article/14-annnual-result/84-annual-
result.html">Annual Result</a></li>

<li><a href="/index.php/component/content/article/15-media-response/85-media-
response.html">Media Response</a></li>

</ul></div>

</div>

</div>

</td>

</tr></tr>

</table>

</td></tr>

</table>

</form>

</body>

</html>

Page | 85
College Connect
“A Social Networking Website”

memberLogin.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

@WebServlet(urlPatterns = {"/login"})

public class login extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

Page | 86
College Connect
“A Social Networking Website”

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

try

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeConnect
","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select * from member_details where


email=? and password=? and Member_Type=?");

ps.setString(1,request.getParameter("email"));

ps.setString(2,request.getParameter("pwd"));

ps.setString(3,request.getParameter("memtype"));

ResultSet rs=ps.executeQuery();

Page | 87
College Connect
“A Social Networking Website”

if(rs.next())

HttpSession ses=request.getSession();

ses.setAttribute("uid", rs.getString(2));

if(request.getParameter("memtype").equals("1"))

response.sendRedirect("template.html");

else if(request.getParameter("memtype").equals("2"))

response.sendRedirect("Faculty.html");

//out.println("Successfully Login");

else

// out.println("Invalid User id / password");

out.println("<script type=\"text/javascript\">");

out.println("alert(Invalid User id/Password);");

out.println("location='login.html';");

out.println("</script>");

catch(Exception ex)

out.println(ex.toString());

Page | 88
College Connect
“A Social Networking Website”

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the


left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

Page | 89
College Connect
“A Social Networking Website”

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

Student.html
<!DOCTYPE html>

Page | 90
College Connect
“A Social Networking Website”

<!--

To change this license header, choose License Headers in Project Properties.

To change this template file, choose Tools | Templates

and open the template in the editor.

-->

<html>

<head>

<title>Student</title>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="mystyle.css" rel="stylesheet" type="text/css"/>

</head>

<body>

<form method="post" action="template.html">

<div align="center">

<table width="1340px" border="1" align="center">

<tr width="1340px"><td> <img src="pwc.JPG" height="100px" width="1340px"


align="center"/></td></tr>

<tr ><td colspan="2" background="6.jpg"> <img src="download.png"


height="100px" width="200px" align="right"> <h1 align="center">COLLEGE CONNECT "A
social networking website"</h2></td></tr>

Page | 91
College Connect
“A Social Networking Website”

<tr><td colspan="2" background="3.jpg"> <h1 align="center">Student


Profile</h1></td></tr>

<table width="1350px" border="1" align="center" >

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<a href="myprofile" >My Profile</a><br><br>

<a href="editprofile.jsp" >Edit Profile</a><br><br>

<a href="view_notification" >View Notification</a><br><br>

<a href="s_post_comments.jsp" >Post & Comment</a><br><br>

<a href="view_result.jsp" >View Result</a><br><br>

<a href="exam_details.jsp" >View Exam Details</a><br><br>

<a href="logout" >Logout</a><br>

</td>

</tr>

</table>

</table>

<table width="1350px" height="200" border="2" align="center"


cellpadding="10" cellspacing="20" background="bottom_background.jpg">

<td> <div id="user2-wrap"><div id="user2" class="container row clr">

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Contact Us</h3>

<div class="module-body">

Page | 92
College Connect
“A Social Networking Website”

<div class="custom" >

<p style="text-align: center;"><img src="patna-womens-college-small.jpg" alt=""


border="0" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>

</div>

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Location</h3>

<div class="module-body">

<div class="custom" align="center" >

<iframe width="450" height="150" frameborder="0" scrolling="no" marginheight="0"


marginwidth="0"
src="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed"></iframe><br /><small><a
href="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed" style="color:#0000FF;text-align:left">View Larger
Map</a></small></div>

</div>

</div></td>

<td>

Page | 93
College Connect
“A Social Networking Website”

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Important Links</h3>

<div class="module-body">

<div class="custom" >

<ul>

<li><a href="http://www.ugc.ac.in" target="_blank">University Grants Commission</a></li>

<li><a href="http://www.patnauniversity.ac.in/" target="_blank">Patna University</a></li>

<li><a href="http://www.patnauniversity.ac.in/colleges.html" target="_blank">College of


Patna University</a></li>

<li><a href="http://india.gov.in" target="_blank">National Portal of India</a></li>

<li><a href="http://righttoinformation.gov.in" target="_blank">RTI</a></li>

<li><a href="/index.php/component/content/article/14-annnual-result/84-annual-
result.html">Annual Result</a></li>

<li><a href="/index.php/component/content/article/15-media-response/85-media-
response.html">Media Response</a></li>

</ul></div>

</div>

</div>

</td>

</table>

</form>

</body>

</html>

Page | 94
College Connect
“A Social Networking Website”

studentProfile.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.*;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

WebServlet(urlPatterns = {"/myprofile"})

public class myprofile extends HttpServlet {

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

Page | 95
College Connect
“A Social Networking Website”

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select * from member_details where


account_id=?");

ps.setString(1,uid);

// out.println(uid);

ResultSet rs=ps.executeQuery();

if(rs.next())

out.println("<html>\n" +

" <head>\n" +

" <title>My Profile</title>\n" +

" <meta charset=\"UTF-8\">\n" +

" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n" +

" </head>\n" +

" <body>\n" +

Page | 96
College Connect
“A Social Networking Website”

" <form method=\"post\" action=\"myprofile\">\n" +

" <div align=\"center\">\n" +

"\n" +

" <table width=\"1340px\" border=\"1\" align=\"center\">\n" +

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\"


width=\"1340px\" align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"200px\" align=\"right\"> <h1 align=\"center\">COLLEGE CONNECT
\"A social networking website\"</h2></td></tr>\n" +

" <tr><td colspan=\"2\" background=\"3.jpg\"> <h1 align=\"center\">My


Profile</h1></td></tr>\n" +

" <table width=\"1350px\" border=\"1\" align=\"center\" >\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n"+

" <a href=\"editprofile.jsp\" class=\"lnk\">Edit profile</a><br>\n" +

" <a href=\"view_notification\" class=\"lnk\">View Notification</a><br>\n" +

" <a href=\"s_post_comments.jsp\" class=\"lnk\">Post &


Comment</a><br>\n" +

" <a href=\"view_result.jsp\" class=\"lnk\">View Result</a><br>\n" +

" <a href=\"exam_details.jsp\" class=\"lnk\">View Exam Details</a><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br>\n" +

" </td><td width=\"750px\" background=\"11.jpg\" align=\"center\">\n" +

" <table >\n" +

" <tr><td>Name</td><td>"+rs.getString(3)+"</td></tr> \n" +

Page | 97
College Connect
“A Social Networking Website”

" <tr><td>Date of Birth</td><td>"+rs.getString(4)+"</td></tr> \n" +

" <tr><td>Department</td><td>"+rs.getString(5)+"</td></tr> \n" +

" <tr><td>Address</td><td>"+rs.getString(6)+"</td></tr> \n" +

" <tr><td>Contact number</td><td>"+rs.getString(7)+"</td></tr> \n" +

" <tr><td>Registration id</td><td>"+rs.getString(8)+"</td></tr> \n" +

" <tr><td>Email</td><td>"+rs.getString(9)+"</td></tr> \n" +

" <tr><td>Password</td><td>"+rs.getString(10)+"</td></tr> \n" +

" <tr><td>Profile Pic</td><td><img


src='propic/"+rs.getString(12)+"'height='100px' width='100px'/></td></tr>\n" +

" </table>\n" +

" </td>\n" +

" </tr>\n" +

" \n" +

" <table width=\"1350px\" height=\"200\" border=\"2\"


align=\"center\" cellpadding=\"10\" cellspacing=\"20\"
background=\"bottom_background.jpg\">\n" +

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row


clr\">\n" +

" <div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

Page | 98
College Connect
“A Social Networking Website”

"<div class=\"custom\" >\n" +

" <p style=\"text-align: center;\"><img src=\"patna-womens-college-small.jpg\" alt=\"\"


border=\"0\" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

" <iframe width=\"450\" height=\"150\" frameborder=\"0\" scrolling=\"no\"


marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger
Map</a></small></div>\n" +

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

Page | 99
College Connect
“A Social Networking Website”

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

Page | 100
College Connect
“A Social Networking Website”

" \n" +

" \n" +

" \n" +

" \n" +

" </table>\n" +

" </div>\n" +

" </form>\n" +

" \n" +

" \n" +

" </body>\n" +

"</html>\n" +

"");

catch(Exception ex)

System.out.println(ex.toString());

Page | 101
College Connect
“A Social Networking Website”

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

Page | 102
College Connect
“A Social Networking Website”

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

editProfile.jsp
<%--

Document : editprofile

Created on : Feb 7, 2018, 7:19:32 PM

Author : VL-8p

Page | 103
College Connect
“A Social Networking Website”

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Edit Profile</title>

<link href="mystyle.css" rel="style.css" type="text/css"/>

</head>

<body>

<form method="post" action="editprofile" enctype="multipart/form-data">

<div align="center">

<table width="1000px" border="1">

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

<tr><td colspan="2" background="3.jpg"> <h1 align="center">Edit


Profile</h1></td></tr>

<table width="1340px" border="1" align="center">

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<a href="f_myprofile" class="lnk">My profile</a><br>

<a href="view_notification" class="lnk">View Notification</a><br>

<a href="s_post_comments.jsp" class="lnk">Post & Comment</a><br>

Page | 104
College Connect
“A Social Networking Website”

<a href="view_result.jsp" class="lnk">View Result</a><br>

<a href="exam_details.jsp" class="lnk">View Exam Details</a><br>

<a href="logout" class="lnk">Logout</a><br></td>

<td width="600px" align="center" background="11.jpg">

Address &nbsp;<input type="text" name="txtadd" id="txtadd"/><br></br>

Contact no &nbsp;<input type="text" name="cont" id="cont"/><br></br>

Profile Picture &nbsp;<input type="file" name="f" id="f"/></br></br>

<input type="Submit" name="btnsubmit" value="OK"/>

</td></tr>

</table>

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

</div>

</form>

</body>

</html>

viewNotification.java
/*

* To change this license header, choose License Headers in Project Properties.

Page | 105
College Connect
“A Social Networking Website”

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

/**

* @author PWC

*/

@WebServlet(urlPatterns = {"/view_notification"})

public class view_notification extends HttpServlet {

Page | 106
College Connect
“A Social Networking Website”

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

//HttpSession ses=request.getSession();

//String uid=(String)ses.getAttribute("uid");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select notice from notification ");

//ps.setString(1,uid);

// out.println(uid);

Page | 107
College Connect
“A Social Networking Website”

ResultSet rs=ps.executeQuery();

out.println("<html>\n" +

" <head>\n" +

" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +

" <title>View Notification</title>\n" +

" <link href=\"mystyle.css\" rel=\"style.css\" type=\"text/css\"/>\n" +

" </head>\n" +

" <body>\n" +

" <form method=\"post\" action=\"view_notification\">\n" +

" \n" +

" <div align=\"center\">\n" +

" <table width=\"1340px\" border=\"1\" align=\"center\">\n" +

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\"


width=\"1340px\" align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"200px\" align=\"right\"> <h1 align=\"center\">COLLEGE CONNECT
\"A social networking website\"</h2></td></tr>\n" +

" <tr><td colspan=\"2\" background=\"3.jpg\"> <h1 align=\"center\">View


Notification</h1></td></tr>\n" +

" <table width=\"1350px\" border=\"1\" align=\"center\" >\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n"+

" <a href=\"myprofile\" class=\"lnk\">My Profile</a><br>\n" +

Page | 108
College Connect
“A Social Networking Website”

" <a href=\"editprofile.jsp\" class=\"lnk\">Edit profile</a><br>\n" +

" <a href=\"s_post_comments.jsp\" class=\"lnk\">Post &


Comment</a><br>\n" +

" <a href=\"view_result.jsp\" class=\"lnk\">View Result</a><br>\n" +

" <a href=\"exam_details.jsp\" class=\"lnk\">View Exam Details</a><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br></td>\n" +

" <td height=\"400px\" align=\"center\" background=\"11.jpg\">\n" +

" <table><tr><td >\n"

);

while(rs.next())

out.println("<li> "+rs.getString(1)+"</li>\n");

out.println(

" \n" +

" </td></tr> </table>\n" +

" </td></tr>\n" +

" \n" +

" <table width=\"1350px\" height=\"200\" border=\"2\" align=\"center\"


cellpadding=\"10\" cellspacing=\"20\" background=\"bottom_background.jpg\">\n" +

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row


clr\">\n" +

" <div class=\"module span_4 col clr\">\n"


+

Page | 109
College Connect
“A Social Networking Website”

" <h3 class=\"module-title\"


align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

"<div class=\"custom\" >\n" +

" <p style=\"text-align: center;\"><img


src=\"patna-womens-college-small.jpg\" alt=\"\" border=\"0\" /><br />Bailey Road, Patna
Bihar, <strong>PIN</strong> - 800001<br /><strong>Call</strong> : +91 612 2531186<br
/><strong>Email :</strong> [email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\"


align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

" <iframe width=\"450\" height=\"150\"


frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&

Page | 110
College Connect
“A Social Networking Website”

amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger
Map</a></small></div>\n" +

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\"


align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

Page | 111
College Connect
“A Social Networking Website”

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

" \n" +

" \n" +

" \n" +

" \n" +

" </table>\n"+

" </div>\n" +

" </form> \n" +

" </body>\n" +

"</html>\n" +

"");

catch(Exception ex)

System.out.println(ex.toString());

Page | 112
College Connect
“A Social Networking Website”

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

Page | 113
College Connect
“A Social Networking Website”

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

viewResult.jsp
<%--

Page | 114
College Connect
“A Social Networking Website”

Document : view_result

Created on : Feb 8, 2018, 2:18:48 PM

Author : PWC

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>View Result</title>

<link href="mystyle.css" rel="style.css" type="text/css"/>

</head>

<body>

<form method="post" action="viewResult">

<div align="center">

<table width="1340px" border="1" align="center">

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

<tr><td colspan="2" background="3.jpg"> <h1 align="center">View


Result</h1></td></tr>

<table width="1350px" border="1" align="center" >

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

Page | 115
College Connect
“A Social Networking Website”

<a href="myprofile" class="lnk">My profile</a><br>

<a href="view_notification" class="lnk">View Notification</a><br>

<a href="s_post_comments.jsp" class="lnk">Post & Comment</a><br>

<a href="editprofile.jsp" class="lnk">Edit profile</a><br>

<a href="exam_details.jsp" class="lnk">View Exam Details</a><br>

<a href="logout" class="lnk">Logout</a><br>

</td>

<td height="400px" align="center" background="11.jpg">

Registration Id &nbsp;<input type="text" id="regid" name="regid">

<input type="Submit" id="btnsubmit" value="Submit"><br></td>

</tr>

<%-- <table>

<tr><td></td>Registration Id<td></td></tr>

<tr><td>Marks</td><td></td></tr>

<tr><td>Percentage</td><td></td></tr>

<tr><td>Division</td><td></td></tr>

</table>--%>

</table>

</table>

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

</div>

</form>

Page | 116
College Connect
“A Social Networking Website”

</body>

</html>

viewResult.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

/**

Page | 117
College Connect
“A Social Networking Website”

* @author PWC

*/

@WebServlet(urlPatterns = {"/viewResult"})

public class viewResult extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

//HttpSession ses=request.getSession();

// String uid=(String)ses.getAttribute("uid");

String regid=request.getParameter("regid");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Page | 118
College Connect
“A Social Networking Website”

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select * from Result where Regid=?");

ps.setString(1,regid);

// out.println(uid);

ResultSet rs=ps.executeQuery();

if(rs.next())

out.println("<html>\n" +

" <head>\n" +

" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +

" <title>View Result</title>\n" +

" <link href=\"mystyle.css\" rel=\"style.css\" type=\"text/css\"/>\n" +

" </head>\n" +

" <body>\n" +

" <form method=\"post\" action=\"viewResult\">\n" +

" <div align=\"center\">\n" +

" <table width=\"1340px\" border=\"1\" align=\"center\">\n" +

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\"


width=\"1340px\" align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"200px\" align=\"right\"> <h1 align=\"center\">COLLEGE CONNECT
\"A social networking website\"</h2></td></tr>\n" +

Page | 119
College Connect
“A Social Networking Website”

" <tr><td colspan=\"2\" background=\"3.jpg\"> <h1 align=\"center\">View


Result</h1></td></tr>\n" +

" <table width=\"1350px\" border=\"1\" align=\"center\" >\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n"+

" <a href=\"myprofile\" class=\"lnk\">My Profile</a><br>\n" +

" <a href=\"view_notification\" class=\"lnk\">View Notification</a><br>\n" +

" <a href=\"s_post_comments.jsp\" class=\"lnk\">Post &


Comment</a><br>\n" +

" <a href=\"editprofile.jsp\" class=\"lnk\">Edit profile</a><br>\n" +

" <a href=\"exam_details.jsp\" class=\"lnk\">View Exam Details</a><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br></td>\n" +

" <td height=\"400px\" align=\"center\" background=\"11.jpg\">\n" +

" <table>\n" +

" <tr><td>Registration Id</td><td>"+rs.getString(1)+"</td></tr>\n" +

" <tr><td>Marks</td><td>"+rs.getString(2)+"</td></tr> \n" +

" <tr><td>Percentage</td><td>"+rs.getString(3)+"</td></tr> \n" +

" <tr><td>Division</td><td>"+rs.getString(4)+"</td></tr>\n" +

"</table>\n" +

"</table>\n" +

" <table width=\"1350px\" height=\"200\" border=\"2\" align=\"center\"


cellpadding=\"10\" cellspacing=\"20\" background=\"bottom_background.jpg\">\n" +

Page | 120
College Connect
“A Social Networking Website”

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row


clr\">\n" +

" <div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

"<div class=\"custom\" >\n" +

" <p style=\"text-align: center;\"><img src=\"patna-womens-college-small.jpg\" alt=\"\"


border=\"0\" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

" <iframe width=\"450\" height=\"150\" frameborder=\"0\" scrolling=\"no\"


marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo

Page | 121
College Connect
“A Social Networking Website”

c=A&amp;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger
Map</a></small></div>\n" +

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

Page | 122
College Connect
“A Social Networking Website”

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

" \n" +

" \n" +

" \n" +

" \n" +

" </table>\n"+

" </div>\n" +

" </form>\n" +

" </body>\n" +

"</html>\n" +

"");

catch(Exception e)

System.out.println(e.toString());

Page | 123
College Connect
“A Social Networking Website”

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

Page | 124
College Connect
“A Social Networking Website”

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

viewExamDetails.jsp
<%--

Document : exam_details

Page | 125
College Connect
“A Social Networking Website”

Created on : Feb 8, 2018, 2:03:36 PM

Author : PWC

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>View Exam Details</title>

<link href="mystyle.css" rel="style.css" type="text/css"/>

</head>

<body>

<form method="post" action="exam_details">

<div align="center">

<table width="1000px" border="1">

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

<tr><td colspan="2" background="3.jpg"> <h1 align="center">View Exam


Details</h1></td></tr>

<table width="1340px" border="1" align="center">

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<a href="myprofile" class="lnk">My Profile</a><br>

Page | 126
College Connect
“A Social Networking Website”

<a href="editprofile.jsp" class="lnk">Edit Profile</a><br>

<a href="view_notification" class="lnk">View Notification</a><br>

<a href="s_post_comments.jsp" class="lnk">Post & Comment</a><br>

<a href="view_result.jsp" class="lnk">View Result</a><br>

<a href="logout" class="lnk">Logout</a><br></td>

<td height="400px" align="center" background="11.jpg">

Select semester<select name="sem" >

<option value="Sem1">Sem1</option>

<option value="Sem2">Sem2</option>

<option value="Sem3">Sem3</option>

<option value="Sem4">Sem4</option>

<option value="Sem5">Sem5</option>

<option value="Sem6">Sem6</option>

</select><br><br>

<%-- <table>

<tr><td>Semester</td><td></td></tr>

<tr><td>Start Date</td><td></td></tr>

<tr><td>Time</td><td></td></tr>

<tr><td>Center</td><td></td></tr>

<table>--%>

Page | 127
College Connect
“A Social Networking Website”

<input type="Submit" id="btnsubmit" value="Submit"><br></td></tr>

</table>

</table>

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

</div>

</form>

</body>

</html>

viewExamDetails.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

Page | 128
College Connect
“A Social Networking Website”

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

/**

* @author PWC

*/

@WebServlet(urlPatterns = {"/exam_details"})

public class exam_details extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

Page | 129
College Connect
“A Social Networking Website”

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

String sem=request.getParameter("sem");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select * from examination_details


where semester=?");

ps.setString(1,sem);

// out.println(uid);

ResultSet rs=ps.executeQuery();

if(rs.next())

out.println("<html>\n" +

" <head>\n" +

" <title>View Exam Detais</title>\n" +

" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +

" <title>JSP Page</title>\n" +

" <link href=\"mystyle.css\" rel=\"style.css\" type=\"text/css\"/>\n" +

Page | 130
College Connect
“A Social Networking Website”

" </head>\n" +

" <body>\n" +

" <form method=\"post\" action=\"exam_details\">\n" +

" <div align=\"center\">\n" +

" <table width=\"1340px\" border=\"1\" align=\"center\">\n" +

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\"


width=\"1340px\" align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"100px\" align=\"right\"> <h1 align=\"center\">COLLEGE CONNECT
\"A social networking website\"</h2></td></tr>\n" +

" <tr><td colspan=\"2\" background=\"3.jpg\"> <h1 align=\"center\">View Exam


Details</h1></td></tr>\n" +

" <table width=\"1350px\" border=\"1\" align=\"center\" >\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n" +

" <a href=\"template.html\" class=\"lnk\">My Profile</a><br>\n" +

" <a href=\"view_notification\" class=\"lnk\">View Notification</a><br>\n" +

" <a href=\"s_post_comments.jsp\" class=\"lnk\">Post & Comment</a><br>\n"


+

" <a href=\"view_result.jsp\" class=\"lnk\">View Result</a><br>\n" +

" <a href=\"editprofile.jsp\" class=\"lnk\">Edit Profile</a><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br>"

+ "</td>\n" +

" <td height=\"400px\" align=\"center\" background=\"11.jpg\">\n" +

Page | 131
College Connect
“A Social Networking Website”

"<table>\n"+

" <tr><td>Semester </td><td>"+rs.getString(1)+"</td></tr>\n" +

" <tr><td>Start Date </td><td>"+rs.getString(2)+"</td></tr> \n" +

" <tr><td>Time </td><td>"+rs.getString(3)+"</td></tr> \n" +

" <tr><td>Center </td><td>"+rs.getString(4)+"</td></tr> \n" +

" </table>\n" +

" \n" +

"</td>\n"+

"</tr>\n"+

"\n" +

" <table width=\"1350px\" height=\"200\" border=\"2\"


align=\"center\" cellpadding=\"10\" cellspacing=\"20\"
background=\"bottom_background.jpg\">\n" +

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row


clr\">\n" +

" <div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

"<div class=\"custom\" >\n" +

Page | 132
College Connect
“A Social Networking Website”

" <p style=\"text-align: center;\"><img src=\"patna-womens-college-small.jpg\" alt=\"\"


border=\"0\" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

" <iframe width=\"450\" height=\"150\" frameborder=\"0\" scrolling=\"no\"


marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger
Map</a></small></div>\n" +

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

"<div class=\"module span_4 col clr\">\n" +

Page | 133
College Connect
“A Social Networking Website”

" <h3 class=\"module-title\" align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

" \n" +

Page | 134
College Connect
“A Social Networking Website”

" \n" +

" \n" +

" \n" +

" </table>\n" +

" \n" +

" </form>\n" +

" </body>\n" +

"</html>");

catch(Exception e)

System.out.println(e.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

Page | 135
College Connect
“A Social Networking Website”

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

Page | 136
College Connect
“A Social Networking Website”

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

postComment.jsp
<%--

Document : s_post_comments

Created on : Mar 6, 2018, 11:29:12 AM

Author : PWC

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

<head>

Page | 137
College Connect
“A Social Networking Website”

<title>Posts</title>

<link href="mystyle.css" rel="style.css" type="text/css"/>

</head>

<body>

<form method="post" action="post" enctype="multipart/form-data">

<div align="center">

<table width="1340px" border="1" align="center">

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

<tr><td colspan="2" background="3.jpg"> <h1 align="center">Posts &


Comments</h1></td></tr>

<table width="1350px" border="1" align="center" >

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<a href="myprofile" class="lnk">My Profile</a><br>

<a href="editprofile.jsp" class="lnk">Edit Profile</a><br>

<a href="view_notification" class="lnk">View Notification</a><br>

<a href="viewResult" class="lnk">View Result</a><br>

<a href="exam_details" class="lnk">View Exam Details</a><br>

<a href="logout" class="lnk">Logout</a><br>

<td height="400px" align="center" class="lnk" background="11.jpg">

Add Post<input type="text" name="post" id="post">

Page | 138
College Connect
“A Social Networking Website”

<input type="file" name="f" id="f">

<input type="Submit" name="btnsubmit" value="Post">

</td>

</tr>

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

</table>

</div>

</form>

</body>

</html>

post.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.File;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

Page | 139
College Connect
“A Social Networking Website”

import java.io.OutputStream;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import javax.servlet.ServletException;

import javax.servlet.annotation.MultipartConfig;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

import javax.servlet.http.Part;

/**

* @author PWC

*/

@MultipartConfig

@WebServlet(urlPatterns = {"/post"})

public class post extends HttpServlet {

/**

Page | 140
College Connect
“A Social Networking Website”

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

try

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

String post=request.getParameter("post");

Part filePart=request.getPart("f");

String profilepic=getFileName(filePart);

String
basePath="C:\\Users\\hp\\Documents\\NetBeansProjects\\college_connect\\web\\propic\\";

InputStream inputStream=null;

Page | 141
College Connect
“A Social Networking Website”

OutputStream outputStream=null;

try

File outputFilePath=new File(basePath + profilepic);

inputStream=filePart.getInputStream();

outputStream=new FileOutputStream(outputFilePath);

int read=0;

final byte[]bytes=new byte[1024];

while((read=inputStream.read(bytes))!=-1){

outputStream.write(bytes,0,read);

catch(Exception ex)

out.println(ex.toString());

finally

if(outputStream!=null){

outputStream.close();

if(inputStream!=null){

Page | 142
College Connect
“A Social Networking Website”

inputStream.close();

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("insert into post


(account_id,post,image) values(?,?,?)");

ps.setString(1,uid);

ps.setString(2,post);

ps.setString(3,profilepic);

ps.executeUpdate();

// out.println("posted");

response.sendRedirect("postview");

catch(Exception ex)

out.println(ex.toString());

Page | 143
College Connect
“A Social Networking Website”

private String getFileName(Part part){

final String partHeader=part.getHeader("content-disposition");

System.out.println("*****partHeader:"+partHeader);

for(String content:part.getHeader("content-disposition").split(";")){

if(content.trim().startsWith("filename")){

return content.substring(content.indexOf('=')+ 1).trim().replace("\"","");

return null;

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

Page | 144
College Connect
“A Social Networking Website”

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

Page | 145
College Connect
“A Social Networking Website”

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

postView.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

Page | 146
College Connect
“A Social Networking Website”

import javax.servlet.RequestDispatcher;

import javax.servlet.ServletException;

import javax.servlet.annotation.MultipartConfig;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

/**

* @author PWC

*/

@MultipartConfig

@WebServlet(urlPatterns = {"/postview"})

public class postview extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

Page | 147
College Connect
“A Social Networking Website”

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select post_id, post,image from post");

//ps.setString(1,uid);

// out.println(uid);

ResultSet rs=ps.executeQuery();

if(rs.next())

Page | 148
College Connect
“A Social Networking Website”

out.println("<html>\n" +

" <head>\n" +

" <title>Post & Comments</title>\n" +

" <meta charset=\"UTF-8\">\n" +

" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n" +

" </head>\n" +

" <body>\n" +

" <form method=\"post\" action=\"comment\">\n" +

" <div align=\"center\">\n" +

"\n" +

" <table width=\"1340px\" border=\"1\" align=\"center\">\n" +

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\"


width=\"1340px\" align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"200px\" align=\"right\"> <h1 align=\"center\">COLLEGE CONNECT
\"A social networking website\"</h2></td></tr>\n" +

" <tr><td colspan=\"2\" background=\"3.jpg\"> <h1 align=\"center\">Posts &


Comments</h1></td></tr>\n" +

" <table width=\"1350px\" border=\"1\" align=\"center\" >\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n"+

" <a href=\"myprofile\" class=\"lnk\">My profile</a><br>\n" +

" <a href=\"editprofile.jsp\" class=\"lnk\">Edit profile</a><br>\n" +

" <a href=\"view_notification\" class=\"lnk\">View Notification</a><br>\n" +

Page | 149
College Connect
“A Social Networking Website”

" \n" +

" <a href=\"view_result.jsp\" class=\"lnk\">View Result</a><br>\n" +

" <a href=\"exam_details.jsp\" class=\"lnk\">View Exam Details</a><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br>\n" +

" <td height=\"400px\" align=\"center\" class=\"lnk\"


background=\"11.jpg\">\n" +

" <div style='overflow-y:scroll;overflow-y:overflow;width:750px;height:400px'>\n" +

" <table>\n"

);

String p;

while(rs.next()){

p= rs.getString(1);

//request.setAttribute("postid",p);

// RequestDispatcher rd = request.getRequestDispatcher(p);

//rd.forward(request,response);

out.println(

"<tr><td>Posts</td><td>"+rs.getString(2)+"</td></tr> \n" +

" <tr><td><img src='propic/"+rs.getString(3)+"'height='100px'


width='100px'/> </tr></td>\n"+

" <tr><td> Comment<input type=\"text\" name=\"comment\"


id=\"comment\"></td>\n" +

Page | 150
College Connect
“A Social Networking Website”

" <td> <input type=\"submit\" name=\"btnsubmit\"


value=\"Comment\"></td></tr>\n" +

" </div>\n" );}

out.println(

" \n" +

" </td></tr> </table>\n" +

"</div>\n" +

" \n" +

" \n" +

" </td>\n" +

" \n" +

" </tr>\n" +

Page | 151
College Connect
“A Social Networking Website”

" </table>\n" +

"\n" +

" \n" +

" <table width=\"1350px\" height=\"200\" border=\"2\"


align=\"center\" cellpadding=\"10\" cellspacing=\"20\"
background=\"bottom_background.jpg\">\n" +

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row


clr\">\n" +

" <div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

"<div class=\"custom\" >\n" +

" <p style=\"text-align: center;\"><img src=\"patna-womens-college-small.jpg\" alt=\"\"


border=\"0\" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

Page | 152
College Connect
“A Social Networking Website”

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

" <iframe width=\"450\" height=\"150\" frameborder=\"0\" scrolling=\"no\"


marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger
Map</a></small></div>\n" +

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

Page | 153
College Connect
“A Social Networking Website”

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

" \n" +

" \n" +

" \n" +

" \n" +

" </table>"+

" </div>\n" +

" </form>\n" +

" </body>\n" +

"</html>");

Page | 154
College Connect
“A Social Networking Website”

catch(Exception ex)

System.out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

Page | 155
College Connect
“A Social Networking Website”

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

Page | 156
College Connect
“A Social Networking Website”

return "Short description";

}// </editor-fold>

comment.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import static java.awt.SystemColor.menu;

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.MultipartConfig;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

Page | 157
College Connect
“A Social Networking Website”

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

/**

* @author PWC

*/

@MultipartConfig

@WebServlet(urlPatterns = {"/comment"})

public class comment extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

Page | 158
College Connect
“A Social Networking Website”

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

String p=(String)ses.getAttribute("post");

String comment=request.getParameter("comment");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps1=con.prepareStatement("insert into comment(comment)


values(?) where post_id=");

ps1.setString(1,comment);

ps1.setString(2,p);

// ps1.setString(3,uid);

// out.println(uid);

ResultSet rs=ps1.executeQuery();

Page | 159
College Connect
“A Social Networking Website”

out.println("commented");

catch(Exception ex)

System.out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

Page | 160
College Connect
“A Social Networking Website”

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

Page | 161
College Connect
“A Social Networking Website”

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

Page | 162
College Connect
“A Social Networking Website”

commentType.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.MultipartConfig;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

/**

Page | 163
College Connect
“A Social Networking Website”

* @author PWC

*/

@MultipartConfig

@WebServlet(urlPatterns = {"/comment_type"})

public class comment_type extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

Page | 164
College Connect
“A Social Networking Website”

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select post_name from post");

ps.setString(1,uid);

ps.setString(2,request.getParameter("comment"));

// out.println(uid);

ps.executeUpdate();

PreparedStatement ps1=con.prepareStatement("select comment from comment


where account_id=?");

ps1.setString(1,uid);

// out.println(uid);

ResultSet rs=ps1.executeQuery();

out.println("<html>\n" +

" <head>\n" +

" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +

" <title>JSP Page</title>\n" +

Page | 165
College Connect
“A Social Networking Website”

" \n" +

" <link href=\"mystyle.css\" rel=\"style.css\" type=\"text/css\"/>\n" +

" </head>\n" +

" <body>\n" +

" <form method=\"post\" action=\"comment_type\" enctype=\"multipart/form-data\">\n"


+

" <div align=\"center\">\n" +

" <table width=\"1000px\" border=\"1\">\n" +

" <tr><td colspan=\"2\" bgcolor=\"red\"> <h1 align=\"center\">PATNA WOMENS


COLLEGE</h1></td></tr>\n" +

" <tr><td colspan=\"2\"> <h2 align=\"center\">COLLEGE CONNECT 'A social


networking website'</h2></td></tr> \n" +

" <tr><td colspan=\"2\" bgcolor=\"aqua\"><h1 align=\"center\"> Post &


Comments</h1></td></tr>\n" +

" <tr><td><a href=\"template.html\" class=\"lnk\">My profile</a><br>\n" +

" <a href=\"editprofile.jsp\" class=\"lnk\">Edit profile</a><br>\n" +

" <a href=\"view_notification.jsp\" class=\"lnk\">view notification</a><br>\n"


+

" \n" +

" <a href=\"view_result.jsp\" class=\"lnk\">view result</a><br>\n" +

" <a href=\"exam_details.jsp\" class=\"lnk\">view exam details</a><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br>\n" +

" <td height=\"400px\" align=\"center\" class=\"lnk\">\n" +

" <div style='overflow-x:scroll;overflow-y:overflow;width:750px;height:400px'>\n" +

Page | 166
College Connect
“A Social Networking Website”

"<div style='width:400px;height:750px'></div>\n" +

" <table><tr><td>\n" +

" <ul>\n" );

while(rs.next())

out.println("<li>"+rs.getString(1)+"</li>\n" );

out.println(" </ul>\n" +

" \n" +

" </td></tr> </table>\n" +

" </div>\n" +

" \n" +

" \n" +

" </td>\n" +

" \n" +

" </tr>\n" +

" <tr><td colspan=\"2\" height=\"5px\"> <h2>[email protected]</h2><h2


align=\"right\">contact us :9987654333</h2></td></tr>\n" +

" </table>\n" +

" </div>\n" +

" </form>\n" +

" </body>\n" +

Page | 167
College Connect
“A Social Networking Website”

"</html>");

catch(Exception ex)

System.out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

Page | 168
College Connect
“A Social Networking Website”

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

Page | 169
College Connect
“A Social Networking Website”

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

Faculty.html
<!DOCTYPE html>

<!--

To change this license header, choose License Headers in Project Properties.

To change this template file, choose Tools | Templates

and open the template in the editor.

-->

<html>

<head>

<title>Faculty</title>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="mystyle.css" rel="stylesheet" type="text/css"/>

</head>

<body>

<div align="center">

Page | 170
College Connect
“A Social Networking Website”

<table width="1340px" border="1" align="center">

<tr width="1340px"><td> <img src="pwc.JPG" height="100px" width="1340px"


align="center"/></td></tr>

<tr ><td colspan="2" background="6.jpg"> <img src="download.png"


height="100px" width="200px" align="right"> <h1 align="center">COLLEGE CONNECT "A
social networking website"</h2></td></tr>

<tr><td colspan="2" background="3.jpg"> <h1 align="center">Faculty


Profile</h1></td></tr>

<table width="1350px" border="1" align="center" >

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<a href="f_myprofile" >My Profile</a><br><br>

<a href="faculty_edit_profile.jsp" >Edit Profile</a><br><br>

<a href="f_view_notification">View Notification</a><br><br>

<a href="post_comment.jsp" >Post & Comment</a><br><br>

<a href="update_result.jsp" >Update Result</a><br><br>

<a href="update_exam_details.jsp" >Update Exam Details</a><br><br>

<a href="logout" >Logout</a><br>

</tr>

</table>

<table width="1350px" height="200" border="2" align="center" cellpadding="10"


cellspacing="20" background="bottom_background.jpg">

<td> <div id="user2-wrap"><div id="user2" class="container row clr">

Page | 171
College Connect
“A Social Networking Website”

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Contact Us</h3>

<div class="module-body">

<div class="custom" >

<p style="text-align: center;"><img src="patna-womens-college-small.jpg" alt=""


border="0" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>

</div>

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Location</h3>

<div class="module-body">

<div class="custom" align="center" >

<iframe width="450" height="150" frameborder="0" scrolling="no" marginheight="0"


marginwidth="0"
src="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed"></iframe><br /><small><a
href="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl

Page | 172
College Connect
“A Social Networking Website”

oc=A&amp;source=embed" style="color:#0000FF;text-align:left">View Larger


Map</a></small></div>

</div>

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Important Links</h3>

<div class="module-body">

<div class="custom" >

<ul>

<li><a href="http://www.ugc.ac.in" target="_blank">University Grants Commission</a></li>

<li><a href="http://www.patnauniversity.ac.in/" target="_blank">Patna University</a></li>

<li><a href="http://www.patnauniversity.ac.in/colleges.html" target="_blank">College of


Patna University</a></li>

<li><a href="http://india.gov.in" target="_blank">National Portal of India</a></li>

<li><a href="http://righttoinformation.gov.in" target="_blank">RTI</a></li>

<li><a href="/index.php/component/content/article/14-annnual-result/84-annual-
result.html">Annual Result</a></li>

<li><a href="/index.php/component/content/article/15-media-response/85-media-
response.html">Media Response</a></li>

</ul></div>

</div>

Page | 173
College Connect
“A Social Networking Website”

</div>

</td>

</table>

</body>

</html>

facultyProfile.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

Page | 174
College Connect
“A Social Networking Website”

/**

* @author PWC

*/

@WebServlet(urlPatterns = {"/f_myprofile"})

public class f_myprofile extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

Page | 175
College Connect
“A Social Networking Website”

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select * from member_details where


account_id=?");

ps.setString(1,uid);

// out.println(uid);

ResultSet rs=ps.executeQuery();

if(rs.next())

out.println("<html>\n" +

" <head>\n" +

" <title>My Profile</title>\n" +

" <meta charset=\"UTF-8\">\n" +

" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n" +

" </head>\n" +

" <body>\n" +

" <form method=\"post\" action=\"f_myprofile\">\n" +

" <div align=\"center\">\n" +

"\n" +

" <table width=\"1340px\" border=\"1\" align=\"center\">\n" +

Page | 176
College Connect
“A Social Networking Website”

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\"


width=\"1340px\" align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"200px\" align=\"right\"> <h1 align=\"center\">COLLEGE CONNECT
\"A social networking website\"</h2></td></tr>\n" +

" <tr><td colspan=\"2\" background=\"3.jpg\"> <h1 align=\"center\">My


Profile</h1></td></tr>\n" +

" <table width=\"1350px\" border=\"1\" align=\"center\" >\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n"+

" <a href=\"faculty_edit_profile.jsp\" class=\"lnk\">Edit profile</a><br>\n" +

" <a href=\"f_view_notification\" class=\"lnk\">View Notification</a><br>\n"


+

" <a href=\"post_comments.jsp\" class=\"lnk\">Post & Comment</a><br>\n" +

" <a href=\"update_result.jsp\" class=\"lnk\">Update Result</a><br>\n" +

" <a href=\"update_exam_details.jsp\" class=\"lnk\">Update Exam


Details</a><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br>\n" +

" </td><td width=\"750px\" background=\"12.jpg\" align=\"center\">\n" +

" <table >\n" +

" <tr><td>Name</td><td>"+rs.getString(3)+"</td></tr> \n" +

" <tr><td>Date of Birth</td><td>"+rs.getString(4)+"</td></tr> \n" +

" <tr><td>Department</td><td>"+rs.getString(5)+"</td></tr> \n" +

" <tr><td>Address</td><td>"+rs.getString(6)+"</td></tr> \n" +

Page | 177
College Connect
“A Social Networking Website”

" <tr><td>Contact number</td><td>"+rs.getString(7)+"</td></tr> \n" +

" <tr><td>Registration id</td><td>"+rs.getString(8)+"</td></tr> \n" +

" <tr><td>Email</td><td>"+rs.getString(9)+"</td></tr> \n" +

" <tr><td>Password</td><td>"+rs.getString(10)+"</td></tr> \n" +

" <tr><td>Profile Pic</td><td><img


src='propic/"+rs.getString(12)+"'height='100px' width='100px'/></td></tr>\n" +

" </table>\n" +

" </td>\n" +

" </tr>\n" +

" \n" +

" <table width=\"1350px\" height=\"200\" border=\"2\"


align=\"center\" cellpadding=\"10\" cellspacing=\"20\"
background=\"bottom_background.jpg\">\n" +

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row


clr\">\n" +

" <div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

"<div class=\"custom\" >\n" +

" <p style=\"text-align: center;\"><img src=\"patna-womens-college-small.jpg\" alt=\"\"


border=\"0\" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br

Page | 178
College Connect
“A Social Networking Website”

/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>


[email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

" <iframe width=\"450\" height=\"150\" frameborder=\"0\" scrolling=\"no\"


marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger
Map</a></small></div>\n" +

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

Page | 179
College Connect
“A Social Networking Website”

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

" \n" +

" \n" +

" \n" +

Page | 180
College Connect
“A Social Networking Website”

" \n" +

" </table>\n" +

" </div>\n" +

" </form>\n" +

" \n" +

" \n" +

" </body>\n" +

"</html>\n" +

"");

catch(Exception ex)

System.out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

Page | 181
College Connect
“A Social Networking Website”

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

Page | 182
College Connect
“A Social Networking Website”

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

facultyEditProfile.jsp
<%--

Document : faculty_edit_profile

Created on : Mar 6, 2018, 11:12:38 AM

Author : PWC

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

Page | 183
College Connect
“A Social Networking Website”

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Edit Profile</title>

<link href="mystyle.css" rel="style.css" type="text/css"/>

</head>

<body>

<form method="post" action="f_editprofile" enctype="multipart/form-data">

<div align="center">

<table width="1000px" border="1">

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

<tr><td colspan="2" background="3.jpg"> <h1 align="center">Edit


Profile</h1></td></tr>

<table width="1340px" border="1" align="center">

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<a href="f_myprofile" class="lnk">My Profile</a><br>

<a href="f_view_notification" class="lnk">View Notification</a><br>

<a href="post_comment.jsp" class="lnk">Post & Comment</a><br>

<a href="update_result.jsp" class="lnk">Update Result</a><br>

<a href="update_exam_details.jsp" class="lnk">Update Exam Details</a><br>

<a href="logout" class="lnk">Logout</a><br></td>

<td height="400px" align="center" class="lnk" background="12.jpg">

Page | 184
College Connect
“A Social Networking Website”

Address &nbsp;<input type="text" name="add" id="add"/><br><br>

Contact No. &nbsp;<input type="text" name="cont" id="cont"/><br><br>

Profile Picture &nbsp;<input type="file" name="f" id="f"/></br></br>

<input type="submit" name="btnsubmit" value="ok"/><br>

</table>

</table>

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

</div>

</form>

</body>

</html>

facultyNotification.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

Page | 185
College Connect
“A Social Networking Website”

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

/**

* @author PWC

*/

@WebServlet(urlPatterns = {"/f_view_notification"})

public class f_view_notification extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

Page | 186
College Connect
“A Social Networking Website”

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select notice from notification ");

//ps.setString(1,uid);

// out.println(uid);

ResultSet rs=ps.executeQuery();

out.println("<html>\n" +

" <head>\n" +

" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +

" <title>View Notification</title>\n" +

" <link href=\"mystyle.css\" rel=\"style.css\" type=\"text/css\"/>\n" +

" </head>\n" +

Page | 187
College Connect
“A Social Networking Website”

" <body>\n" +

" <form method=\"post\" action=\"f_view_notification\">\n" +

" \n" +

" <div align=\"center\">\n" +

" <table width=\"1340px\" border=\"1\">\n" +

" \n" +

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\"


width=\"1340px\" align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"200px\" align=\"right\">\n" +

" <h1 valign=\"center\" align=\"center\" >COLLEGE CONNECT \"A social


networking website\"</h2></td>\n" +

" </tr>\n"+"<tr><td colspan=\"2\" background=\"3.jpg\"> <h1 align=\"center\">View


Notification</h1></td></tr>\n" +

" <table width=\"1350px\" border=\"1\" align=\"center\" >\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n"+

" <a href=\"myprofile\" class=\"lnk\">My profile</a><br>\n" +

" <a href=\"editprofile.jsp\" class=\"lnk\">Edit profile</a><br>\n" +

" <a href=\"post_comments.jsp\" class=\"lnk\">Post & Comment</a><br>\n" +

" <a href=\"update_result.jsp\" class=\"lnk\">Update Result</a><br>\n" +

" <a href=\"update_exam_details.jsp\" class=\"lnk\">Update Exam


Details</a><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br></td>\n" +

" <td height=\"400px\" align=\"center\" background=\"12.jpg\">\n" +

Page | 188
College Connect
“A Social Networking Website”

" <table><tr><td>\n" );

while(rs.next())

out.println("<li> "+rs.getString(1)+"</li>\n");

out.println(

" \n" +

" </td></tr> </table>\n" +

" </td></tr>\n" +

" \n" +

" </table>\n" +

" </td></tr>\n" +

" \n" +

" <table width=\"1350px\" height=\"200\" border=\"2\" align=\"center\"


cellpadding=\"10\" cellspacing=\"20\" background=\"bottom_background.jpg\">\n" +

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row


clr\">\n" +

" <div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

Page | 189
College Connect
“A Social Networking Website”

"<div class=\"custom\" >\n" +

" <p style=\"text-align: center;\"><img src=\"patna-womens-college-small.jpg\" alt=\"\"


border=\"0\" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

" <iframe width=\"450\" height=\"150\" frameborder=\"0\" scrolling=\"no\"


marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger
Map</a></small></div>\n" +

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

Page | 190
College Connect
“A Social Networking Website”

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

Page | 191
College Connect
“A Social Networking Website”

" \n" +

" \n" +

" \n" +

" \n" +

" </table>\n"+

" </div>\n" +

" </form> \n" +

" </body>\n" +

"</html>\n" +

"");

catch(Exception ex)

System.out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

Page | 192
College Connect
“A Social Networking Website”

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

Page | 193
College Connect
“A Social Networking Website”

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

updateResult.jsp
<%--

Document : update_result

Created on : Mar 6, 2018, 10:51:00 AM

Author : PWC

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

Page | 194
College Connect
“A Social Networking Website”

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Update Result</title>

<link href="mystyle.css" rel="style.css" type="text/css"/>

</head>

<body>

<form method="post" action="updateResult">

<div align="center">

<table width="1000px" border="1">

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

<tr><td colspan="2" background="3.jpg"> <h1 align="center">Update


Results</h1></td></tr>

<table width="1340px" border="1" align="center">

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<a href="f_myprofile" class="lnk">My Profile</a><br>

<a href="f_view_notification" class="lnk">View Notification</a><br>

<a href="post_comment.jsp" class="lnk">Post & Comment</a><br>

<a href="faculty_edit_profile.jsp" class="lnk">Edit Profile</a><br>

<a href="update_exam_details.jsp" class="lnk">Update Exam Details</a><br>

<a href="logout" class="lnk">Logout</a><br></td>

<td height="400px" align="center" class="lnk" background="12.jpg">

Page | 195
College Connect
“A Social Networking Website”

Registration Number &nbsp; <input type="text" name="regid"


id="regid"/><br><br>

Marks &nbsp;<input type="text" name="marks" id="marks"/><br><br>

Percentage &nbsp;<input type="text" name="percent"


id="percent"/><br><br>

Division &nbsp;<input type="text" name="div" id="div"/><br><br>

<input type="Submit" name="btnSubmit" value="Submit"/>

<INPUT TYPE="RESET" value="Add">

<INPUT TYPE="RESET" value="Reset">

<%-- <input type="Submit" name="btnSubmit" value="Add"/>

<input type="Submit" name="btnSubmit" value="View"/>--%>

</tr>

</table>

</table>

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

</div>

</form>

</body>

</html>

updateResult.java
/*

* To change this license header, choose License Headers in Project Properties.

Page | 196
College Connect
“A Social Networking Website”

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

/**

* @author PWC

*/

@WebServlet(urlPatterns = {"/updateResult"})

public class updateResult extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

Page | 197
College Connect
“A Social Networking Website”

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

String regid=request.getParameter("regid");

String marks=request.getParameter("marks");

String percent=request.getParameter("percent");

String div=request.getParameter("div");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("insert into


Result(regid,marks,percentage,division) values (?,?,?,?)");

Page | 198
College Connect
“A Social Networking Website”

ps.setString(1,regid);

ps.setString(2,marks);

ps.setString(3,percent);

ps.setString(4,div);

ps.executeUpdate();

out.println("<script type=\"text/javascript\">");

out.println("alert('Sucessfully Updated');");

out.println("location='update_result.jsp';");

out.println("</script>");

// response.sendRedirect("viewResult");

catch (Exception ex)

System.out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

Page | 199
College Connect
“A Social Networking Website”

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

Page | 200
College Connect
“A Social Networking Website”

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

updateExamDetails.jsp
<%--

Document : update_exam_details

Created on : Mar 6, 2018, 11:01:24 AM

Author : PWC

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

Page | 201
College Connect
“A Social Networking Website”

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Update Exam Details</title>

<link href="mystyle.css" rel="style.css" type="text/css"/>

</head>

<body>

<form method="post" action="updateExamDetails">

<div align="center">

<table width="1000px" border="1">

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

<tr><td colspan="2" background="3.jpg"> <h1 align="center">Update Exam


Details</h1></td></tr>

<table width="1340px" border="1" align="center">

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<a href="f_myprofile" class="lnk">My Profile</a><br>

<a href="f_view_notification" class="lnk">View Notification</a><br>

<a href="post_comment.jsp" class="lnk">Post & Comment</a><br>

<a href="faculty_edit_profile.jsp" class="lnk">Edit Profile</a><br>

<a href="update_result.jsp" class="lnk">Update Result</a><br>

<a href="logout" class="lnk">Logout</a><br></td>

Page | 202
College Connect
“A Social Networking Website”

<td height="400px" align="center" class="lnk" background="12.jpg">

Select semester &nbsp;<select name="sem" >

<option value="sem1">Sem1</option>

<option value="sem2">Sem2</option>

<option value="sem3">Sem3</option>

<option value="sem4">Sem4</option>

<option value="sem5">Sem5</option>

<option value="sem6">Sem6</option>

</select><br><br>

Start Date &nbsp;<input type="date" name="date" id="date"/><br><br>

Time &nbsp;<input type="time" name="time" id="time"/><br><br>

Center &nbsp;<input type="text" name="center" id="center"/><br><br>

<input type="Submit" name="btnSubmit" value="Submit"/>

<INPUT TYPE="RESET" value="Add">

</td></tr>

</table>

</table>

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

</div>

</form>

</body>

</html>

Page | 203
College Connect
“A Social Networking Website”

updateExamDetails.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

import javax.swing.JOptionPane;

/**

* @author PWC

*/

Page | 204
College Connect
“A Social Networking Website”

@WebServlet(urlPatterns = {"/updateExamDetails"})

public class updateExamDetails extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

try

//HttpSession ses=request.getSession();

//String uid=(String)ses.getAttribute("uid");

String sem=request.getParameter("sem");

String date=request.getParameter("date");

Page | 205
College Connect
“A Social Networking Website”

String time=request.getParameter("time");

String center=request.getParameter("center");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("insert into


examination_details(semester,start_date,time,center) values (?,?,?,?)");

ps.setString(1,sem);

ps.setString(2,date);

ps.setString(3,time);

ps.setString(4,center);

ps.executeUpdate();

// out.println("Successfully Updated");

// JOptionPane.showMessageDialog(null,"Successfully Updated");

out.println("<script type=\"text/javascript\">");

out.println("alert('Sucessfully Updated');");

out.println("location='update_exam_details.jsp';");

out.println("</script>");

// response.sendRedirect("update_exam_details.jsp");

Page | 206
College Connect
“A Social Networking Website”

catch(Exception ex)

out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

Page | 207
College Connect
“A Social Networking Website”

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

Page | 208
College Connect
“A Social Networking Website”

facultyPostComments.jsp
<%--

Document : post_comment

Created on : Mar 6, 2018, 11:21:12 AM

Author : PWC

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Post&Comments</title>

<link href="mystyle.css" rel="style.css" type="text/css"/>

</head>

<body>

<form method="post" action="fpost" enctype="multipart/form-data">

<div align="center">

<table width="1000px" border="1">

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

Page | 209
College Connect
“A Social Networking Website”

<tr><td colspan="2" background="3.jpg"><h1 align="center"> Post &


Comments</h1></td></tr>

<table width="1340px" border="1" align="center">

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<a href="f_myprofile" class="lnk">My profile</a><br>

<a href="f_view_notification" class="lnk">View Notification</a><br>

<a href="update_result.jsp" class="lnk">Update Result</a><br>

<a href="update_exam_details.jsp" class="lnk">Update Exam


Details</a><br>

<a href="faculty_edit_profile.jsp" class="lnk">Edit profile</a><br>

<a href="logout" class="lnk">Logout</a><br></td>

<td height="400px" align="center" class="lnk" background="12.jpg">

Add Post<input type="text" name="post" id="post">

<input type="file" name="f" id="f">

<input type="submit" name="btnsubmit" value="Post">

</td>

</tr>

</table>

Page | 210
College Connect
“A Social Networking Website”

</table>

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

</div>

</form>

</body>

</html>

facultyPost.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.File;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.io.OutputStream;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import javax.servlet.ServletException;

Page | 211
College Connect
“A Social Networking Website”

import javax.servlet.annotation.MultipartConfig;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

import javax.servlet.http.Part;

/**

* @author PWC

*/

@MultipartConfig

@WebServlet(urlPatterns = {"/fpost"})

public class fpost extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

Page | 212
College Connect
“A Social Networking Website”

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

try

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

Part filePart=request.getPart("f");

String profilepic=getFileName(filePart);

String
basePath="C:\\Users\\hp\\Documents\\NetBeansProjects\\college_connect\\web\\propic\\";

InputStream inputStream=null;

OutputStream outputStream=null;

try

File outputFilePath=new File(basePath + profilepic);

inputStream=filePart.getInputStream();

outputStream=new FileOutputStream(outputFilePath);

Page | 213
College Connect
“A Social Networking Website”

int read=0;

final byte[]bytes=new byte[1024];

while((read=inputStream.read(bytes))!=-1){

outputStream.write(bytes,0,read);

catch(Exception ex)

out.println(ex.toString());

finally

if(outputStream!=null){

outputStream.close();

if(inputStream!=null){

inputStream.close();

Class.forName("org.apache.derby.jdbc.ClientDriver");

Page | 214
College Connect
“A Social Networking Website”

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement(" insert into post (


post,account_id)values(?,?)");

ps.setString(1,profilepic);

ps.setString(2,uid);

ps.executeUpdate();

response.sendRedirect("fpostview");

catch(Exception ex)

out.println(ex.toString());

private String getFileName(Part part){

final String partHeader=part.getHeader("content-disposition");

System.out.println("*****partHeader:"+partHeader);

for(String content:part.getHeader("content-disposition").split(";")){

if(content.trim().startsWith("filename")){

return content.substring(content.indexOf('=')+ 1).trim().replace("\"","");

Page | 215
College Connect
“A Social Networking Website”

return null;

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

Page | 216
College Connect
“A Social Networking Website”

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

Page | 217
College Connect
“A Social Networking Website”

facultyPostView.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.MultipartConfig;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

Page | 218
College Connect
“A Social Networking Website”

import javax.servlet.http.HttpSession;

/**

* @author PWC

*/

@MultipartConfig

@WebServlet(urlPatterns = {"/fpostview"})

public class fpostview extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

Page | 219
College Connect
“A Social Networking Website”

/* TODO output your page here. You may use following sample code. */

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select post_id, post,image from post");

//ps.setString(1,uid);

// out.println(uid);

ResultSet rs=ps.executeQuery();

if(rs.next())

out.println("<html>\n" +

" <head>\n" +

" <title>Post & Comments</title>\n" +

" <meta charset=\"UTF-8\">\n" +

" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n" +

" </head>\n" +

" <body>\n" +

Page | 220
College Connect
“A Social Networking Website”

" <form method=\"post\" action=\"fcomment\">\n" +

" <div align=\"center\">\n" +

"\n" +

" <table width=\"1340px\" border=\"1\" align=\"center\">\n" +

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\"


width=\"1340px\" align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"200px\" align=\"right\"> <h1 align=\"center\">COLLEGE CONNECT
\"A social networking website\"</h2></td></tr>\n" +

" <tr><td colspan=\"2\" background=\"3.jpg\"> <h1 align=\"center\">Posts &


Comments</h1></td></tr>\n" +

" <table width=\"1350px\" border=\"1\" align=\"center\" >\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n"+

" <a href=\"fmyprofile\" class=\"lnk\">My Profile</a><br>\n" +

" <a href=\"f_view_notification\" class=\"lnk\">View Notification</a><br>\n"


+

" \n" +

" <a href=\"faculty_edit_profile.jsp\" class=\"lnk\">Edit


profile</a><br>\n" +

" <a href=\"update_result.jsp\" class=\"lnk\">Update Result</a><br>\n" +

" <a href=\"update_exam_details.jsp\" class=\"lnk\">Update Exam


Details</a><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br></td>\n" +

Page | 221
College Connect
“A Social Networking Website”

" \n" +

" <td height=\"400px\" align=\"center\" class=\"lnk\"


background=\"12.jpg\">\n" +

" <div style='overflow-x:scroll;overflow-y:overflow;height:400px'>\n" +

" <table><tr><td>\n" );

String p;

while(rs.next()){

p=rs.getString(1);

// p= rs.getString(1);

//request.setAttribute("postid",p);

// RequestDispatcher rd = request.getRequestDispatcher(p);

//rd.forward(request,response);

out.println(

"<tr><td>Posts</td><td>"+rs.getString(2)+"</td></tr> \n" +

" <tr><td><img src='propic/"+rs.getString(3)+"'height='100px'


width='100px'/> </tr></td>\n"+

" <tr><td> Comment<input type=\"text\" name=\"comment\"


id=\"comment\"></td>\n" +

" <td> <input type=\"submit\" name=\"btnsubmit\"


value=\"Comment\"></td></tr>\n" +

" </div>\n" );}

Page | 222
College Connect
“A Social Networking Website”

out.println(

" \n" +

" </td></tr> </table>\n" +

" \n" +

" \n" +

" </td>\n" +

" \n" +

" </tr>\n" +

" </table>\n" +

"\n" +

" \n" +

Page | 223
College Connect
“A Social Networking Website”

" <table width=\"1350px\" height=\"200\" border=\"2\"


align=\"center\" cellpadding=\"10\" cellspacing=\"20\"
background=\"bottom_background.jpg\">\n" +

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row


clr\">\n" +

" <div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

"<div class=\"custom\" >\n" +

" <p style=\"text-align: center;\"><img src=\"patna-womens-college-small.jpg\" alt=\"\"


border=\"0\" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

Page | 224
College Connect
“A Social Networking Website”

" <iframe width=\"450\" height=\"150\" frameborder=\"0\" scrolling=\"no\"


marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger
Map</a></small></div>\n" +

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

Page | 225
College Connect
“A Social Networking Website”

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

" \n" +

" \n" +

" \n" +

" \n" +

" </table>"+

" </div>\n" +

" </form>\n" +

" </body>\n" +

"</html>");

Page | 226
College Connect
“A Social Networking Website”

catch(Exception ex)

System.out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

Page | 227
College Connect
“A Social Networking Website”

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

Page | 228
College Connect
“A Social Networking Website”

facultyComment.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.MultipartConfig;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

/**

Page | 229
College Connect
“A Social Networking Website”

* @author PWC

*/

@MultipartConfig

@WebServlet(urlPatterns = {"/fcomment"})

public class fcomment extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

Page | 230
College Connect
“A Social Networking Website”

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select post from post");

// ps.setString(1,hid);

// out.println(uid);

ResultSet rs=ps.executeQuery();

out.println("<html>\n" +

" <head>\n" +

" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +

" <title>JSP Page</title>\n" +

" <link href=\"mystyle.css\" rel=\"style.css\" type=\"text/css\"/>\n" +

" </head>\n" +

" <body>\n" +

" <form method=\"post\" action=\"fcomment_type\" enctype=\"multipart/form-data\">\n"


+

" <div align=\"center\">\n" +

" <table width=\"1000px\" border=\"1\">\n" +

" <tr><td colspan=\"2\" bgcolor=\"red\"> <h1 align=\"center\">PATNA WOMENS


COLLEGE</h1></td></tr>\n" +

Page | 231
College Connect
“A Social Networking Website”

" <tr><td colspan=\"2\"> <h2 align=\"center\">COLLEGE CONNECT 'A social


networking website'</h2></td></tr> \n" +

" <tr><td colspan=\"2\" bgcolor=\"aqua\"><h1 align=\"center\"> Post &


Comments</h1></td></tr>\n" +

" <tr><td><a href=\"Faculty.html\" class=\"lnk\">My profile</a><br>\n" +

" <a href=\"fnotification.jsp\" class=\"lnk\">view notification</a><br>\n" +

" \n" +

" <a href=\"update_result.jsp\" class=\"lnk\">Update result</a><br>\n" +

" <a href=\"update_exam_details.jsp\" class=\"lnk\">Update exam


details</a><br>\n" +

" <a href=\"faculty_edit_profile.jsp\" class=\"lnk\">Edit profile</a><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br></td>\n" +

" \n" +

" <td height=\"400px\" align=\"center\" class=\"lnk\">\n" +

" <div style='overflow-x:scroll;overflow-y:overflow;width:750px;height:400px'>\n" +

"<div style='width:400px;height:750px'></div>\n" +

" <table><tr><td>\n" +

" <ul>\n" );

while(rs.next())

out.println("<li><img src='propic/"+rs.getString(1)+"'height='100px'
width='100px'/></li>\n" +

" comment<input type=\"text\" name=\"comment\"


id=\"comment\">\n" +

Page | 232
College Connect
“A Social Networking Website”

" <input type=\"submit\" name=\"btnsubmit\" value=\"ok\">\n" );

out.println(" </ul>\n" +

" \n" +

" </td></tr> </table>\n" +

" </div>\n" +

" \n" +

" </td>\n" +

" \n" +

" </tr>\n" +

" <tr><td colspan=\"2\" height=\"5px\"> <h2>[email protected]</h2><h2


align=\"right\">contact us :9987654333</h2></td></tr>\n" +

" </table>\n" +

" </div>\n" +

" </form>\n" +

" </body>\n" +

"</html>");

out.println("</body>");

out.println("</html>");

Page | 233
College Connect
“A Social Networking Website”

catch(Exception ex)

System.out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

Page | 234
College Connect
“A Social Networking Website”

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

Page | 235
College Connect
“A Social Networking Website”

public String getServletInfo() {

return "Short description";

}// </editor-fold>

facultyComment_type.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.MultipartConfig;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

Page | 236
College Connect
“A Social Networking Website”

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

/**

* @author PWC

*/

@MultipartConfig

@WebServlet(urlPatterns = {"/fcomment_type"})

public class fcomment_type extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

Page | 237
College Connect
“A Social Networking Website”

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

HttpSession ses=request.getSession();

String uid=(String)ses.getAttribute("uid");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("insert into comment


(account_id,comment)values(?,?)");

ps.setString(1,uid);

ps.setString(2,request.getParameter("comment"));

// out.println(uid);

ps.executeUpdate();

PreparedStatement ps1=con.prepareStatement("select comment from comment


where account_id=?");

ps1.setString(1,uid);

// out.println(uid);

ResultSet rs=ps1.executeQuery();

Page | 238
College Connect
“A Social Networking Website”

out.println("<html>\n" +

" <head>\n" +

" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +

" <title>JSP Page</title>\n" +

" <link href=\"mystyle.css\" rel=\"style.css\" type=\"text/css\"/>\n" +

" </head>\n" +

" <body>\n" +

" <form method=\"post\" action=\"fpost\" enctype=\"multipart/form-data\">\n" +

" <div align=\"center\">\n" +

" <table width=\"1000px\" border=\"1\">\n" +

" <tr><td colspan=\"2\" bgcolor=\"red\"> <h1 align=\"center\">PATNA WOMENS


COLLEGE</h1></td></tr>\n" +

" <tr><td colspan=\"2\"> <h2 align=\"center\">COLLEGE CONNECT 'A social


networking website'</h2></td></tr> \n" +

" <tr><td colspan=\"2\" bgcolor=\"aqua\"><h1 align=\"center\"> Post &


Comments</h1></td></tr>\n" +

" <tr><td><a href=\"Faculty.html\" class=\"lnk\">My profile</a><br>\n" +

" <a href=\"fnotification.jsp\" class=\"lnk\">view notification</a><br>\n" +

" \n" +

" <a href=\"update_result.jsp\" class=\"lnk\">Update result</a><br>\n" +

" <a href=\"update_exam_details.jsp\" class=\"lnk\">Update exam


details</a><br>\n" +

" <a href=\"faculty_edit_profile.jsp\" class=\"lnk\">Edit profile</a><br>\n" +

" <a href=\"logout\" class=\"lnk\">Logout</a><br></td>\n" +

Page | 239
College Connect
“A Social Networking Website”

" \n" +

" <td height=\"400px\" align=\"center\" class=\"lnk\">\n" +

" <div style='overflow-x:scroll;overflow-y:overflow;width:750px;height:400px'>\n" +

"<div style='width:400px;height:750px'></div>\n" +

" <table><tr><td>\n" +

" <ul>\n" );

while(rs.next())

out.println("<li>"+rs.getString(1)+"</li>\n" );

out.println(" </ul>\n" +

" \n" +

" </td></tr> </table>\n" +

" </div>\n" +

" \n" +

" </td>\n" +

" \n" +

" </tr>\n" +

" <tr><td colspan=\"2\" height=\"5px\"> <h2>[email protected]</h2><h2


align=\"right\">contact us :9987654333</h2></td></tr>\n" +

" </table>\n" +

Page | 240
College Connect
“A Social Networking Website”

" </div>\n" +

" </form>\n" +

" </body>\n" +

"</html>");

out.println("</body>");

out.println("</html>");

catch(Exception ex)

System.out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

Page | 241
College Connect
“A Social Networking Website”

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

Page | 242
College Connect
“A Social Networking Website”

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

adminlogin.html
<!DOCTYPE html>

<!--

To change this license header, choose License Headers in Project Properties.

To change this template file, choose Tools | Templates

and open the template in the editor.

-->

<html>

<head>

<title>Admin Login</title>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="mystyle.css" rel="stylesheet" type="text/css"/>

Page | 243
College Connect
“A Social Networking Website”

<style>

ul {

list-style-type: none;

margin: 0;

padding: 0;

overflow: hidden;

li {

float: left;

li a {

display: block;

color: black;

text-align: center;

padding: 14px 16px;

text-decoration: none;

Page | 244
College Connect
“A Social Networking Website”

</style>

</head>

<body >

<form method="post" action="adminlogin">

<div align="center">

<table width="1340px" border="1" align="center">

<tr width="1340px"><td> <img src="pwc.JPG" height="100px" width="1340px"


align="center"/></td></tr>

<tr ><td colspan="2" background="6.jpg"> <img src="download.png"


height="100px" width="200px" align="right"> <h1 align="center">COLLEGE CONNECT "A
social networking website"</h2></td></tr>

<tr> <td background="7.jpg">

<ul>

<li><a class="active" href="home.html">Home</a></li>

<li><a href="login.html">Member Login</a></li>

<li><a href="registration.html">Register</a></li>

<li><a href="notice">Notice</a></li>

<li><a href="http://www.patnawomenscollege.in/index.php/notices/281-admission-
notice-2018.html">Admission Notice</a><li>

</ul>

</td></tr>

<tr><td colspan="2" background="3.jpg"> <h1 align="center">ADMIN


LOGIN</h1></td></tr>

Page | 245
College Connect
“A Social Networking Website”

<tr><td width="250px" height="350px" valign="center" align="center"


background="5.jpg">

<br>

<br>

<br>

<table >

Email id &nbsp;<input type="text" name="email" id="email"><br> <br>

Password &nbsp;<input type="text" name="pwd" id="pwd"> <br><br>

<input type="submit" name="btnsubmit" value="LOGIN"><br><br>

</table>

</td>

</tr>

<table width="1350px" height="200" border="2" align="center" cellpadding="10"


cellspacing="20" background="bottom_background.jpg">

<td> <div id="user2-wrap"><div id="user2" class="container row clr">

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Contact Us</h3>

<div class="module-body">

<div class="custom" >

Page | 246
College Connect
“A Social Networking Website”

<p style="text-align: center;"><img src="patna-womens-college-small.jpg" alt=""


border="0" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>

</div>

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Location</h3>

<div class="module-body">

<div class="custom" align="center" >

<iframe width="450" height="150" frameborder="0" scrolling="no" marginheight="0"


marginwidth="0"
src="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed"></iframe><br /><small><a
href="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed" style="color:#0000FF;text-align:left">View Larger
Map</a></small></div>

</div>

</div></td>

<td>

<div class="module span_4 col clr">

Page | 247
College Connect
“A Social Networking Website”

<h3 class="module-title" align="center">Important Links</h3>

<div class="module-body">

<div class="custom" >

<ul>

<li><a href="http://www.ugc.ac.in" target="_blank">University Grants Commission</a></li>

<li><a href="http://www.patnauniversity.ac.in/" target="_blank">Patna University</a></li>

<li><a href="http://www.patnauniversity.ac.in/colleges.html" target="_blank">College of


Patna University</a></li>

<li><a href="http://india.gov.in" target="_blank">National Portal of India</a></li>

<li><a href="http://righttoinformation.gov.in" target="_blank">RTI</a></li>

<li><a href="/index.php/component/content/article/14-annnual-result/84-annual-
result.html">Annual Result</a></li>

<li><a href="/index.php/component/content/article/15-media-response/85-media-
response.html">Media Response</a></li>

</ul></div>

</div>

</div>

</td>

</table>

</form>

</body>

</html>

Page | 248
College Connect
“A Social Networking Website”

adminlogin.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

/**

* @author PWC

Page | 249
College Connect
“A Social Networking Website”

*/

@WebServlet(urlPatterns = {"/adminlogin"})

public class adminlogin extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

try

Class.forName("org.apache.derby.jdbc.ClientDriver");

Page | 250
College Connect
“A Social Networking Website”

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select * from admin_details where


email=? and password=?");

ps.setString(1,request.getParameter("email"));

ps.setString(2,request.getParameter("pwd"));

ResultSet rs=ps.executeQuery();

if(rs.next())

response.sendRedirect("adminNotification");

//out.println("Successfully Login");

else

out.println("Invalid User id / password");

catch(Exception ex)

out.println(ex.toString());

Page | 251
College Connect
“A Social Networking Website”

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

Page | 252
College Connect
“A Social Networking Website”

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

adminNotification.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

Page | 253
College Connect
“A Social Networking Website”

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

/**

* @author PWC

*/

@WebServlet(urlPatterns = {"/adminNotification"})

public class adminNotification extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

Page | 254
College Connect
“A Social Networking Website”

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select notice from notification ");

//ps.setString(1,uid);

// out.println(uid);

ResultSet rs=ps.executeQuery();

out.println("<html>\n" +

" <head>\n" +

" <title>Admin </title>\n" +

Page | 255
College Connect
“A Social Networking Website”

" <meta charset=\"UTF-8\">\n" +

" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n" +

" <link href=\"mystyle.css\" rel=\"stylesheet\" type=\"text/css\"/>\n" +

" </head>\n" +

" <body>\n" +

" <form method=\"post\" action=\"viewNotification\">\n" +

" <div align=\"center\">\n" +

" <div align=\"center\">\n" +

" <table width=\"1340px\" border=\"1\" align=\"center\">\n" +

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\"


width=\"1340px\" align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"100px\" align=\"right\"> <h1 align=\"center\">COLLEGE CONNECT
\"A social networking website\"</h2></td></tr>\n" +

" <tr><td colspan=\"2\" background=\"3.jpg\"> <h1


align=\"center\">Notice</h1></td></tr>\n" +

" <table width=\"1340px\" border=\"1\" align=\"center\" >\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n"+

" \n" +

" <a href=\"update_notification.jsp\" >Update notification</a><br><br>\n" +

" \n" +

" <a href=\"approvemembers\" >Approve members</a><br><br>\n" +

" <a href=\"logout\" >Logout</a><br>\n"+

Page | 256
College Connect
“A Social Networking Website”

"</td><td width=\"600px\" align=\"center\" background=\"9.jpg\">\n"+

" <table><tr><td>\n" );

while(rs.next())

out.println("<li> "+rs.getString(1)+"</li>\n");

out.println(" </ul>\n" +

" \n" +

" </td></tr> </table>\n" +

"</td>\n" +

" </tr>\n" +

" \n" +

" </table>\n" +

" \n" +

" \n" +

" </table>\n" +

" \n" +

" \n" +

" \n" +

" <table width=\"1350px\" height=\"200\" border=\"2\" align=\"center\" cellpadding=\"10\"


cellspacing=\"20\" background=\"bottom_background.jpg\">\n" +

Page | 257
College Connect
“A Social Networking Website”

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row


clr\">\n" +

" <div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

"<div class=\"custom\" >\n" +

" <p style=\"text-align: center;\"><img src=\"patna-womens-college-small.jpg\" alt=\"\"


border=\"0\" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

" <iframe width=\"450\" height=\"150\" frameborder=\"0\" scrolling=\"no\"


marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo

Page | 258
College Connect
“A Social Networking Website”

c=A&amp;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger
Map</a></small></div>\n" +

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

Page | 259
College Connect
“A Social Networking Website”

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

" \n" +

" \n" +

" \n" +

" \n" +

" </table>\n" +

" \n" +

" \n" +

" </form> \n" +

" </body>\n" +

"</html>\n" +

"");

catch(Exception ex)

Page | 260
College Connect
“A Social Networking Website”

System.out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

Page | 261
College Connect
“A Social Networking Website”

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

Page | 262
College Connect
“A Social Networking Website”

updateNotification.jsp
<%--

Document : update_notification

Created on : Mar 6, 2018, 11:39:39 AM

Author : PWC

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

<head>

<title>Update Notification</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>JSP Page</title>

<link href="mystyle.css" rel="stylesheet" type="text/css"/>

</head>

<body>

<form method="post" action="updatenotification">

<div align="center">

<table width="1340px" border="1" align="center">

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

<tr><td colspan="2" background="3.jpg"> <h1 align="center">Update


Notification</h1></td></tr>

Page | 263
College Connect
“A Social Networking Website”

<table width="1340px" border="1" align="center" >

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<a href="adminNotification" >Notification</a><br><br>

<a href="approvemembers" >Approve members</a><br><br>

<a href="logout" >Logout</a><br>

</td><td width="750px" align="center" background="9.jpg">

New Notification &nbsp;<input type="text" name="notification"


id="notification"/><br><br>

<input type="Submit" name="btnSubmit" value="Submit"/> &nbsp;

<INPUT TYPE="RESET" value="Add">

<%-- <input type="Submit" name="btnSubmit" value="Add"/>

<input type="Submit" name="btnSubmit" value="View"/>--%>

</td>

</tr>

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

</table>

</div>

</form>

</body>

</html>

Page | 264
College Connect
“A Social Networking Website”

updateNotification.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

/**

* @author PWC

*/

@WebServlet(urlPatterns = {"/updatenotification"})

Page | 265
College Connect
“A Social Networking Website”

public class updatenotification extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

try

String notification=request.getParameter("notification");

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

Page | 266
College Connect
“A Social Networking Website”

PreparedStatement ps=con.prepareStatement("insert into notification (notice)


values(?)");

ps.setString(1, notification);

ps.executeUpdate();

//out.println("successful");

response.sendRedirect("view_notification");

catch(Exception ex)

out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

* @param response servlet response

Page | 267
College Connect
“A Social Networking Website”

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

Page | 268
College Connect
“A Social Networking Website”

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

approveMembers.jsp
<%--

Document : approve_members

Created on : Mar 6, 2018, 11:39:59 AM

Author : PWC

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

<head>

<title>Approve Members</title>

Page | 269
College Connect
“A Social Networking Website”

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>JSP Page</title>

<link href="mystyle.css" rel="stylesheet" type="text/css"/>

</head>

<body>

<form method="post" action="approvemembers" enctype="multipart/form-data">

<div align="center">

<table width="1350px" border="1" align="center">

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

<tr><td colspan="2" background="3.jpg"> <h1 align="center">Approve


Members</h1></td></tr>

<table width="1350px" border="1" align="center" >

<tr><td width="300px" height="400px" valign="center" align="center"


background="8.jpg">

<a href="adminNotification" >Notification</a><br><br>

<a href="update_notification.jsp" >Update Notification</a><br><br>

<a href="logout" >Logout</a><br>

</td><td width="750px" background="9.jpg">

<table colspan="4"padding="1">

<tr>

<td>Image</td><td></td>

Page | 270
College Connect
“A Social Networking Website”

<td>Name</td><td></td>

<td>Member Type</td><td></td>

<td>Registration Id</td><td></td>

<td> <input type="submit" name="btnSubmit1" value="Accept"/></td>

<td> <input type="submit" name="btnSubmit2" value="Delete"/></td>

</tr>

</table>

</td>

</tr>

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

</table>

</body>

</html>

approveMembers.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

Page | 271
College Connect
“A Social Networking Website”

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import java.sql.SQLException;

import javax.servlet.ServletException;

import javax.servlet.annotation.MultipartConfig;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

/**

* @author PWC

*/

@MultipartConfig

@WebServlet(urlPatterns = {"/approvemembers"})

public class approvemembers extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

Page | 272
College Connect
“A Social Networking Website”

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException{

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

try

Class.forName("org.apache.derby.jdbc.ClientDriver");

Connection
con=DriverManager.getConnection("jdbc:derby://localhost:1527/CollegeConnect","CollegeCo
nnect","CollegeConnect");

PreparedStatement ps=con.prepareStatement("select
account_id,profile_pic,name,member_type,regid from member_details");

Page | 273
College Connect
“A Social Networking Website”

ResultSet rs = ps.executeQuery();

//String act=rs.getString(1);

out.println("<html>\n" +

" <head>\n" +

" <title>Approve Members</title>\n" +

" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +

" <title>JApprove Members</title>\n" +

" <link href=\"mystyle.css\" rel=\"stylesheet\" type=\"text/css\"/>\n" +

" </head>\n" +

" <body>\n" +

" <form method=\"post\" action=\"approvemembers\" enctype=\"multipart/form-


data\">\n" +

" <div align=\"center\">\n" +

" <table width=\"1350px\" border=\"1\" align=\"center\">\n" +

" \n" +

" <tr width=\"1340px\"><td> <img src=\"pwc.JPG\" height=\"100px\"


width=\"1340px\" align=\"center\"/></td></tr>\n" +

" <tr ><td colspan=\"2\" background=\"6.jpg\"> <img src=\"download.png\"


height=\"100px\" width=\"200px\" align=\"right\">\n" +

" <h1 valign=\"center\" align=\"center\" >COLLEGE CONNECT \"A social


networking website\"</h2></td>\n" +

" </tr>\n"+

" <tr><td colspan=\"2\" background=\"3.jpg\"> <h1 align=\"center\">Approve


Members</h1></td></tr>\n" +

Page | 274
College Connect
“A Social Networking Website”

" <table width=\"1350px\" border=\"1\" align=\"center\" >\n" +

" <tr><td width=\"300px\" height=\"400px\" valign=\"center\" align=\"center\"


background=\"8.jpg\">\n" +

" \n" +

" <a href=\"adminNotification\" >Notification</a><br><br>\n" +

" \n" +

" <a href=\"update_notification.jsp\" >Update Notification</a><br><br>\n" +

" <a href=\"logout\" >Logout</a><br>\n" +

" </td><td width=\"750px\" background=\"9.jpg\">\n" +

" <div style='overflow-y:scroll;overflow-y:overflow;height:400px'>\n" +

" <table colspan=\"4\"padding=\"1\">\n");

while(rs.next())

out.println( " <tr>\n" +

" <td><img src='propic/"+rs.getString(2)+"'height='100px'


width='100px'/></td>\n" +

" <td>"+rs.getString(3)+"</td>\n" +

" <td>Member Type:</td><td>"+rs.getString(4)+"</td>\n" +

" <td>Registration Id:</td><td>"+rs.getString(5)+"</td>\n" +

" <td> <input type=\"submit\" name=\"btnSubmit1\"


value=\"Accept\"/></td>\n" +

" <td> <input type=\"submit\" name=\"btnSubmit2\"


value=\"Delete\"/></td>\n" );

out.println(

" </tr>\n" +

Page | 275
College Connect
“A Social Networking Website”

" </table>\n" +

"</div>\n"+

" </td>\n" +

" </tr>\n" +

" </table>\n" +

"\n" +

" <table width=\"1350px\" height=\"200\" border=\"2\"


align=\"center\" cellpadding=\"10\" cellspacing=\"20\"
background=\"bottom_background.jpg\">\n" +

" <td> <div id=\"user2-wrap\"><div id=\"user2\" class=\"container row


clr\">\n" +

" <div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Contact Us</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

" \n" +

"<div class=\"custom\" >\n" +

" <p style=\"text-align: center;\"><img src=\"patna-womens-college-small.jpg\" alt=\"\"


border=\"0\" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>\n" +

" </div>\n" +

" </div></td>\n" +

" <td>\n" +

"<div class=\"module span_4 col clr\">\n" +

Page | 276
College Connect
“A Social Networking Website”

" <h3 class=\"module-title\" align=\"center\">Location</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" align=\"center\" >\n" +

" <iframe width=\"450\" height=\"150\" frameborder=\"0\" scrolling=\"no\"


marginheight=\"0\" marginwidth=\"0\"
src=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed\"></iframe><br /><small><a
href=\"https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">View Larger
Map</a></small></div>\n" +

" </div>\n" +

"</div></td>\n" +

"<td>\n" +

"<div class=\"module span_4 col clr\">\n" +

" <h3 class=\"module-title\" align=\"center\">Important Links</h3>\n" +

" <div class=\"module-body\">\n" +

" \n" +

"\n" +

"<div class=\"custom\" >\n" +

" <ul>\n" +

"<li><a href=\"http://www.ugc.ac.in\" target=\"_blank\">University Grants


Commission</a></li>\n" +

Page | 277
College Connect
“A Social Networking Website”

"<li><a href=\"http://www.patnauniversity.ac.in/\" target=\"_blank\">Patna


University</a></li>\n" +

"<li><a href=\"http://www.patnauniversity.ac.in/colleges.html\" target=\"_blank\">College of


Patna University</a></li>\n" +

"<li><a href=\"http://india.gov.in\" target=\"_blank\">National Portal of India</a></li>\n" +

"<li><a href=\"http://righttoinformation.gov.in\" target=\"_blank\">RTI</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/14-annnual-result/84-annual-
result.html\">Annual Result</a></li>\n" +

"<li><a href=\"/index.php/component/content/article/15-media-response/85-media-
response.html\">Media Response</a></li>\n" +

"</ul></div>\n" +

" </div>\n" +

"</div>\n" +

"\n" +

" </td>\n" +

" \n" +

" \n" +

" \n" +

" \n" +

" </table>\n" +

" \n" +

" </body>\n" +

"</html>");

Page | 278
College Connect
“A Social Networking Website”

/* if(request.getParameter("btnsubmit")!=null)

PreparedStatement ps1=con.prepareStatement("update member_details set


status="active" where account_id="+act"");

ps1.executeQuery();

}*/

//response.sendRedirect("login.html");

catch(Exception ex)

out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

Page | 279
College Connect
“A Social Networking Website”

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

Page | 280
College Connect
“A Social Networking Website”

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

logout.java
/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

import java.io.IOException;

import java.io.PrintWriter;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

Page | 281
College Connect
“A Social Networking Website”

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

/**

* @author PWC

*/

@WebServlet(urlPatterns = {"/logout"})

public class logout extends HttpServlet {

/**

* Processes requests for both HTTP <code>GET</code> and <code>POST</code>

* methods.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

Page | 282
College Connect
“A Social Networking Website”

response.setContentType("text/html;charset=UTF-8");

try (PrintWriter out = response.getWriter()) {

/* TODO output your page here. You may use following sample code. */

try

{/* TODO output your page here. You may use following sample code. */

HttpSession ses=request.getSession();

ses.invalidate();

response.sendRedirect("home.html");

catch(Exception ex)

out.println(ex.toString());

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on


the left to edit the code.">

/**

* Handles the HTTP <code>GET</code> method.

* @param request servlet request

Page | 283
College Connect
“A Social Networking Website”

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

/**

* Handles the HTTP <code>POST</code> method.

* @param request servlet request

* @param response servlet response

* @throws ServletException if a servlet-specific error occurs

* @throws IOException if an I/O error occurs

*/

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

Page | 284
College Connect
“A Social Networking Website”

/**

* Returns a short description of the servlet.

* @return a String containing servlet description

*/

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

header.jsp
<%--

Document : header

Created on : Feb 7, 2018, 7:26:36 PM

Author : VL-8p

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

Page | 285
College Connect
“A Social Networking Website”

<tr width="1340px"><td> <img src="pwc.JPG" height="100px" width="1340px"


align="center"/></td></tr>

<tr ><td colspan="2" background="6.jpg"> <img src="download.png"


height="100px" width="200px" align="right">

<h1 valign="center" align="center" >COLLEGE CONNECT "A social networking


website"</h2></td>

</tr>

footer.jsp
<%--

Document : footer

Created on : Feb 7, 2018, 7:27:08 PM

Author : VL-8p

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<table width="1350px" height="200" border="2" align="center"


cellpadding="10" cellspacing="20" background="bottom_background.jpg">

<td> <div id="user2-wrap"><div id="user2" class="container row clr">

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Contact Us</h3>

<div class="module-body">

Page | 286
College Connect
“A Social Networking Website”

<div class="custom" >

<p style="text-align: center;"><img src="patna-womens-college-small.jpg" alt=""


border="0" /><br />Bailey Road, Patna Bihar, <strong>PIN</strong> - 800001<br
/><strong>Call</strong> : +91 612 2531186<br /><strong>Email :</strong>
[email protected]</p></div>

</div>

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Location</h3>

<div class="module-body">

<div class="custom" align="center" >

<iframe width="450" height="150" frameborder="0" scrolling="no" marginheight="0"


marginwidth="0"
src="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&a
mp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwlo
c=A&amp;output=embed"></iframe><br /><small><a
href="https://maps.google.co.in/maps?q=patna+womens+college&amp;ie=UTF8&amp;hq=&
amp;hnear=&amp;ll=25.611628,85.124868&amp;spn=0.006295,0.006295&amp;t=m&amp;iwl
oc=A&amp;source=embed" style="color:#0000FF;text-align:left">View Larger
Map</a></small></div>

</div>

Page | 287
College Connect
“A Social Networking Website”

</div></td>

<td>

<div class="module span_4 col clr">

<h3 class="module-title" align="center">Important Links</h3>

<div class="module-body">

<div class="custom" >

<ul>

<li><a href="http://www.ugc.ac.in" target="_blank">University Grants Commission</a></li>

<li><a href="http://www.patnauniversity.ac.in/" target="_blank">Patna University</a></li>

<li><a href="http://www.patnauniversity.ac.in/colleges.html" target="_blank">College of


Patna University</a></li>

<li><a href="http://india.gov.in" target="_blank">National Portal of India</a></li>

<li><a href="http://righttoinformation.gov.in" target="_blank">RTI</a></li>

<li><a href="/index.php/component/content/article/14-annnual-result/84-annual-
result.html">Annual Result</a></li>

<li><a href="/index.php/component/content/article/15-media-response/85-media-
response.html">Media Response</a></li>

</ul></div>

</div>

</div>

</td>

</table>

Page | 288
College Connect
“A Social Networking Website”

Page | 289
College Connect
“A Social Networking Website”

Home Page

Notice Page

Page | 290
College Connect
“A Social Networking Website”

Admission Notice Page

Registration page

Page | 291
College Connect
“A Social Networking Website”

Member Login

Forget Password Page

Page | 292
College Connect
“A Social Networking Website”

Hint Password page

Student Home Page

Page | 293
College Connect
“A Social Networking Website”

My Profile Page

Edit Profile Page

Page | 294
College Connect
“A Social Networking Website”

Vie
View Notification Page

View Result Page

Page | 295
College Connect
“A Social Networking Website”

View Exam Details Page

Page | 296
College Connect
“A Social Networking Website”

Post Page

Page | 297
College Connect
“A Social Networking Website”

Post & Comments Page

Page | 298
College Connect
“A Social Networking Website”

Faculty Home Page

My Profile Page

Page | 299
College Connect
“A Social Networking Website”

View Notification Page

Edit Profile Page

Page | 300
College Connect
“A Social Networking Website”

Update Exam Details Page

Page | 301
College Connect
“A Social Networking Website”

Update Result Page

Page | 302
College Connect
“A Social Networking Website”

Post Page

Posts & Comments Page

Page | 303
College Connect
“A Social Networking Website”

Admin Login Page

Page | 304
College Connect
“A Social Networking Website”

Admin Notice Page

Update Notification Page

Page | 305
College Connect
“A Social Networking Website”

Approve Members Page

Finally, the log out page is the page that closes all the sessions and where all the data
and cookies are deleted, the page also ask the user click a link to d
direct
irect them back tto
the home page.

Page | 306
College Connect
“A Social Networking Website”

Testing

Page | 307
College Connect
“A Social Networking Website”

Introduction
Testing is the process of running a system with the intention of finding errors.Testing enhances the
integrity of a system by detecting deviations in design anderrors in the system. Testing aims at
detecting error-prone areas. This helps in theprevention of errors in a system. Testing also adds value
to the product byconforming to the user requirements.

The main purpose of testing is to detect errors and error-prone areas in asystem. Testing must be
thorough and well-planned. A partially tested system is asbad as an untested system. And the price
of an untested and under-tested system ishigh.

The implementation is the final and important phase. It involves user-training, system testing in
order to ensure successful running of the proposedsystem. The user tests the system and changes
are made according to their needs.The testing involves the testing of the developed system using
various kinds of data. While testing, errors are noted and correctness is the mode.

OBJECTIVES OF TESTING:
The objectives of testing are:

 Testing is a process of executing a program with the intent of finding errors.

 A Successful test case is one that uncovers an as- yet-undiscovered error.

System testing is a stage of implementation, which is aimed at ensuringthat the system works
accurately and efficiently as per the user need, before thelive operation commences. As stated
before, testing is vital to the success of asystem. System testing makes a logical assumption that if all
parts of the as systemare correct, the goal will be successfully achieved. A series of tests are
performedbefore the system is ready for the user acceptance test.

Page | 308
College Connect
“A Social Networking Website”

TESTING METHODS
System testing is the stage of implementation. This is to check whether the systemworks accurately
and efficiently before live operation commences. Testing is vital to thesuccess of the system. The
candidate system is subject to a variety of tests: on lineresponse, volume, stress, recovery, security
and usability tests. A series of tests areperformed for the proposed system is ready for user
acceptance testing.
The Testing Steps are:

Unit Testing
Unit testing focuses efforts on the smallest unit of software design. This isknown as module testing.
The modules are tested separately. The test is carried outduring programming stage itself. In this
step, each module is found to be workingsatisfactory as regards to the expected output from the
module.

Integration Testing
Data can be lost across an interface. One module can have an adverse effecton another, sub
functions, when combined, may not be linked in desired manner inmajor functions. Integration
testing is a systematic approach for constructing theprogram structure, while at the same time
conducting test to uncover errorsassociated within the interface. The objective is to take unit tested
modules andbuilds program structure. All the modules are combined and tested as a whole.

Validation
At the culmination of the integration testing, Software is completelyassembled as a package.
Interfacing errors have been uncovered and corrected anda final series of software test begin in
validation testing. Validation testing can bedefined in many ways, but a simple definition is that the
validation succeeds when the software functions in a manner that is expected by the customer.
Aftervalidation test has been conducted, one of the three possible conditions exists.

 The function or performance characteristics confirm to specification and areaccepted.

Page | 309
College Connect
“A Social Networking Website”

 A deviation from specification is uncovered and a deficiency lists is created.

 Proposed system under consideration has been tested by using validation test andfound to
be working satisfactory.

 Output Testing
After performing the validation testing, the next step is output testing of theproposed system, since
no system could be useful if it does not produce therequired output in a specific format. The output
format on the screen is found to becorrect. The format was designed in the system design time
according to the userneeds. For the hard copy also; the output comes as per the specified
requirementsby the user. Hence output testing did not result in any correction for the system.

 User Acceptance Testing


User acceptance of a system is the key factor for the success of any system.The system under
consideration is tested for the user acceptance by constantlykeeping in touch with the prospective
system users at the time of developing andmaking changes whenever required.This is done in
regard to the following point:

 Input Screen Design

 Output Screen Design

 Format of reports and other outputs.

 Security mechanisms

This system is provided with authentication without which no user can pass. So only thelegitimate
users are allowed to use the application. If the legitimate users share theauthentication information
then the system is open to outsiders.

Page | 310
College Connect
“A Social Networking Website”

Test Report
S.No. Test Case Title Description Expected Result
Outcome
1. Member Member Member should Passed
Registration register register
themselves to themselves
the website
2. Sucessful User The login to the Login should be Passed
Verification system should successful and the
be tried with the user should enter
correct login into the system
username and
password
3. Unsuccessful User Login into the Login should fail Passed
Verification due to system with with an error
wrong password wrong password ’Invalid Password’
4. Unsuccessful User Login into the Login should fail Passed
Verification due to system with with an error
Invalid login Id wrong user id ’Invalid User Id’
5. Unsuccessful User Login into the Login should fail Passed
Verification due to system without with an error ’Not
not approved by approval by Approved by
Admin admin Admin’
6. Password Manager Before login the Account Passed
member can password is
view their showned
forgotten
password by
entering correct
data
7. Edit Profile and View After Login the Member should Passed
Profile user can edit update their data
and view its very efficiently
existing and and also view
updated profile their profile
data

Page | 311
College Connect
“A Social Networking Website”

8. Post and Comment After login the Member should Passed


member can input their posts
post their and their
queries or view comments
and comment respectively
their answers or
suggestions
9. View/Update Result After login Faculty should Passed
& Examination members can update students
Details view and update result and their
results and exam schedule
exam details which should be
visible by
students
10. View/Update After login the Admin should Passed
Notification notification is update
updated by the notification and
admin and should be viewed
viewed by any by website
members or visitors and
website visitors members
11. Approve Members Admin Admin should Passed
Approves approve or delete
Members members in
defined time
interval
12. Log out Logged in Logged in Passed
members logout members should
their account logout their
account
13. Admission Notice Visiter can view Visiter should Passed
college view admission
admission notification and
notification apply via given
link

Page | 312
College Connect
“A Social Networking Website”

Evaluation
Evaluation of the system is performed to identify its strengths and weaknesses. The
actual evaluation can occur along any of the following dimensions:

 Operational Evaluation: Assessment of the manner in which the system


functions, including case of use, response time, overall reliability and level of
utilization.

 Organizational Impact: Identification and measurement of benefits to the


organization in such area as financial concerns, operational efficiency and
competitive impact.

 User Manager Assessment Evaluation of the attitudes of senior and user


manager within the organization, as well as end-users.

 Development Performance: Evaluation of the development process in


accordance with such yardsticks as overall development time and effort,
conformance to budgets and standards and other project management criteria.

Page | 313
College Connect
“A Social Networking Website”

Maintenance
The Maintenance Stage is the final phase of the SDLC. After software passes the design
stage and is implemented, the maintenance phase of the software life cycle begins.
The maintenance phase of the software life cycle allows individuals to check the
performance of the software after it is launched to see if it is all working correctly.

Effective Maintenance required following things.


 Understand Existing code and related document
 Making the changes in code and related documents
 Testing the changes were done during adaptive and corrective maintenance
 Retesting all old parts, those were not the part of changes.

 There are two major types of maintenance corrective maintenance and adaptive
maintenance.
1. Corrective Maintenance:
Even after putting extra efforts and expertise on board for developing flawless
software, it is practically not possible to have fault free system. We do look into the
system even after installed in production for defects. The defects popped up during the
usage of the system need to be fixed and this type of fixing will fall under corrective
maintenance.

2. Adaptive Maintenance:
It has been observed that user come up with some uncovered requirement which was
not a part of requirement analysis phase, but they got to know new things only after
using the system. Usage of the system helps the user to define their requirement more
accurately. This requirement may cause the modification is accepted and installed
system, this type of medication fall under adaptive maintenance.

Page | 314
College Connect
“A Social Networking Website”

Future Scope and Further Enhancement


The advantages and disadvantages of a Online Social Networking website are much the same
asthose for a real life. However, the effort to develop and maintain Online Social Networking
website is usually far less than that expended for a real life system: The most difficult problem
isspecifying a virtual machine which can peacefully coexist with the desired target systems.
Insome respects, this approach makes sense for making people communicate on web.
Theidentification of clear-cut interfaces is a standard structured programming technique, which
(intheory at least) reduces software maintenance costs. The only controversy might be over
theparticular choice of structure (i.e. social networking). In general, whenever organizational site
islikely to outlive its hardware, the COLLEGE CONNECT “ A SOCIAL NETWORKING WEBSITE ”
approach warrantsconsideration. This is because of the high redevelopment costs.

Now, when such social networking site is easily approachable to the user via website, it is
easyand convenient for them to be in touch with their colleagues. It gives further opportunity to
thecoming users to enhance the IT technologies.

 Update website according to user requirements

 Online Games and other application

Page | 315
College Connect
“A Social Networking Website”

Limitations of the Project

As the project is to be developed on JAVA platform, it is difficult to handle and


understand. Throught training of using this system is required. Some limitations are:

 Unavailable when there is no internet connection.

 Security and privacy concerns.

 Users cannot create his own series of categories.

 No compatibility with offline PM software.

 Some basis project management functionality missing.

 Potential distraction.

Page | 316
College Connect
“A Social Networking Website”

Conclusion

By creating this website for college, it is aimed to strengthen the communication


among users and make campus life more lively and exciting by combining academics
and cultural activities. This social media platform will become an asset for the campus
and can be used for various productive purposes. This social networking site can be
further expanded to all the colleges in the city whereby all students and faculties
would be able to connect and share their knowledge with each other. Also efforts can
be taken to incorporate links to various journals which students and teachers can use
to publish their papers and also get an access to other research papers. An android
application can be developed as well which would enable users to access this social
media through their mobile devices.

Page | 317
College Connect
“A Social Networking Website”

Bibliography

 http://nevonprojects.com/college-social-network-web-project/
 https://www.pinterest.com/pin/97249673173266393/ [p1]
 Griffith, S., & Liyanage, L. (2008, June). An introduction to the potential of social
networking sites in education. In Emerging Technologies Conference 2008 (p. 9).[p2]
 Roblyer, M., McDaniel, M., Webb, M., Herman, J., & Witty, J. V. (2010). Findings on
Facebook in higher education: A comparison of college faculty and student uses and
perceptions of social networking sites. The Internet and Higher Education, 13(3), 134-
140.[p4] Retrieved from http://www.sciencedirect.com/science/article/pii/S10967
51610000278
 http://www.w3schools.com
 http://www.javatpoint.com
 http://www.freestudentprojects.com/java-projects/social-networking-site/

Page | 318

You might also like