Rajat Final Training

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

A Project Report

On Java
Topic-Examination system

Submitted By:
Apoorva Rathore
Roll Number:1142017
Branch: Computer Science
Batch: B.Tech 3rd year
Section : CO3
DECLARATION

I, hereby declare that the report of the project entitled Examination system
has not been presented as a part of any other academic work to get my degree or
certificate except National Institute of Technology, Kurukshetra for the
fulfillment of the requirements for the degree of Bachelor of Technology with
Computer Engineering as major.
ACKNOWLEDGEMENT

The present report would not have been possible without the help I have
received from various quarters. I shall be failing in my duty if dont
acknowledge the help and guidance from these sources.

I extend my special thanks to Mr Prakash Goel, Mr Ajay Durgapal for their


benevolent guidance and kind cooperation throughout my training and for
completing this project report. I also convey my special thanks to all other staff
members. This guidance has helped me a lot in familiarizing with java and sql
concepts.

I am highly indebted to faculty members of NIT, Kurukshetra for their


guidance and efforts to make me an able engineer to design and excel in
technology.

Last but not the least; I am thankful to all for their sincere efforts during my
training.

Apoorva Rathore

Roll no.1142017

B.Tech 3rd Year

National Institute of Technology Kurukshetra


Table of Contents

1. Company Profile.......................................................................................................................... ..1


1.1 Aims and Objectives .1
1.2 Products offered by the company..................................................................................... .1
2. Introduction to java..............................................................................................................2-4
2.1 JDBC........5-6
2.2Servlets..............................7-10
2.3 HTML...............................................L..11-14
2.4JSP. ...............15-18
2.5 java beans....................................................................................................................................19
3.Database models................................................................................................................................19
3.1Single tier......................................................................................................................................19
3.2Two tier.........................................................................................................................................19-20
3.3three tier and n-tier........................................................................................................................20-21
4.Project Overview................................................................................................................................21-22.
5.Problem Statement.............................................................................................................................22.
5.1Requirement analysis ........23
5.2Requirement specification........................................24
6.System Design.................................................................................................................................. .24
6.1Level 0 DFD.................................................................................................................................24
6.2Use Case Diagram...............................................................................................................25

7.Project Features.......................................................................................................................26
7.1Login page................................................................................................................ .........26
7.2Student page......................................................................................................................26
7.3Admin page...................................................................................................................... .27
7.4Faculty page.......................................................................................................................27
8.Database design.......................................................................................................................28
8.1Database dictionary.............................................................................................................28
8.2Database tables...................................................................................................................29-31
COMPANY PROFILE
Aptech computer education is a premier education institute with 30 years of
experience in IT training. Aptech computer education has parterned with
leading technology companies such as Microsoft, Red Hat, Java and Oracle to
offer courses that are globally recognised . The Institute offers seminars and job
fairs to encourage student interaction and prepare them for job interviews.

Aims and Objectives


The aims and objectives of the company are:-
IT cost Benefit Estimation.
Deliever exceptional value and industry leading growth.
Deployment of technology.
Enable enterprises manage information better.
Web presence management.

Products offered by this company:


Creative innovative products and services that are intuitive and user
friendly.
Identify new business models that surround smarter producrs.
Web presence management.

INTRODUCTION TO JAVA
CREATION OF JAVA
Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank and Mike
Sheridan at SUN Microsystems Incorporation in the year 1991.It took 18 months to develop
the 1st working version. This language was initially called OAK, but was renamed
JAVA in 1995, many more contributed to the design and evolution of the language.

JAVA OVERVIEW

Java is a powerful but lean object-oriented programming language. It has generated a lot of
excitement because it makes it possible to program for Internet by creating Applets. Programs
that can be embedded in web page. The context of an applet can be an animation with sound,
an interactive game or a ticker tape. With constantly updated stock prices. Applets can be just
little decorations to liven up web page, or they can be serious applications like Word
processor or Spreadsheet.

But Java is more than a programming language for writing Applets. It is being used more and
more for writing standalone applications as well. It is becoming so popular that many people
believe it will become standard language for both general purpose and Internet programming.

