Project Report
Project Report
SUBMITTED BY
KARTIK WADEHRA
07114803114
in partial fulfilment of Summer Training for the award of the degree
of
BACHELOR OF TECHNOLOGY
IN INFORMATION TECHNOLOGY
1|Page
POLICE STATION MANAGEMENT WEB APPLICATION
A SUMMER TRAINING REPORT
Submitted by
KARTIK WADEHRA
Enrollment Number: 07114803114
INFORMATION TECHNOLOGY
Mr Manish Bhatia
(tutor)
DUCAT, NOIDA
A - 43 & A - 52 Sector - 16, Noida (U.P)
2|Page
3|Page
ACKNOWLEDGEMENT
Kartik Wadehra
07114803114
I-3
4|Page
ABOUT THE INSTITUTE
Like other educational and training industry at DUCAT you will be offered
varieties programs but the instructors makes the difference and make
DUCAT stand out from others.
Along with training students with the latest technologies and programming
languages, DUCAT also connect them to software companies via
placement assistance program. This program includes practicing a lot of
interview problems and dummy interviews conducted by company
representatives.
DUCAT is on a mission to create skilled Software Engineers for our
country and the world .DUCAT are here to bridge the unfilled gaps
between the qualities demanded by the industry and quality of skills
imparted by conventional institutes.
DUCAT creates confident developers who think beyond industrial jobs.
5|Page
TABLE OF CONTENTS
List of figures 7
Abstract 8
Software Requirements 10
Project Analysis 21
Future Enhancements 39
6|Page
LIST OF FIGURES
Figure Page No
JDBC Related 12
Servlet Related 16
JSP Related 18
HTML5 logo 19
CSS3 Logo 20
23
25
27
29
30
7|Page
Abstract
Title of the project: POLICE STATION MANAGEMENT WEB APPLICATION.
Existing System:
Proposed System:
8|Page
Stations across the territory. Initially, the system will be implemented
across Cities and Towns and later on, be interlinked so that a Police
detective can access information across all records in the state thus
helping speedy and successful completion to cases. The System would
also be used to generate information for pro-active and preventive
measures for fighting crime. This application gives the following
information.
System can provide the details of the police station and the
employees.
Application will provide the details of victims and the registered F.I.R
At any point of time system can provide the details of evidence and
their sequence
This application provides the details of existing charge sheets and their
status.
9|Page
Software requirements:
Database : Oracle.
Hardware requirements:
Additional Tools:
10 | P a g e
1. A brief about languages and APIs used.
JAVA
Java is a set of computer software and specifications developed by Sun Microsystems,
which was later acquired by the Oracle Corporation,that provides a system for
developing application software and deploying it in a cross-platform computing
environment. Java is used in a wide variety of computing platforms from embedded
devices and mobile phones to enterprise servers and supercomputers. While they are
less common than standalone Java applications, Java applets run in
secure, sandboxed environments to provide many features of native applications and
can be embedded in HTML pages.
Writing in the Java programming language is the primary way to produce code that will
be deployed as byte code in a Java Virtual Machine (JVM); byte code compilers are
also available for other languages, including Ada, JavaScript, Python, and Ruby. In
addition, several languages have been designed to run natively on the JVM,
including Scala, Clojure and Apache Groovy. Java syntax borrows heavily
from C and C++, but object-oriented features are modeled
after Smalltalk and Objective-C. Java eschews certain low-level constructs such as
pointers and has a very simple memory model where every object is allocated on the
heap and all variables of object types are references. Memory management is handled
through integrated automatic garbage collection performed by the JVM.
On November 13, 2006, Sun Microsystems made the bulk of its implementation of Java
available under the GNU General Public License (GPL).
11 | P a g e
JDBC(Java Database Connectivity)
Java Database Connectivity (JDBC) is an application programming
interface (API) for the programming language Java, which defines how a
client may access a database. It is part of the Java Standard
Edition platform, from Oracle Corporation. It provides methods to query
and update data in a database, and is oriented towards relational
databases. A JDBC-to-ODBC bridge enables connections to any ODBC-
accessible data source in the Java virtual machine (JVM) host
environment.
12 | P a g e
DEVELOPMENT OF JDBC API OVER TIME :-
2. Native-API driver.
13 | P a g e
3. Network Protocol Driver
14 | P a g e
JAVA SERVLET
15 | P a g e
SERVLET LIFE CYCLE
Multiple Threads in Web Servers to handle multiple clients at the same time.
16 | P a g e
JSP (JAVA SERVER PAGES)
To deploy and run Java Server Pages, a compatible web server with a servlet container,
such as Apache Tomcat or Jetty, is required.
1) Extension to Servlet
JSP technology is the extension to servlet technology. We can use all the features of servlet in
JSP. In addition to, we can use implicit objects, predefined tags, expression language and
Custom tags in JSP, that makes JSP development easy.
2) Easy to maintain
JSP can be easily managed because we can easily separate our business logic with
presentation logic. In servlet technology, we mix our business logic with the presentation logic.
If JSP page is modified, we don't need to recompile and redeploy the project. The servlet code
needs to be updated and recompiled if we have to change the look and feel of the application.
In JSP, we can use a lot of tags such as action tags, JSTL, custom tags etc. that reduces the
code. Moreover, we can use EL, implicit objects etc.
17 | P a g e
JSP LIFE CYCLE
18 | P a g e
HTML 5
HTML5 is a markup language used for structuring and presenting content on the World
Wide Web. It is the fifth and current version of the HTML standard.
It was published in October 2014 by the World Wide Web Consortium (W3C) to improve
the language with support for the latest multimedia, while keeping it both easily readable
by humans and consistently understood by computers and devices such as web
browsers, parsers, etc. HTML5 is intended to subsume not only HTML 4, but
also XHTML 1 and DOM Level 2 HTML.
While some features of HTML5 are often compared to Adobe Flash, the two
technologies are very different. Both include features for playing audio and video within
web pages, and for using Scalable Vector Graphics. However, HTML5 on its own
cannot be used for animation or interactivity it must be supplemented
with CSS3 or JavaScript. There are many Flash capabilities that have no direct
counterpart in HTML5.
19 | P a g e
CSS 3
Cascading Style Sheets (CSS) is a style sheet language used for describing
the presentation of a document written in a markup language. Although most often used
to set the visual style of web pages and user interfaces written in HTML and XHTML,
the language can be applied to any XML document, including plain XML, SVG and XUL,
and is applicable to rendering in speech, or on other media. Along with HTML and
JavaScript, CSS is a cornerstone technology used by most websites to create visually
engaging webpages, user interfaces for web applications, and user interfaces for many
mobile applications.
CSS is designed primarily to enable the separation of document content from document
presentation, including aspects such as the layout, colors, and fonts. This separation
can improve content accessibility, provide more flexibility and control in the specification
of presentation characteristics, enable multiple HTML pages to share formatting by
specifying the relevant CSS in a separate .css file, and reduce complexity and repetition
in the structural content.
20 | P a g e
2. PROJECT ANALYSIS
Home Page
1. Admin Module:
21 | P a g e
Admin Login
Which the passes a validation through JavaScript to check if its values are empty or
not,
<SCRIPT language="JavaScript">
function validate()
{
if(document.frm.UserName.value==""||document.frm.Password.value=="")
{
alert("UserName or Password cannot be blank!!");
document.frm.UserName.focus();
return false;
//return;
/* document.frm.action="Validate.jsp";
document.frm.submit(); */
}
}
</SCRIPT>
22 | P a g e
To finally enter the Admin Zone.
23 | P a g e
TNAME TABTYPE CLUSTERID
CIRME_SEQ_ESTIMATION_MASTER TABLE
CRIME_CATEGORY_MASTER TABLE
CRIME_CATEGORY_NATURE_MASTER TABLE
CRIME_CHARGESHEET_MASTER TABLE
CRIME_WITNESS_MASTER TABLE
DEPARTMENT_EMPLOYEES_MASTER TABLE
DEPARTMENT_MASTER TABLE
DESIGNATION_MASTER TABLE
EVIDENCE_MASTER TABLE
EVIDENCE_TYPE_MASTER TABLE
INVESTIGATION_MASTER TABLE
LOGIN_MASTER TABLE
POLICE_STATION_MASTER TABLE
TERRITORY_MASTER TABLE
VICTIMES_MASTER TABLE
VICTIMS_FIR_MASTER TABLE
24 | P a g e
2. Investigation Module:
This module is related to Investigation. In this module Investigation Officer can view F.I.R
details, new victims details, witness details, evidence details, and charge sheet details.
25 | P a g e
try{ try
{
con = ds.getConnection1();
st=con.createStatement(); con = ds.getConnection1();
rs=st.executeQuery("select PreparedStatement
max(INVESTIGATION_ID) from stat=con.prepareStatement("INSERT INTO
investigation_master"); investigation_master values(?,?,?)");
System.out.println("rs:"+rs); stat.setString(1,a);
int id=0; stat.setString(2,b);
stat.setString(3,c);
while(rs.next())
{ stat.executeUpdate();
invid=rs.getString(1);
response.sendRedirect("investigationt_master.
System.out.println("invid:"+in jsp");
vid); }
catch(Exception E)
System.out.println("inside {
while"); out.println("Error
if(invid==null) inserting value"+E);
{ }
finally
System.out.println("inside {
if"); con.close();
}
invid="INV101";
%><option
value="<%=invid%>"><%=invid%></option
>
<%
}
else{
System.out.println("inside
else");
String invid1=rs.getString(1);
String str=invid1.substring(3,6);
int x=Integer.parseInt(str);
x++;
invid1="INV"+x;;
%>
<option
value="<%=invid1%>"><%=invid1%></opti
on>
<%}}
26 | P a g e
3. F.I.R Module:
This module maintains the information related to the First Investigation Report of the
crime sequences that have taken place. The F.I.R registers all that a data that is
necessary for the investigation to take place in proper length. It identifies the crime
category and the crime nature.
This allows you to fill the FIR but before filling that youve to specify Crime Nature ID
and Victim FIR ID through the Crime Menu which further allows to insert/delete Victims
as well as Crime Nature IDs.
27 | P a g e
ResultSet rs=null; DataCon ds = new DataCon();
Connection con=null;
DataCon ds = new DataCon();
Statement st=null;
ResultSet rs=null;
String a=request.getParameter("D1"); String evid=null;
String b=request.getParameter("name");
String c=request.getParameter("hno");
try{
String d=request.getParameter("street");
String e=request.getParameter("city"); con = ds.getConnection1();
String f=request.getParameter("state"); st=con.createStatement();
rs=st.executeQuery("select
String g=request.getParameter("country");
max(VICTIM_ID) from VICTIMES_MASTER");
int System.out.println("rs:"+rs);
h=Integer.parseInt(request.getParameter("pin")); int id=0;
int
while(rs.next())
i=Integer.parseInt(request.getParameter("phone"));
{
String j=request.getParameter("date"); evid=rs.getString(1);
String k=request.getParameter("email");
String l=request.getParameter("other"); System.out.println("inside
while");
String m=request.getParameter("rdate");
if(evid==null)
{
try
{ System.out.println("inside if");
<option
stat.executeUpdate();
value="<%=evid%>"><%=evid%></option>
<%}
response.sendRedirect("victim_master.jsp"); }
}
catch(Exception E)
%>
{ <%
out.println("Error inserting }catch(Exception e){}
value"+E); rs.close();
st.close();
}
con.close();
finally
{ %>
con.close();
}
28 | P a g e
Similar to the above modules,
1. CHARGESHEET FILING
2. EVIDENCE MASTER
29 | P a g e
And other modules involving similar type of JDBC access/update code are used in the
entire set of modules.
4. Writer Module:
This module is related to Writer. In this module the duty of writer in the police station is
presented. The write can add new victim details, new investigation details, new witness
details, new evidence details, new crime nature details, and new Charge Sheet.
The Writer can be a data entry employee for the Police Station or a Junior Officer
registering a complaint for a victim.
The Writer has the permissions to add Victim details, file Chargesheets and
update Investigation Module. However, he doesnt have unlimited access as
compared to the administrator.
30 | P a g e
HOW THE INSERT, DELETE and SEARCH CODE
WORKS?
1. Insert
ResultSet rs=null;
DataCon ds = new DataCon();
String a=request.getParameter("D1");
String b=request.getParameter("D2");
String c=request.getParameter("T1");
String d=request.getParameter("T2");
try
{
con = ds.getConnection1();
PreparedStatement stat=con.prepareStatement("INSERT INTO
CRIME_WITNESS_MASTER values(?,?,?,?)");
stat.setString(1,a);
stat.setString(2,b);
stat.setString(3,c);
stat.setString(4,d);
stat.executeUpdate();
response.sendRedirect("crime_witness_master.jsp");
}
catch(Exception E)
{
out.println("Error inserting value"+E);
}
finally
{
con.close();
}
31 | P a g e
DataCon class :-
public class DataCon
{
Connection con;
Here we see that DataCon class was made to connect to the database via
the standard Class.forName() method. Try-catch blocks are used here as
the code can throw SQLException which is a checked exception.
32 | P a g e
stat reference variable of the PreparedStatement interface calls the
setString() method which will insert the string vales taken from HTML into
the (?,?,?) space of the query and send it across the network.
2. Delete
<%
String s = request.getParameter("a");
System.out.println(s);
DataCon ds = new DataCon();
Connection con=null;
Statement st=null;
ResultSet rs=null;
try{
con = ds.getConnection1();
st=con.createStatement();
rs=st.executeQuery("delete from investigation_master where
INVESTIGATION_ID='"+s+"'");
}catch(Exception e){}
con.close();
%>
No result set will be returned here. If the deletion is successful the web
page will display, your records have been deleted.
33 | P a g e
3. Search
html>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%@ page import="connection.*"%>
<%! String c1;%>
<%! int c2;%>
<head>
<title>New Page 1</title>
<meta name="Microsoft Theme" content="none">
</head>
<body bgcolor=aliceblue leftmargin=0 topmargin=0>
<form method="POST" action="evidence_type_searchresult.jsp">
<table border="0" width="80%">
<tr>
<td width="100%"><img src="policecrime.jpg" width="770" height="60"><br>
<%@ include file = "header.htm"%></td>
</tr>
<tr>
<td>
<table border="0" width="100%" height="129">
<tr>
<td width="20%" height="125"><marquee direction="down"><img
src="p1.jpg" width="150" height="80"><BR><BR><BR><img src="p2.jpg" width="150"
height="80"><BR><BR><BR><img src="p3.jpg" width="150" height="80"><BR><BR><BR><img
src="p4.jpg" width="150" height="80"><BR><BR><BR><img src="p5.jpg" width="150"
height="80"></marquee></td>
<td width="80%" height="125">
<table border="0" width="368" height="225">
<tr align="center">
<td colspan=4 width="360" height="70">
<p align="center"><b><font face="Verdana" size="4">Evidence Type
</font></b>
<p align="center">
<br>
<table border="0" width="100%">
<tr>
<td width="25%" align="right"><b>
<font size="3">
Evidence Type ID</font>
</b></td>
<td width="24%">
<select size="1" name="a">
<%
DataCon ds = new DataCon();
Connection con=null;
Statement st=null;
ResultSet rs=null;
34 | P a g e
try{
con = ds.getConnection1();
st=con.createStatement();
rs=st.executeQuery("select * from EVIDENCE_TYPE_MASTER");
while(rs.next())
{
c1=rs.getString(1);
%>
<option value="<%=c1%>"><%=c1%></option>
<%}
%>
<%
}catch(Exception e){}
con.close();
%>
</select>
</td>
</tr>
<tr align="center">
<td colspan=4>
<input type="submit" value="view" name="submit">
</td>
</tr>
<table>
</td>
</tr>
</table>
</form>
</body>
</html>
Firstly, the search option was also keyed by the primary key of the table.
Now, when clicked on the search button, a multiple option list will open which will
contain the Evidence Type IDs, which is the primary key of the table.
Once submitted, the action attribute of the form tag will take the control to the
backend.
<%
DataCon ds = new DataCon();
Connection con=null;
Statement st=null;
ResultSet rs=null;
try{
con = ds.getConnection1();
st=con.createStatement();
rs=st.executeQuery("select * from EVIDENCE_TYPE_MASTER where
evidence_type_master='"+request.getParameter("a")+"'");
35 | P a g e
while(rs.next())
{
c1=rs.getString(1);
c2=rs.getString(2);
c3=rs.getString(3);
}
}catch(Exception e){}
con.close();
%>
<table width="436">
<tr>
<td width="302" align="right" height="25"><b><font size="3">Evidence Type
ID:</font> </b></td>
<td width="120" align="left"><b>
<font face="Verdana" size="2">
<%=c1%>
</font>
</b>
</td>
</tr>
<tr>
<td width="302" align="right" height="25"><b><font size="3">Evidence Type
Name:</font> </b></td>
<td width="120" align="left"><b>
<font face="Verdana" size="2">
<%=c2%>
</font>
</b>
</td>
</tr>
<tr>
<td width="302" align="right" height="25"><b><font size="3">Evidence Type
Desc:</font> </b></td>
<td width="120" align="left"><b>
<font face="Verdana" size="2">
<%=c3%>
</font>
</td>
</tr>
</table>
</table>
</form>
</body>
</html>
Here a select query with the Statement Interafce is executed with the return type
of request.getParameter( ) as its main parameter.
36 | P a g e
next() function, also a part of the Collection Interface, is used to go from one
record to another in the ResultSet. Before its called, the cursor of the next()
function is just before the first record. It firstly checks whether a next record
exists (if the value in memory is not null) then stores all the column values of the
record in the Strings defined to display it through HTML later.
37 | P a g e
FUTURE ENHANCEMENTS
1. As I was new to Front End Web Development, the UI is basic and
website.
Processing techniques.
the query to get our result instead of creating other tables for it.
38 | P a g e
REFERENCES
www.google.com
http://www.w3schools.com/html/
http://www.w3schools.com/css/default.asp
https://www.oracle.com/java/index.html
www.github.com/piyushk96
39 | P a g e