Sei sulla pagina 1di 24

COLLEGE OF APPLIED SCIENCE

(Affiliated to Mahathma Gandhi University)

KATTAPPANA, IDUKKI, KERALA

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.

Project Guide Principal


ACKNOWLEDGEMENT

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

We here by declare that the project work entitled, “Cattering management


system” developed in College of Applied Sciences, Kattappana, is the result of
original work done by us under the supervision & guidance of Mr.Jehan
Shanth.K.K. This project report is submitted in partial fulfillment of the award of
the degree of Batchelor of Computer Science of College of Applied Sciences
Kattappana, managed by Institute of Human Resource Development (IHRD).

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

2.1. Study Phase 7

2.2. Design Phase 7

2.3. Development Phase 7

2.4. Operation Phase 7

3. Software Description 9

3.1. Introduction to Java 9

3.2. JDBC 13

3.3. Frame 16

3.4.Microsoft Access 17

4. Table Structure 18

5. Data Flow Diagram 19

6. Source Code 23

7. Output Forms 142

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

In this phase computer information system is constructed from the detailed


specification prepared in the design phase. The system development life cycle
phase in which system is constructed according to the design phase specification.
Implementation plan is a plan for implementing a system that includes test plans,
an equipment acquisition plan and conversion plan. Development phase report is
prepared at the end of this phase. Other activities are system specification, user
acceptance review, and conversion, implementation and change over.

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 a general-purpose object-oriented programming language developed


by Sun Microsystems of USA in 1991.Originally called Oak by James Gosling,
one of the inventors of the language; java was designed for the development of
software for consumer electronic devices.

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

Java is built with a network communications in mind. It has comprehensive library of


routines for dealing with network protocols such as TCP/IP, FTP and HTTP.

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

Fundamentally, distributed computing environments must be dynamic. Java was


designed to adapt in a constantly evolving environments. It is a capable of
incorporating new functionality regardless of where that functionality comes from
the local computer system, the local and wide area network, and the internet are all
potential contributors. In object oriented C++ environments developers don’t write
every line of code themselves. Instead they rely on wide arrays of class libraries to
extend the functionality of these programs .If a developer needs to add support for
a particular feature, such as ability to play moving videos, he/she simply links in
new class libraries that can handle the jobs.

Contrast these limitations of C++ with java, which is capable of dynamically


linking new class libraries, methods and instants variables in runtime, without fear
of breaking our system. Java can also determine the type of class at runtime
through the query making it possible to either dynamically link in new class or abort
the mission altogether depending on the result of such queries. These capabilities
give java programs a level of flexibility when executing not possible with most other
programming languages.

THE THREE OOP PRINCIPLES

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:

Polymorphism is a feature that allows one interface to be used for general


class of actions. The specific action is determined by the exact nature of the
situations. Consider a task; you might have a program that requires three topics of
stacks. One stack is used for integer values, one for floating-point values and one
for characters. Most generally the concept of polymorphism is often expressed by
the phrase “one interface, multiple methods”. This means that it is possible to
design a generic interface to a group of related activities. This helps to reduce the
complexity by allowing the same interface to be used to specify a general class of
action. It is the compilers job to select the specification as applied to each situation.

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.

JDBC API defines how an application opens a connection, communicates with


a database, executes SQL statements, and retrieves query results. JDBC is based on
the X/OPEN Call Level interface (CLI) for SQL.

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 DRIVER TYPES

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:

1. The JDBC-ODBC Bridge plus ODBC driver

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.

2. Native-API partly-Java Driver

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.

3. JDBC-net pure Java Driver

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.

4. Native-Protocol Pure Java Drivers

This driver converts JDBC calls to network protocol used by DBMSs directly.
Requests from client machines are made directly to DBMS server.

STEPS FOR USING JDBC

There are seven basic steps for using JDBC to access a database. They are:

1) Import the java.sql package


2) Register the driver
3) Connect to the database
4) Create a statement
5) Execute a statement
6) Retrieve the results
7) Close the statement and connection
Import the java.sql Package

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.*;

Register the driver


To register the driver we make use of the method registerDriver() whose
syntax is as follows:

DriverManager.registerDriver(Driver dr);

Where dr is the new JDBC driver to be registered with the DriverManager.

Connect to the database

The getConnection() method is used to establish the connection. The


syntax is given below

DriverManager.getConnection(String url,String user,String passwd);

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

A statement can be created by using createStatement() Method.

The syntax of this method is given below:

cn.createStatement();

where cn is a connection object. This method creats and returns a Statement


object for sending SQL Statements to the database.

Execute Statement

We have three methods to execute the statements. They are execute(),


executeQuery(), and executeUpdate(). The syntax of each of these is given below.

stmt.execute(String str);

where stmt is a Statement object and str is an SQL Statement..This method


returns a Boolean value and is used to execute any SQL Statement.

stmt.executeQuery(String str);

where stmt is a PreparedStatement object and str is the query to be


executed. This method returns a single ResultSet.
Stmt.executeUpdate(String str);

Where stmt is a Statement object and str is a SQL INSERT,UPDATE or DELETE


statement or a SQL statement that returns nothing.This method executes the
strand returns either the row count for INSERT, UPDATE or DELETE or 0 for SQL
statement that returns nothing.

Retrieve The Result

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.

Close the Statement and Connection

The close() method is used to close the Statement and Connection. The
syntax is given below.

stmt.close();

where stmt is the Statement to be closed.

cn.close();

where cn is the connection to be closed.

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.

Frame Methods are follows:

showFrame();

This method is ussd to show a frame.

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.

Creating a Frame object using the statement

F=new Frame(“”);

By using add() method the controls are added to the 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.

Essentially, Access is a Database Management System (DBMS). Like


other product in this category access stores and retrieve data presents information
other automates respective tasks. By using access it is easy to develop the input
forms.

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.

Potrebbero piacerti anche