There are many buzzwords associated with Java, but because of its spectacular growth in
popularity, a new buzzword has appeared ubiquitous. Indeed, all indications are that it will
soon be everywhere.

Java builds on the strength of C++. It has taken the best features of C++ and discarded the
more problematic and error prone parts. To this lean core, it has added garbage collection
(automatic memory management), multithreading (the capacity for one program to do more
than one thing at a time), security capabilities. This result is that Java is simple, elegant, and
powerful and easy-to-use.

Java is actually a platform consisting of 3 components:

1. Java Programming Language.


2. Java Library of Classes and Interfaces.
3. Java Virtual Machine
The following sections will say more about these components.
JAVA IS PORTABLE
One of the biggest advantages Java offers is that it is portable. An application written in Java
will run on all the major platforms. Any computer with a Java-based browser can run the
applications or Applets written in the Java-Programming-Language. A programmer no longer
has to write one program to run on a Macintosh, another program.

to run on a Windows-machine still another to run on a UNIX-machine and so on. In other


words, with Java developers write their programs only once.

The Virtual Machine is what gives Java is cross platform capabilities. Rather being compiled
into machine language, which is different for each OSs and computer architecture, Java code
is compiled into Byte codes.

With other languages, the program code is compiled into a language that the computer can
understand. The problem is that other computers with different machine instruction set cannot
understand that language. Java code on the other hand is compiled into Byte-Code rather than
a machine language. These byte codes go to the JVM, which executes them directly or
translates them into the language that is understood by the machine running it.

In summary, these means that with the JDBC API extending Java, a programmer writing Java
code can access all the major RDBMS on any platform that supports the JVM.

JAVA IS OBJECT-ORIENTED

The Java programming language is OBJECT-ORIENTED, which makes program design


focus on what you are dealing with, rather than on how your are going to do something. This
makes it more useful for programming in sophisticated projects, because one can break the
things into understandable components. A big benefit is that these components can then be
reused.

Object-Oriented Languages use the paradigm of classes. In simplest term, a class includes
both the data and the functions to operate on data. You can create an instance of a class, also
called an object, which will have all the data members and functionality of its class. Because
of this, you can think of a class as being like template, with each object being a specific
instance of a particular type of class.
The class paradigm allows one to encapsulate data so that specific data values are those using
the data cannot see the function implementation. Encapsulation makes it possible to make the
changes in code without breaking other programs that use that code.

If for example, the implementation of a function is changed, the change is invisible to any
programmer who invokes that function, and does not affect his/her program, except hopefully
to improve it.

Java includes inheritance, or the ability to derive new classes from existing classes. The
derived class, is also called as Sub-Class, inherits all the data in the functions of the existing
class

JAVA DEVELOPMENT ENVIRONMENT

To code, edit, debug and test the java programs, one needs to have a java development
environment. At the minimum this will consists of a java compiler interpreter and applet
viewer where applets can be tested.

Suns java development kit (JDK) latest version is 2.2 can be freely downloaded from the
Internet. Java compiler is available on DOS, Win95, WINNT, Solaris and MAC etc

DEVELOPMENT OF JAVA:

The Internet helped catapult Java to the forefront of programming, and Java, in
turn, has had a profound effect on the Internet. The reason for this is quite
simple: Java expands the universe of objects that can move about freely in the
cyberspace. In a network, two very broad categories of objects are transmitted
between the server and our computer passive information and dynamic, active
programs.

As desirable as dynamic, networked programs are, they also present serious


problems in the areas of security and portability. Java achieves this security or
protection by confining a Java program to the Java execution environment and
not allowing it to access to other parts of the computer. Many types of the
computers and operating systems are in use throughout the world and many are
connected to the Internet. For programs to be dynamically download to all the
various types of platforms connected to the Internet, some means of generating
portable executable code is needed.

Java was designed to be easy for the professional programmers to learn and use efficiently.
The object model of Java is simple and easy to extend, while simple types, such as integers
are kept as high-performance non-objects.

