Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CERTIFICATE
This is to certify that this project report is a bonafied record of the project work done by
Ajomon kuriakose, Binumon muralidharan, Anish k.s, fifth semester BSc Computer Science,
College of Applied Science, Kattappana(Managed by I.H.R.D) for the fulfillment of the
requirements for the awards to the BSc Computer Science under Mahathma Gandhi University,
Kottayam.
First of all we would like to thank almighty GOD for his mercy and love for keeping us
in good health and sound mind to complete the project successfully.
We are grateful to our Principal Mrs. Suneetha.S who is a constant source of inspiration
and whose guidance helped us to complete this project successfully.
We consider this as an opportunity to express our deep respect and sincere thanks to our
internal guide Mr. Jehan Shanth.K.K the Lecture of the Department of Computer Science, and
Mrs. Dhanniya.P.J the Lecture of the Department of Computer Science, for giving us necessary
help and suggestions in time during our project work.
We sincerely thank all the Lectures of the Department of Computer Science, College of
Applied Science (CAS), Kattappana, for providing an opportunity to do the project successfully,
their valuable suggestions and encouragement. We also express our humble gratitude to all our
friends, our family members and all others who helped us in all aspects without whose help,
timely encouragement and sincere assistance the project would not have been a success.
Ajomon
kuriakose
Anish k.s
Binum
on muralidharan
DECLARATION
Ajomon Kuriakose
Anish k.s
Binumon
Muralidharan
Place: Kattappana
Date:
ABSTRACT
The project entitled “Campus Voting System” is an application program developed
using Java (J.F.C) that provide as the powerful front-end tool and Microsoft Access as the back-
end tool.
It is used for the campus election. The merits of introducing the Campus Voting System
include the reduction of preparation cost of ballots, cost for vote counting, reduction of the risk
of ballot theft and shortening of vote counting time. The electronic voting system is also
effective for prevention of election obstruction.
The project consists of following modules:
1. Insert:
Process of inserting details of voters.
2. Update:
Updating means modifying the existing data.
3. Delete:
It is the removal of data.
4. Count:
It is the process of counting votes gained by a candidate
5. Registration:
This process compares the data in the database and data in registration form. If
comparison is success then it represent on database.
6. Vote:
In this process the users vote for the candidate.
There are two types of users in this application, that is Administrator and Normal users.
Because the Normal users never perform Administrator’s tasks like insertion, updating, deletion,
and count. The Administrator can login into Administrator’s window by entering the username
and password. The administrator can access all information about the candidates and voters and
he can count the number of votes gained by a candidate. The Normal user can login by using
another username and password. Normal user can perform registration and voting.
CONTENTS
1. Introduction 6
2. System Study 7
3. Software Description 9
3.2. JDBC 13
3.3. Frame 16
3.4.Microsoft Access 17
4. Table Structure 18
6. Source Code 23
8. Conclusion 151
9. Bibilography 152
INTODUCTION
The Campus Voting System is developed for digitizing the campus election
process. The tasks of the system include processing of voter’s list, processing of
candidate list, processing of votes and the generation of results. The Campus Voting
System is developed in such a way that the Campus Election Procedures are
automated in a minimum requirement. The system is developed using Java as front-
end and Microsoft Access 2007 as back- end.
Our system provides easy and efficient operational environment for the
proper functioning of College Election. The new system reduces the work of the user
by a huge margin, only a mouse operation will finish the work.
By using the system we can achieve more reliability, reduce the cost of
ballot, increasing the speed of counting and reduce the chances of ballot theft.
SYSTEM STUDY
STUDY PHASE
The study phase is the first of the four phases in the systems development
life cycle. Study phase is the life cycle phase in it a problem is defined and a system
is recommended as a solution. Information service request identifies the perceived
problem and the scope of the study to be undertaken. Initial investigation is an
investigation performed to clarify the business information system problem and a
project directive. Project directive is the final version of an information request.
System performance definitions are the transition from a logical performance
requirement to a physical one. Feasibility analysis is a procedure for identifying
candidate systems and selecting the most feasible. Study phase report is a
comprehensive report prepared at the conclusion of the study phase activities.
DESIGN PHASE
Design phase is the second phase in the system development life cycle. In
this phase computer information system is designed in detailed from system
specifications generated during study phase. A data flow diagram that has been
expanded in detail until each of the processing unit can identified. A system
flowchart that has expanded in detail. At the end of the design phase, design phase
report is prepared. Design specification is a baseline specification that act as a blue
print for the construction of a computer based business information system. Design
phase review is held with user organization at the conclusion of the design phase.
DEVELOPMENT PHASE
OPERATION PHASE
It is the fourth and last phase of the system development life cycle phase. It
involves change over from old system to the new one, where the system is
operated, evaluated changed as necessary. Main activities are system change over,
routine operation, standards, response time and usability.
SOFTWARE DESCRIPTION
JAVA
Java is the first programming language that is not tied to any particular
hardware or operating system. Java can be used to create two types of programs.
Application programs and Applets. Application programs are programs run on our
computer under the operating system of the computer. Java applets are programs
can be transmitted over the internet and executed by java compactable web
browsers.
JAVA BUFFWORDS
• Simple
• Distributed
• Interpreted
• Robust
• Secure
• Portable
• High Performance
• Dynamic
• Multithreaded
SIMPLE
Java is simpler to learn than any other language like C++, because java developers
intentionally removed much of the difficulties programmers uncounted with earlier
programming languages. Indeed, java was build to be easier to learn and use than
C++. However, the C++ features that java are not used as one might think, and
often they lead to overly complexity, the java term introduced garbage collection to
further simply the language.
OBJECT ORIENTED
Like C++, java is an object-oriented language. All program code and data reside
within objects and classes, arranged in packages that we can use in our programs
by inheritance. The object model in java is simple and easy to extend.
DISTRIBUTED
As a result, java application can open and access objects across the internet with
same ease that programmers normally truly distributed computing. Accepts while
accessing a local file system. So java comes with everything needed for truly
distributed computing.
INTERPRETERED
Java languages are interpreted. In other works, an interpreter must be available for
each hardware architecture or operating system on it we are running java location
brethren. Through the innovative use of its Virtual Machine, java overcomes many
speed issues that bog down other interpreted languages. Java code actually goes
through a compile process that output what is known as a java byte code. Java byte
code is machine in depended, confirming to the java Virtual Machines specifications
and we can it to the system that supports the java environments.
ROBUST
A robust program is one that does not fail java contains features that make the task
of writing robust software easier. The designers did this by first omitting features
that are known to cause errors. Then they added features that allow the developer
to discover the errors early, rather than after the product collection and exception
handling.
SECURE
Any time network access happens, security concern becomes a very big issue.
Threat of viruses and abuse of resources via everywhere. Java systems not only
verify all memory access but also ensure that no viruses are communicated with the
applet. The absence of pointers in java ensures that programs cannot gain access to
memory locations proper authorization.
PORTABLE
Java system is highly portable. One part of the portability equation is java’s
representation of data types. Being implementation dependent, although being
highly portable hampers C and C++. That is the size of the primitive data type and
behavior are consisting from system to system.
HIGH PERFORMANCE
Java performance is impressive for an interpreted language, mainly due to the use
of the intermediate byte code. According to Sun, java speed is comparable to the
native C/C++. Java architecture is also designed to reduce overheads during
runtime. Further, the in corporation of multithreading enhances the overall
execution sped of java programs.
MULTIHEREADED
Multithreading is a major feature of java, giving executables the ability to maintain
several threads of execution at one time. Multithreading permits applications to
juggle several tasks at once. For instance, in a non-threaded environment only line
of execution exits for programs. Typically, an event lop is used to keep track of the
particular task at hand. That loop identifies which task is to be executed and passes
it to of to the appropriate routine(s). Once the task is handled, another can begin.
Because only one task at a time can be handled the system must wait until the
current task has been completed before handling a new one. You can assign each
line of execution to a thread and synchronize that thread with other threads as
needed. They can dramatically improve interaction with users, handling multiple
requests at once. With threads real time response times are possible.
DYNAMIC
1. ENCAPSULATION:
Encapsulation is the mechanism that binds together code and the data it
manipulates and keeps both safe from outsides interface and misuses. One way to
think about the encapsulation is as a protective wrapper that prevents the code and
data from being arbitrarily accessed by other code defined outside the wrapper.
Access to the code and data inside the wrapper is tightly controlled by the interface.
To relate this to the real world, consider the automatic transmission about the
engine such as how much you are accelerating the pitch of the surface you are on,
and the position of the shift lever.
In java the basis of encapsulation is the class. A class defines the structure
and behavior that will be shared by set of objects. Each object of the class contains
structure and behavior defined by the class, as if it where stamped out by a mold
and in then shape of the class. For this reason objects are sometimes referred to as
instance of the class. Thus, a class is a logical construct, an object has physical
reality. Since the purpose of a class is to encapsulate complexity, there are
mechanisms for hiding the complexity of the implementation of the class. Each
method or variable in a class may be marked private or public.
2. INHERITANCE:
Inheritance is the process by which one object acquires the properties of another
object. This is important because it supports the concept of the hierarchical
classification. Inheritance interacts with the encapsulation as well. If a given class
encapsulates some attributes plus any that adds as parts of its specialization. This
is key concept it lets object-oriented programs grow in a complexity linearly rather
than geometrically. A new subclass inherits all of its attributes of all its ancestors.
3. POLYMORPHISM:
JDBC
INTODUCTION TO JDBC
JDBC stands for Java Database Connectivity. It is a set of Java APIs used for
executing SQL statements. This API consists of a set of classes and interfaces to
enable programmers to write pure Java Database applications.
Call Level Interface is a library of function calls that support SQL statements.
CLI requires neither host variable nor other embedded SQL concepts that would
make it less flexible from a programmer’s perspective. It is still possible, however,
maintain and use specific functions of a database management system when
accessing the database through a CLI.
The goal of creating JDBC is to create an interface that keeps simple tasks
simple, while ensuring the more difficult and uncommon tasks are at least made
possible. The following are the characteristics of JDBC:
• It is a call-level SQL interface for Java
• It does not restrict the type of queries passed to an underlying DBMS driver
• JDBC mechanisms are simple to understand and use
• It provides a Java Interface that stays consistent with the rest of the Java
system
• JDBC may be implemented on the top of common SQL level APIs
• It uses strong, static typing whenever possible
JDBC contains three components: Application, Driver Manager and Driver. The
user application invokes JDBC methods to send SQL statements to the database and
retrieves results. JDBC driver manager is used to connect Java applications to the
correct JDBC driver. JDBC driver test suite is used to ensure that the installed JDBC
driver is JDBC Compliant. There are four different types of JDBC drivers. They are as
follows:
The JDBC-ODBC Bridge plus ODBC driver is a JavaSoft Bridge product that
provides JDBC access via ODBC drivers. But combining ODBC brings in a lot of
drawbacks and limitations. Since the ODBC driver has to be installed on each client
machine, it is not advisable to choose this type of driver for large networks.
Native-API partly-Java driver converts JDBC calls into calls on the client API for
Oracle, Sybase, Informix or other DBMS. But some binary code has to be loaded
on all clients like the bridge driver and hence it is not suitable for large networks.
JDBC-Net Pure Java Driver translates JDBC calls into DBMS independent net
protocol. A server again translates this protocol to a DBMS protocol. The net server
middleware connections its pure Java clients to many different databases.
This driver converts JDBC calls to network protocol used by DBMSs directly.
Requests from client machines are made directly to DBMS server.
There are seven basic steps for using JDBC to access a database. They are:
Any application using JDBC API must import the java.sql package in its code.
Thus, the first line of the application should be
import java.sql.*;
DriverManager.registerDriver(Driver dr);
Where the url is the database url, user is the database user and passwd is the
password tobe supplied to get connected to the database.
Create a statement
cn.createStatement();
Execute Statement
stmt.execute(String str);
stmt.executeQuery(String str);
The result of the SQL Statement are stored in a ResultSet object. To retrieve
the data from the ResultSet, we need to use the getXXX methods. These methods
retrieve the data and convert it to the Java data type. There is a separate getXXX
Method for each data type. For example, getString() is used to retrieve a string
value and getDate() is used to retrieve a date value. The getXXX methods take one
argument, which is the index of the column in the ResultSet and return the value of
the column. To move to the next row in the ResultSet we make use of the
ResultSet.next() method.
The close() method is used to close the Statement and Connection. The
syntax is given below.
stmt.close();
cn.close();
FRAMES
A frame is a window with a title bar and a boarder. Fraems are created with
the class Frame that extends class window that inherits from Container. Class
window contains methods for window management. Window object do not have title
bars and boarders. The default layout manager for window and frame is
BoarderLayout.
Frame is typically used to build windowed application. Frames are
occationally used with applets.
showFrame();
F.hide();
F.dispose();
Component method hide remove the frame from the screen so the frame is
no longer visible. Frame method dispose free the resource that were allocated to
the Frame by the windowing system.
F=new Frame(“”);
fF.show();
Component method show displays a component. Frames are not visible by default.
MICROSOFT ACCESS
Before being to use this software product, it is important to understand its
capabilities and the type of task it is design to perform. Access is a multifaceted
product whose use bounded only by your imagination.
Access is also powerful windows application. Both windows and Access are
from Microsoft, the two products work very well together. Access run on the
windows platform so all the advantages of the windows is available in access.
Even so, Access is more than just a database manager. As a relational
manager, it gives to access to all type data, and gives you the use of more than one
database at a time. It can reduce the complexity of the data and make it easier to
get your job done. You can link an access table with the mainframe or server data
or use a table created in paradox or dbase. Access is a set of the tools for the end
manager and report writer.