BSNL System is implemented using the Java language so as to make the programmers and
different users at different levels can make use of this system very affectively.

The multiplatform environment of the web places extraordinarily demands on a program,


because the program must execute reliably in a variety of systems. Thus, the ability to create
robust programs was given a high priority in the design of Java. At the same time, Java frees
us from having to worry about many of the most common cause of programming errors.
Because Java is strictly typed language, it checks our code at the compile time and also at
run-time.

Java was designed to meet the real world requirements of creating interactive,Networked
programs. Java supports multithreaded programming, which allows us to write programs that
do many things simultaneously. A central issue for the Java designers was that of code
longevity and portability. Their goal was write once; run anywhere, anytime, forever .

Java enables the creation of the cross-platform programs by compiling into intermediate
representation called Java byte code. This code can be interpreted on any system that
provides a java virtual machine. Java is designed for the distributed environment of the
Internet, because it handles TCP/IP protocols. In fact, accessing a resource using a URL is
not much different from accessing a file. The original version of Java (OAK) included
features for intra-address-space messaging. Java programs carry with them substantial
amounts of the run-time type information that is used to verify and resolve accesses to objects
at run-time. This makes it possible to dynamically link code in a safe and expedient manner.

JDBC (Java Database Connectivity) :


Introduction:
JDBC (Java Database connectivity) is a front-end tool for connecting to a server to ODBC in
that respect, however JDBC can connect only java client and it uses ODBC for the
connectivity. JDBC is essentially a low-level API since any data manipulation, storage and
retrieval has to be done by the program itself. Some tools, which provide a higher-level
abstraction, are expected shortly.
The next question that needs to be answered is why we need JDBC, once we have ODBC on
hand. We can use the same ODBC to connect the entire database and ODBC is a proven
technology.

Problem for doing this is ODBC gives a c language API, which uses pointers extensively.
Since java does not have any pointes and is object-oriented sun Microsystems, inventor of
java developed to suit its needs.

After that you need to have a back-end database engine for which a JDBC driver is available.
When JDBC drivers are not available JDBC-ODBC bridge drivers are used to access the
database through ODBC. Back-end is not needed when JDBC driver is capable of storing and
retrieving the data itself, or if JDBC-ODBC Bridge and the ODBC driver can be used to store
and retrieve the information.

It is a java data base connectivity having database as a back-end of java as front end.
Database is a collectivity of related data. A data base management system (DBMS) controls
the storage or retrieval of data in the database. The main use of this JDBC is the database
connectivity to a java program.

Using drivers we can get connection to the back-end:

1. Which drive we are going to connect back-end.

2. Create a data source name (dsn).

3. Create a statement for connection.

The package we use here is import java.sql.*

Interfaces of JDBC include drivers, connection, and statement; prepare statement, callable
statement, Result Set, Result Set Meta data. Classes of JDBC are driver manages, driver
property information, date and time, and timestamp, type. The driver defined by the class
Jdbc odbc driver in package sun.jdbc.odbc. Class sun.jdbc.odbc.jdbc odbc driver represents
the jdbc to odbc bridge driver.

Requirements to use JDBC:

To use JDBC you need a basic knowledge of databases and SQL.A part from this you
need the jdk1.1 (Java Development Kit1.1 available javasofts website) or a version of Java
since jdk1.1 and above come bundled with JDBC software.

JDBC Driver Types:

The JDBC drivers that we are aware of at this time fit into one of four categories:

1. JDBC-ODBC BRIDGE PLUS ODBC DRIVER

The java soft bridge product provides JDBC access via ODBC drivers. Note that ODBC
binary code end in many cases database client code must be loaded on each client machine
that uses this driver. As a result, this kind of driver is most appropriate on a corporate
network where client installations are not major problem, or for application server code
written in java in a 3-tier architecture.

2. NATIVE API PARTLY-JAVA DRIVER

This kind of driver converts JDBC calls into calls on the client API for oracle Sybase,
Informix, DB2, or other DBMS. Note that, like the bridge driver, this style of driver requires
that some binary code be loaded on each client machine.

3. JDBC-NET ALL-JAVA DRIVER

This driver translates JDBC calls into a DBMS independent net protocol, which is then
translated, to a DBMS protocol by a server. This net server middle-ware is able to connect its
all java clients to many different databases. The Specific protocol used depends on the
vendor. In general, this most flexible JDBC alternative. It is likely that all vendors of this
solution will provide products suitable for intranet use. In order for these products to also
support Internet access, they must handle the additional requirements for security, access
through firewalls, etc that the web imposes. Several vendors are adding JDBC drivers to their
existing database middleware products.

4. NATIVE PROTOCOL ALL-JAVA DRIVER

This kind of driver converts JDBC calls into the network protocol used by DBMS directory.
This allows a direct call from the client machine to the DBMS server that is practical solution
for intranet access. Since many of these protocols are proprietary, the database vendors
themselves will be the primary source. Several database vendors have these in progress.
Eventually, we expect that driver categories 3 and 4 will be the preferred way to access
databases from JDBC. Driver categories one and two are interim solutions where direct all
java drivers are not yet available. Category 4 is in some sense the ideal; however, there are
many cases where category 3 may be preferable: eg: -where a thin DBMS-independent client
is desired, or if a DBMS independent protocol is standardized and implemented directly by
many DBMS vendors.

DATABASE MODELS
JDBC and accessing the database through applets and JDBC API via an intermediate server
resulted server resulted in a new type of database model which is different from the client-
server model. Based on number of intermediate server through the request should go it is
named as single tire, two tire and multi tire architecture.

Single Tier

In a single tier the server and client are the same in the sense that a client program that needs
information (client) and the source of this type of architecture is also possible in java, in case
flat files are used to store the data. However this is useful only in case of small applications.
The advantage with this is the simplicity and portability of the application developed.
Server and
client

Database

Two Tier (client-server)

In two tier architecture the database resides in one machine and client in different machine
they are connected through the network. In this type of architecture a database management
takes control of the database and provides access to clients in a network. This software
bundle is also called as the server. Software in different machines, requesting for information
are called as the clients.

Server

Client

Three Tier and Client


N-Tier

In the three-tier architecture, any number servers can access the database that resides on
server which in turn serve clients in a network. For example, you want to access the database
using java applets, the applet running in some other machine, can send request only to the
server from which it is down loaded. For this reason we will need to have a intermediate
server which will accept the requests from applets and them to the actual database server.
This intermediate server acts as a two-way communication channel also. This is the
information or data from the database is passed on to the applet that is requesting it. This can
be extended to make n tiers of servers, each server carrying to specific type of request from

clients, however in practice only 3 tiers architecture is pop

PROJECT OVERVIEW

EXAMSUITE- Examination system


ABSTRACT

The project is entitled as Examsuite, examination system in java. It is designed with the
specific goal of reducing the hectic job of assessing the answers given by candidates
manually. Responses given by the candidate will be checked instantly and automatically.
Hence it will reduce paper work. The result will be shown immediately to the participating
student, reducing anxiety. The system can be used by educational institutes to evaluate
students regularly. There are generally two types of users here .The first users are the students
which will login into the system as normal users. They have a particular id and password
allotted to them. They can take test on any of the subjects available in the database . The
second type of users are the admin .They also have a login id and password through which
they can login .They have the special privilege that they can either add new questions or
delete an existing question . Their task is to keep the portal updated as per the user
requirement.

Scope of the Project

Examsuite is designed for educational institutes like schools, universities and training
centres.
The system generates report as soon as the test is finished.
The type of question is only multiple choice.

Project Overview

Examsuite has the following stages:

Login.
Test.
Result.

LOGIN:
Each registered user is provided a unique login id and password by which he/she enters
the system. It makes the system secure and reliable. Administrators have a different login
id as they are granted more privilege.

TEST:
Test page is the most important page in the project. It consists of subject selection and utilities.
With subject selection, the user can select the subject of his choice for test. Utilities include skip
and come back to the question afterwards, change the answer multiple times etc.

RESULT:
On the basis of the attempted questions, the result is calculated immediately and is shown to the
user at the end of the test.

Technologies Used:

JDBC, Swings and SQL.

Software Requirements:

Apache.
MYSQL server.
Netbeans IDE.

PROBLEM STATEMENT

Problem statement is one of the basic and important phases of project phase. When the basic
problem is determined, it is documented and the symptomatic problem is analyzed, then the
current list of basic problem is completed. A system is simply a set of components that
interact to accomplish some purpose.

Examsuite is a software application which helps the students to learn and memorize learning
concepts .It saves the time of students by saving all the important questions in its database, so
that the student need not to go anywhere. Also this application provides an interface to users
to monitor their progress.

This project is developed using Java Programming Language under Windows.


REQURIEMENTS ANALYSIS

The requirement phase basically consists of three activities:

Requirement Analysis.
Requirement Specification.
Requirement Validation.

Requirement Analysis:

Requirement Analysis is a software engineering task that bridges the gap between system
level software allocation and software design. It provides the system engineer to specify
software function and performance, indicate softwares interface with the other system
elements and establish constraints that software must meet.

The basic aim of this stage is to obtain a clear picture of the needs and requirements of the
end-user and also the organization. Analysis involves interaction between the clients and the
analysis. Usually analysts research a problem by asking questions and reading existing
documents. The analysts have to uncover the real needs of the user even if they dont know
them clearly. During analysis it is essential that a complete and consistent set of
specifications emerge for the system. Here it is essential to resolve the contradictions that
could emerge from information got from various parties. This is essential to ensure that the
final specifications are consistent.

It may be divided into 5 areas of effort.

Problem recognition

Evaluation and synthesis


Modeling
Specification
Review

Each Requirement analysis method has a unique point of view. However all analysis methods
are related by a set of operational principles. They are
The information domain of the problem must be represented and understood.

The functions that the software is to perform must be defined.


The behavior of the software as a consequence of external events must be
defined.
The models that depict information, function and behavior must be partitioned
in a hierarchical or layered fashion.
The analysis process must move from essential information to Implementation
detail.

REQUIREMENTS SPECIFICATION

Specification Principles:

Software Requirements Specification plays an important role in creating quality software


solutions. Specification is basically a representation process. Requirements are represented in
a manner that ultimately leads to successful software implementation. Requirements may be
specified in a variety of ways. However there are some guidelines worth following: -

Representation format and content should be relevant to the problem

Information contained within the specification should be nested

Diagrams and other notational forms should be restricted in number and consistent in use.

Representations should be revisable.

Software Requirements Specifications:

The software requirements specification is produced at the culmination of the analysis task.
The function and performance allocated to the software as a part of system engineering are
refined by establishing a complete information description, a detailed functional and
behavioral description, and indication of performance requirements and design constraints,
appropriate validation criteria and other data pertinent to requirements
SYSTEM DESIGN:
The system design is divided in to two portions : student section and admin section.

1.Admin

He can delete any existing question in the database.


He can add any new question in the database.
He can also update the existing question set in the database.

2.Student

He can take the test on any subject of his choice.


He can change his answer any number of times in between the test.
He can view his performance report.
He can update his password or name any time.

Data Flow Diagram:

A data flow diagram (DFD) is a graphical representation of the "flow of data through an
information system, modeling its process aspects. Often they are a preliminary step used to
create an overview of the system which can later be elaborated. DFDs can also be used for
the visualization of data processing (structured design).
A DFD shows what kind of information will be input to and output from the system, where
the data will come from and go to, and where the data will be stored. It does not show
information about the timing of processes, or
Information about whether processes will operate in sequence or in parallel.

DFD LEVEL 1 (for admin)


DFD LEVEL 2 for Exam Process
USE CASE DIAGRAM
Use case diagrams are usually referred to as behavior diagrams used to describe a set of actions (use cases)
that some system or systems (subject) should or can perform in collaboration with one or more external
users of the system (actors). Each use case should provide some observable and valuable result to the actors or
other stakeholders of the system.

So in brief, the purposes of use case diagrams can be as follows:

Used to gather requirements of a system.

Identify external and internal factors influencing the system.

Show the interacting among the requirements are actors.

Level 0

Add question

login

View personal information

informat

Change password

admin

Update question

Delete question

Take test

student
View report

Register student
Entity Relationship Diagram

In software engineering, an entityrelationship model (ER model) is a data model for describing the
data or information aspects of a business domain or its process requirements. The main components of ER
models are entities (things) and the relationships that can exist among them.

An Entity-relationship model (ERM) is an abstract and conceptual representation of data. ER modeling


is a DB modeling method, used to produce a type of conceptual schema of a system. Diagrams created by this
process are called ER diagram
Project Features:

Login Page:

Student Page:

AdminS Page:
Test Page:
DATABASE DESIGN
DATABASE DESIGN

Database Tables: The total number of database tables that were identified to build the system is 7. The major
part of the database is categorized as

1. Transactional components: The Transactional components are useful in recording the transactions made
by the system. Consignment bookings, material particulars, dealership requests and feedbacks etc.

2. Data Dictionary components: These components are used to store the major information like branch
details, employee details, deliveries, dispatches and receivers details etc.

3. General components: These components are used to store the general information like login information
etc.

DATA DICTIONARY

The logical characteristics of current systems data stores, including name, description, aliases, contents, and
organization. Identifies processes where the data are used and where immediate access to information needed.
Serves as the basis for identifying database requirements during system design.

Uses of Data Dictionary:

To manage the detail in large systems

To communicate a common meaning for all system elements

To Document the features of the system


To facilitate analysis of the details in order to evaluate characteristics and determine where system
changes should be made.
To locate errors and omissions in the systems.

Database Tables:

Admin: hold the users loginid, password of administrators.

User: contains the loginid, name, password and year of students

My_sub : contains the subject name and code of all the subjects present in the database.

ques :contains the list of all the questions along with their possible options, correct answer and subject id.

Result: the result of each test is stored here for future reference.

solnuser: the question id , test id ,answer submitted by the user and the correct answer are stored
subjectinfo: the subject and the corresponding test id is stored here.
Data Dictionary:

Admin Table :

Field Name Data Type Size

Roll no Int 10

Login id Varchar 20

Password Varchar 20

My_sub Table :

Field Name Data Type Size

Sub id Int 1

Sub_name Varchar 20

Ques Table:

Field Name Data Type Size

Subid Int 1

Quesid Int 2

Ques Varchar 100

Choice1 varchar 100

Choice 2 varchar 100

Choice 3 varchar 100

Choice 4 varchar 100

Answer varchar 100

Result Table:
Field Name Data Type Size

Loginid name varchar 20

Test_id Int 2

Correct_answer Int 2

Subject varchar 20

Soln_user table

Field Name Data Type Size

Testid Int 2

Quesid Int 2

User_ans Varchar 100

Correct_ans Varchar 100

User table:

Field Name Data Type Size

Roll_no Int 7

Password Varchar 20

Firstname Varchar 20

Lastname Varchar 20

Year Int 1

Gender Varchar 10
Ques table:

My_sub table:

Soln_user table:

User table:
Future Scope of the Project:

Software scope describes the data and control to be processed, function performances, constraints,
interfaces and reliability. This application can be easily implemented. Reusability is possible as and
when required by the system. We can add new features whenever required. There is flexibility in all
the modules.

1. Reusability: reusability is possible whenever required. Both type of reusability is followed in


making this project: sharing of newly written code and use of previously written code.
2. Robustness: the application is robust. Even if one module fails, it will not lead to crasing of
the entire system.
3. Understandability: a method is understandable is someone other than the creator of the
method can understand the code( as well as the creator after a time lapse ). This is achieved
by decomposing a complete method into small blocks of code.
4. Portability: the application can be run in any windows system having JDK and SQL Server
installed.

References:

1. The Complete Reference Java By Herbert Schildit


2. www.javatpoint.com
3. www.stackoverflow.com
4. www.javaworld.com
5. www.programmersheaven.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy