You are on page 1of 76

INTRODUCTION

1.1MOTIVATION:Online national polling system is a web based system. We developed a website for this and through which user of this system can register and they can vote during the elections in their territory. The people who are having a voter ID card can also register in this system, they will use their voter id as user name and a separate password will be used for secure authentication. The people who are newly applying for voter id can get voter ID card easily. The candidates who are participating in elections as leaders can send their nomination through this system. This system will reduces the burden of the EC and counting will be simplified. The EC validate the registration of that user. Once registered when ever polling is done in any area that areas people can vote through this system and their name will be deleted from the manual list of that area. ECO is a trusted entity for this system. He will manage the peoples information.

1.2 PROBLEM DEFINITION:1) Its a manual operation takes more time.


2) The voter has to wait for a long time at Voting Booth

3) Since manual work involves many employees they may not be coordinated properly 4) Regging is more.

1.3 OBJECTIVE OF PROJECT:This is web based project, in which will design a website for the general people, candidates, election commission officers and field officers. The main purpose of this project is to improve percentage of voting. There have been many reasons to develop this system. In rural areas the influential people keep their men at the polling booths to threaten the common men to vote for them. There are many portions of the country like the north east where there is locally sponsored terrorism, at such places the security conditions are also not very bright, so naturally people feel afraid to come out of their houses and go to vote. Net savvy told that, new generation want hassle free voting system. Also people in metros want a system through which they can vote for their territory without traveling.

Keeping in mind these situations and to improve the state of democracy in the country Online Polling System can be thought as a solution , in conjunction with ongoing current manual system.

Users of the sysytem:


1. 2.
3.

General public Candidates ECO (admin)

1.4 LIMITATIONS OF PROJECT:1.This system is only for educated people. 2.We are especially concentrating on the metro people. 3.Password should be kept secretly.

1.5 ORGANIZATION OF PROJECT:The organization of the project to be made simple it is been divided into 4 phases/chapters. In the first part that is the Introduction part I have described what exactly is the project based on and what are the problems in the existing system and what are the objectives of the project and limitations of the project. In the second phase I have described about the literature survey what is existing system and what the drawbacks are in the existing system and Feasibility study which I have done in the project and to overcome the drawbacks what are is the new proposed system and features of the project. In the third phase I have dealt with the analysis part and also I have specified the requirements section what are the user requirements needed some of the Functional and also some Non functional requirements and also some software and hardware requirements even some of the Context diagrams also have been included and also many requirements have been specified in this phase..Coming to the next phase that is the design phase I included how are the database tables designed and organized what are the attributes included in the tables also some of the uml diagrams such as the Class, sequence, Collaboration diagrams and also activity diagrams and I have also mentioned about the Modules involved in this project how it is designed and organized The Fifth phase that is the Implementation phase explains how is the project has been developed and implemented and what technology has been included I also have explained about Java technology and the basic main featured about java and the aspects related to the project the Output Screens are also put up in the project 2

which is specially designed for a cool look and modern approach all the screens are mentioned in a neat and step by step manner. Coming to the next phase that is the Testing and validation phase I have included the testing methodologies and how are the test cases designed. Finally the conclusion and the Future enhancement had also been explained.

LITARATURE SURVEY
2.1 INTRODUCTION: Election Commission:-

Elections in India are conducted by the Election Commission of India, the authority created under the Constitution. It is a well established convention that once the election process commences; no courts intervene until the results are declared by the election commission. During the elections, vast powers are assigned to the election commission to the extent that it can function as a civil court, if needed.

Electoral Process:Electoral Process in India takes at least a month for state assembly elections with the duration increasing further for the General Elections. Publishing of electoral rolls is a key process that happens before the elections and is vital for the conduct of elections in India. The Indian Constitution sets the eligibility of an individual for voting. Any person who is a citizen of India and above 18 years of age is eligible to enroll as a voter in the electoral rolls. It is the responsibility of the eligible voters to enroll their names. Normally, voter registrations are allowed latest one week prior to the last date for nomination of candidates. At first before the elections the dates of nomination, polling and counting takes place.The model code of conduct comes in force from the day the dates are announced. . No party is allowed to use the government resources for campaigning. The code of conduct stipulates that campaigning be stopped 48 hours prior to polling day. For Indian states a pre-election is a must. Campaigning ends the day before the voting day. Government schools and colleges are chosen as polling stations. The Collector of each district is in charge of polling. Government servants are employed to many of the polling stations. Electronic Voting Machines (EVMs) are being increasingly used instead of ballot boxes to prevent election fraud via booth capturing, which is heavily prevalent in certain parts of India. An indelible ink manufactured by the Mysore Paints and Varnish Limited is applied usually on the left index finger of the voter as an indicator that the voter has cast his vote. This practice has been followed since the 1962 general elections to prevent bogus voting. After the Election Day, the EVMs are stored in a strong room under heavy security. After the different phases of the elections are complete, a day is set to count the votes. The votes are tallied typically, the verdict is known within hours. The candidate who has mustered the most votes is declared the winner of the constituency. 4

The party or coalition that has won the most seats is invited by the President to form the new government. The coalition or party must prove its majority in the floor of the house (Lok Sabha) in a vote of confidence by obtaining a simple majority (minimum 50%) of the votes in the house.

Voter Registration:For few cities in India, the voter registration forms can be generated online and submitted to the nearest electoral office. Some of the socially relevant websites like [www.jaagore.com] is good place to gather information on voter registration.

2.2 EXISTING SYSTEM :Electronic Voting Machines ("EVM") are being used in Indian General and State Elections to implement electronic voting in part from 1999 elections and in total since 2002 elections. The EVMs reduce the time in both casting a vote and declaring the results compared to the old paper ballot system.

The EVMs were devised and designed by Election Commission of India in collaboration with two Public Sector undertakings viz., Bharat Electronics Limited, Bangalore and Electronics Corporation of India Limited, Hyderabad. The EVMs are now manufactured by the above two undertakings. EVMs were first used in 1982 in the by-election to Parur Assembly Constituency of Kerala for a limited number of polling stations (50 polling stations). Indian voting machines use a two-piece system with a balloting unit presenting the voter with a button (momentary switch) for each choice connected by a cable to an electronic ballot box. An EVM consists of two units: Control Unit Balloting Unit The two units are joined by a five-meter cable. The Control Unit is with the Presiding Officer or a Polling Officer and the Balloting Unit is placed inside the voting compartment. Instead of issuing a ballot paper, the Polling Officer in-charge of the Control Unit will press the Ballot Button. This will enable the

voter to cast his vote by pressing the blue button on the Balloting Unit against the candidate and symbol of his choice. The microchip used in EVMs is manufactured in Japan and it is sealed at the time of import. It cannot be opened and any attempt to rewrite the program cannot be done without damaging the chip. Voting machines are the total combination of mechanical, electromechanical, or electronic equipment (including software, firmware, and documentation required to program control, and support equipment), that is used to define ballots; to cast and count votes; to report or display election results; and to maintain and produce any audit trail information. The first voting machines were mechanical but it is increasingly more common to use electronic voting machines.

2.3 DISADVANTAGES OF EXISTING SYSTEM:Benefits of EVMs:The cost per EVM (One Control Unit, one Balloting Unit and one battery) was Rs.5,500/- at the time the machines were purchased in 1989-90. Even though the initial investment was somewhat heavy, it was more than neutralized by the savings in the matter of production and printing of ballot papers in lakhs, their transportation, storage etc., and the substantial reduction in the counting staff and the remuneration paid to them. It will be easier to transport the EVMs compared to ballot boxes as EVMs are lighter, portable and come with polypropylene carrying cases.The vote-counting is very fast and the result can be declared within 2 to 3 hours as compared to 3040 hours, on an average, under the ballot-paper system. In countries like India, where illiteracy is still a factor, illiterate people find EVMs easier than ballot paper system, where one has to put the voting stamp on the symbol of the candidate of his/her choice, fold it first vertically and then horizontally, and put it into the ballot box. In EVMs, the voter has to simply press the blue button against the candidate and symbol of his choice and the vote is recorded. Bogus voting can be greatly reduced by the use of EVMs. In case of ballot paper system, a bogus voter can stuff thousands of bogus ballot papers inside the ballot box. But, an EVM is programmed to record only five votes in a minute. This will frustrate the bogus voters. Further, the maximum number of votes that can be cast in a single EVM is 3840. If an EVM goes out-of-order then, the Election Officer, in-charge of the polling booth, can replace the defunct EVM with a spare EVM. The votes recorded until the stage when the EVM went out of order remain safe in the memory of the Control Unit and it is not necessary to start the poll from the beginning. The Control Unit can store the result in its memory for 10 years and even more. The battery is required only to activate the EVMs at the time of polling and counting. As soon as the polling is over, the battery can be switched off and this will be required to be switched on only at the time of counting. The battery can be removed as soon 6

as the result is taken and can be kept separately. Therefore, there is no question of battery leaking or otherwise damaging EVMs. Even when the battery is removed the memory in the microchip remains intact. If the Court orders a recount, the Control Unit can be reactivated by fixing the battery and it will display the result stored in the memory. Invalid votes can be avoided by use of EVMs. When ballot system was used in India, the number of invalid votes was more than the winning margin between the candidates in every general election. With EVMs, there are no invalid votes.Since EVMs work on a 6-volt battery, there is absolutely no risk of any voter getting an electric shock. Usage of an EVM:If the number of candidates is less than the maximum capacity of before use Before the commencement of the polling process, the Presiding Officer demonstrates to the polling agents present that there are no hidden votes already recorded in the machine by pressing the 'Result' button. Then he or she conducts a mock poll by asking the polling agents to record their votes and presses the result button to satisfy them that the result shown is strictly according to the choice recorded by them. Finally the clear button is pressed to clear the result of the mock poll and the unit is sealed before sending it to the respective polling booths. (Not sure about this part: is this testing/sealing done at a Central/State level or at a Polling Booth level?) Each Control Unit has a unique ID Number, which is painted on each unit with a permanent marker. This ID Number will be allowed to be noted by the Polling Agents and will also be recorded in a Register maintained for the purpose by the Returning Officer. The address tag attached to the Control Unit also will indicate this ID Number. This is to avoid replacement of a genuine EVM by another one. As soon as the voter presses the 'blue button' against the candidate and symbol of his choice, a tiny lamp on the left side of the symbol glows red and simultaneously a long beep sound is heard. Thus, there are both audio and visual indications for the voter to be assured that his vote has been recorded. As soon as the last voter has voted, the Polling Officer in-charge of the Control Unit will press the 'Close' Button. Thereafter, the EVM will not accept any votes. Further, after the close of poll, the Balloting Unit is disconnected from the Control Unit and kept separately. Votes can be recorded only through the Balloting Unit. Again the Presiding officer, at the close of the poll, will hand over to each polling agent present an account of votes recorded. At the time of counting of votes, the total will be tallied with this account and if there is any discrepancy, this will be pointed out by the Counting Agents. During the counting of votes, the results are displayed by pressing the 'Result' button. There are two safeguards to prevent the 'Result' button from being pressed before the counting of votes officially begins. (a) This button cannot be pressed till the 'Close' button is pressed by the Polling Officer in-charge at the end of the voting process 7 the EVM, the extra panels are masked

in the polling booth. (b) This button is hidden and sealed; this can be broken only at the counting center in the presence of designated officials.

Limitations of Electrol Voting:A candidate can know how many people from a polling station voted for him. For example, in Indian general elections, 2004; the day after the election results were declared, The Times of India, Mumbai carried statistics about which areas in Mumbai voted for which candidate. People from Kandivali gave more votes to Govinda, while people from Borivali polled more votes for his opponent Ram Naik. This is a significant issue particularly if lop-sided votes for/against a candidate are cast in individual polling stations. The Election Commission of India has stated that the manufacturers of the EVMs have developed a 'Totaliser' unit which can connect several Balloting Units and would display only the overall results from an Assembly or a LokSabha constituency instead of votes from individual polling stations. The control units do not electronically transmit their results back the Election Commission, even though a simple and unconditionally secure protocol for doing this exists. The Indian EVMs are purposely designed as stand-alone units to prevent any intrusion during electronic transmission of results. Instead, the EVMs are collected in counting booths and tallied on the assigned counting day(s) in the presence of polling agents of the candidates. There are many portions of the country like the north east where there is locally sponsored terrorism, at such places the security conditions are also not very bright, so naturally people feel afraid to come out of their houses and go to vote.People have go for their voting booths, have end more time to vote.

2.4 PROPOSED SYSTEM:This is web based project, in which will design a website for the general people, candidates, election commission officers and field officers. The main purpose of this project is to improve percentage of voting. There have been many reasons to develop this system. In rural areas the influential people keep their men at the polling booths to threaten the common men to vote for them. There are many portions of the country like the north east where there is locally sponsored terrorism, at such places the security conditions are also not very bright, so naturally people feel afraid to come out of their houses and go to vote. Net savvy told that, new generation want hassle free voting system. Also people in metros want a system through which they can vote for their territory without traveling. Keeping in mind these situations and to improve the state of democracy in the country Online Polling System

can be thought as a solution , in conjunction with ongoing current manual system. Benifits:8

Percentage of voting done in different areas, regions, the overall voting percentage will be calculated easily. Graphical representations of the reports are generated. The burden for election commission is reduced. New vote can easily get voter id using this system. Terrorism problems, rigging problems can be reduced by using this system. The metro people and new generation are dont want waste their time for voting, they are not interest to stand much time at the polling booth. They look for new system by which they can vote form their home. This system will improve the voting percentage.

Process of voting:The candidate will send their nominations through this system. Election commission will receive the nomination and verifies them, and then they will give permission to participate in the election. The general people will register their name through this system and field officers will verify their applications and repot it to election commission. The election commission issues vote for him when ever polling is done in his area. The votes will be stored in the database. One person can vote only time during a election. Once he had registered in this system, he can vote for all elections through this system and he have to use this system only for voting. After completing of the election this system will total votes polled through online they can be easily add to manual voting results. For designing this system we are using xml and java sever pages. For providing authentication we are using digital signatures. We are employing the encryption and decryption technology for security. When ever a user trying to insert some information into database that will be encrypted by a encryption program and stored in the database and while retrieving the information the data will be decrypted.

SYSTEM STUDY:FEASIBILITY STUDY:The feasibility of the project is analyzed in this phase and business proposal is put forth with a very general plan for the project and some cost estimates. During system analysis the feasibility study of the proposed system is to be carried out. This is to ensure that the proposed system is not a burden to the company. For feasibility analysis, some understanding of the major requirements for the system is essential. Three key considerations involved in the feasibility analysis are ECONOMICAL FEASIBILITY 9

TECHNICAL FEASIBILITY SOCIAL FEASIBILITY

ECONOMICAL FEASIBILITY:This study is carried out to check the economic impact that the system will have on the organization. The amount of fund that the company can pour into the research and development of the system is limited. The expenditures must be justified. Thus the developed system as well within the budget and this was achieved because most of the technologies used are freely available. Only the customized products had to be purchased. TECHNICAL FEASIBILITY:This study is carried out to check the technical feasibility, that is, the technical requirements of the system. Any system developed must not have a high demand on the available technical resources. This will lead to high demands on the available technical resources. This will lead to high demands being placed on the client. The developed system must have a modest requirement, as only minimal or null changes are required for implementing this system.

SOCIAL FEASIBILITY:The aspect of study is to check the level of acceptance of the system by the user. This includes the process of training the user to use the system efficiently. The user must not feel threatened by the system, instead must accept it as a necessity. The level of acceptance by the users solely depends on the methods that are employed to educate the user about the system and to make him familiar with it. His level of confidence must be raised so that he is also able to make some constructive criticism, which is welcomed, as he is the final user of the system.

3. ANALYSIS
3.1 INTRODUCTION:10

Analysis is the detailed study of the various operations performed by a system and their relationships within and outside of the system. A key question is: What must be done to solve the problem? One aspect of analysis is defining the boundaries of the system and determining whether or not candidate system should consider other related systems. During analysis, data are collected on the available files, decision points, and transactions handled by the present system. Its a manual operation and takes more time. The voters has to wait for a long time at voting area and

also decision making requires more time for employees..Since manual work involves many employees they may not be coordinated properly any request from the voter/Employee for enquires and complaints may take more time. This is the flow of work they are implementing. Now they are expecting a web-based application, which allows them to receive the new applications, complaints and enquiry details etc.

3.2 REQUIREMENT SPECIFICATION:3.2.1 Functional Requirements:Online registration for the voter ID card which will be verified by the field officer and after receiving the field officers report only the registration will be valid and voter ID will be used. Those already having a voter ID card can register for the online voting system, they will use their voter ID as their user name and a separate password will be used for secure authentication. The Election commission can be use this system to let the candidates register for their nomination on site and their officers will validate it. Once registered when ever polling is done in any area that areas people can vote for their favorite candidates. We have devised a mechanism that ensures duplicates voting is not happening. After ending of the polling voting system will display the results in graphical bar fro each territory.

3.2 NON FUNCTIONAL REQUIREMENTS:

Hardware Requirements:11

Minimum Intel P4 processor. Minimum 512 MB RAM. Minimum 500MB free working Space. Internet connection.

Software Requirements:

Front end Back end Web Server : Other :

: :

Java ORACLE Tomcat HTML, JavaScript, etc.

4. DESIGN
4.1 INTRODUCTION:Design is an important step in the development of large scale solutions. Design provides us with a blue print to develop any object.

12

Once the software requirements have been analyzed and specified the software design can be modeled with some sort of notations such as DFDs, UML notations to describe the proposed solution to the Problem. These Notations allows us to understand complex ideas clearly and serves as blue print for the proposed solution. These notations also reduce the complexity associated with problem solving by converting problem in to a Graphical Views. The design activities are of main importance in this phase, because in this activity, decisions ultimately affecting the success of the software implementation and its ease of maintenance are made. These decisions have the final bearing upon reliability and maintainability of the system. Design is the only way to accurately translate the customers requirements into finished software or a system.
Design is the place where quality is fostered in development. Software design is a process through which requirements are translated into a representation of software. Software design generally involves two steps. 1. Preliminary design 2. Detailed design The Preliminary design is used to translate the problem specifications in to a graphical system representation.The Detailed design is concerned with breaking the whole solution into no. of modules. This division of a big problem into no. of modules reduces problem solving complexity.

So at preliminary design level we may use notations of UML to describe an Object Oriented Problem, where as to describe conventional problems we will use data flow diagram. As we know that a flow chart or a data flow diagram cant describe the complete behavior of an OO program we are using the notations of UML to describe Bottom up based paradigms.

4.2 UML DIAGRAMS:-

4.2.1 CLASS DIAGRAM:-

13

Register(); Region ECO Vote() : char Name : Public getResult() UnameVote Candidate char : num ID : : char Candidname: char Register() VID char Password : char Region: char Password: char

4.2.2 USECASE DIAGRAM:-

14

4.2.3 SEQUENCE DIAGRAM:15

16

4.2.4 ACTIVITY DIAGRAM:-

Public

Candidate

Register

vote

ECO

Result

4.3 ER DIAGRAM:-

17

voted Candidate reg Public passw Addr addr Gen passw Cna pna cna pho regi stat Pho can VI RI registration ord ess der ord me ne on us id D

4.4 DATA FLOW DIAGRAMS:DFD OF REGISTRATION PROCESS:-

18

Candidates Registers Public ECO

DFD FOR VOTING PROCESS:-

19

Logout Votes Select Login Public candid

ECO DFD:-

20

Log results Get Log in ECO out

4.5 MODULE DESIGN AND ORGANIZATION:This project is divided into four modules. They are... 1. 2. Public registration phase. Candidate nomination phase. 21

3. 4.

Voting phase. Results.

Public registration Phase:


In this phase general public will register their names in this system. The people who are having voter id, they can register with that id. For other an voter id will be generated. They can use their password and voter id to register in to this system. For authentication purpose we are using password. password will provide user authentication. The password field will be linked with DES algorithm and on clicking submit button the password will be encrypted and stored in the database. While retrieving that encrypted password will be decrypted. So that user will be secured.

Candidate registration phase:


He has to specify his party name and territory name. He has to must and should system. register in this

For authentication purpose we are using password. password will provide user authentication. The password field will be linked with DES algorithm and on clicking submit button the password will be encrypted and stored in the database. While retrieving that encrypted password will be decrypted. So that user will be secured.

Voting Phase:This voting process will be start. In time of polling the voter will enter in to vote module with his voter ID, password, and territory. Where voter ID and password are for user authentication. The territory field places major role in this phase3 the voter can vote for his territory only. If he tried for other territory, that will not be considered. The voter can vote only one time and in the next time it will not be casted. In the vote page the candidates who are standing as leaders form various parties name will be kept user will choose a person and votes for him.

Result:-

22

After completion of voting or during the voting the ECO can see the voting reports. These reports will in graphical bars and displayed party wise. These results will be stored in database for further use. The voting percentage territory wise, state wise and national wise will be displayed in this module.

5. IMPLEMENTATION 5.1 INTRODUCTION:Once the software requirements have been analyzed and specified the software design can be modeled with some sort of notations such as DFDs, UML notations to describe the proposed solution to the Problem. These Notations allows us to understand complex ideas clearly and serves as blue print for the proposed solution. These notations also reduce the complexity associated with problem solving by converting problem in to a Graphical Views. 23

The design activities are of main importance in this phase, because in this activity, decisions ultimately affecting the success of the software implementation and its ease of maintenance are made. These decisions have the final bearing upon reliability and maintainability of the system. Design is the only way to accurately translate the customers requirements into finished software or a system.

5.2 METHOD OF IMPLEMENTATION:JAVA Tehnology:The Java programming language is a high-level language that can be characterized by all of the following buzzwords:

Simple Architecture neutral Object oriented Portable Distributed High performance Interpreted Multithreaded Robust Dynamic Secure

With most programming languages, you either compile or interpret a program so that you can run it on your computer. The Java programming language is unusual in that a program is both compiled and interpreted. With the compiler, first you translate a program into an intermediate language called Java byte codes the platform-independent codes interpreted by the interpreter on the Java platform. The interpreter parses and runs each Java byte code instruction on the computer. Compilation happens just once; interpretation occurs each time the program is executed. The following figure illustrates how this works.

24

You can think of Java byte codes as the machine code instructions for the Java Virtual Machine (Java VM). Every Java interpreter, whether its a development tool or a Web browser that can run applets, is an implementation of the Java VM. Java byte codes help make write once, run anywhere possible. You can compile your program into byte codes on any platform that has a Java compiler. The byte codes can then be run on any implementation of the Java VM. That means that as long as a computer has a Java VM, the same program written in the Java programming language can run on Windows 2000, a Solaris workstation, or on an iMac.

The JAVA Platform:A platform is the hardware or software environment in which a program runs. Weve already mentioned some of the most popular platforms like Windows 2000, Linux, Solaris, and MacOS. Most platforms can be described as a combination of the operating system and hardware. The Java platform differs 25

from most other platforms in that its a software-only platform that runs on top of other hardware-based platforms.

The Java platform has two components:


The Java Virtual Machine (Java VM) The Java Application Programming Interface (Java API) Youve already been introduced to the Java VM. Its the base for the Java platform and is ported onto

various hardware-based platforms. The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages. The next section, What Can Java Technology Do? Highlights what functionality some of the packages in the Java API provide. The following figure depicts a program thats running on the Java platform. As the figure shows, the Java API and the virtual machine insulate the program from the hardware.

\ Native code is code that after you compile it, the compiled code runs on a specific hardware platform. As a platform-independent environment, the Java platform can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and just-in-time byte code compilers can bring performance close to that of native code without threatening portability.

What can JAVA Problem can Do?


26

The most common types of programs written in the Java programming language are applets and applications. If youve surfed the Web, youre probably already familiar with applets. An applet is a program that adheres to certain conventions that allow it to run within a Java-enabled browser. However, the Java programming language is not just for writing cute, entertaining applets for the Web. The general-purpose, high-level Java programming language is also a powerful software platform. Using the generous API, you can write many types of programs. An application is a standalone program that runs directly on the Java platform. A special kind of application known as a server serves and supports clients on a network. Examples of servers are Web servers, proxy servers, mail servers, and print servers. Another specialized program is a servlet. A servlet can almost be thought of as an applet that runs on the server side. Java Servlets are a popular choice for building interactive web applications, replacing the use of CGI scripts. Servlets are similar to applets in that they are runtime extensions of applications. Instead of working in browsers, though, Servlets run within Java Web servers, configuring or tailoring the server. How does the API support all these kinds of programs? It does so with packages of software components that provides a wide range of functionality. Every full implementation of the Java platform gives you the following features:

The essentials: Objects, strings, threads, numbers, input and output, data structures, system properties, date and time, and so on. Applets: The set of conventions used by applets. Networking: URLs, TCP (Transmission Control Protocol), UDP (User Data gram Protocol) sockets, and IP (Internet Protocol) addresses. Internationalization: Help for writing programs that can be localized for users worldwide. Programs can automatically adapt to specific locales and be displayed in the appropriate language.

Security: Both low level and high level, including electronic signatures, public and private key management, access control, and certificates. Software components: Known as JavaBeansTM, can plug into existing component architectures. Object serialization: Allows lightweight persistence and communication via Remote Method Invocation (RMI). Java Database Connectivity (JDBCTM): Provides uniform access to a wide range of relational databases. 27

The Java platform also has APIs for 2D and 3D graphics, accessibility, servers, collaboration, telephony, speech, animation, and more. The following figure depicts what is included in the Java 2 SDK.

How will JAVA Technology change my Life?


We cant promise you fame, fortune, or even a job if you learn the Java programming language. Still, it is likely to make your programs better and requires less effort than other languages. We believe that Java technology will help you do the following:

Get started quickly: Although the Java programming language is a powerful object-oriented Write less code: Comparisons of program metrics (class counts, method counts, and so on)

language, its easy to learn, especially for programmers already familiar with C or C++. suggest that a program written in the Java programming language can be four times smaller than the same program in C++.

Write better code: The Java programming language encourages good coding practices, and its

garbage collection helps you avoid memory leaks. Its object orientation, its JavaBeans component architecture, and its wide-ranging, easily extendible API let you reuse other peoples tested code and introduce fewer bugs.

Develop programs more quickly: Your development time may be as much as twice as fast versus

writing the same program in C++. Why? You write fewer lines of code and it is a simpler programming language than C++.

Avoid platform dependencies with 100% Pure Java: You can keep your program portable by

avoiding the use of libraries written in other languages. The 100% Pure JavaTM Product Certification 28

Program has a repository of historical process manuals, white papers, brochures, and similar materials online.

Write once, run anywhere: Because 100% Pure Java programs are compiled into machineDistribute software more easily: You can upgrade applets easily from a central server. Applets

independent byte codes, they run consistently on any Java platform. take advantage of the feature of allowing new classes to be loaded on the fly, without recompiling the entire program.

5.2.1 DATABASE DESIGN:ODBC:-

Microsoft Open Database Connectivity (ODBC) is a standard programming interface for application developers and database systems providers. Before ODBC became a de facto standard for Windows programs to interface with database systems, programmers had to use proprietary languages for each database they wanted to connect to. Now, ODBC has made the choice of the database system almost irrelevant from a coding perspective, which is as it should be. Application developers have much more important things to worry about than the syntax that is needed to port their program from one database to another when business needs suddenly change. Through the ODBC Administrator in Control Panel, you can specify the particular database that is associated with a data source that an ODBC application program is written to use. Think of an ODBC data source as a door with a name on it. Each door will lead you to a particular database. For example, the data source named Sales Figures might be a SQL Server database, whereas the Accounts Payable data source could refer to an Access database. The physical database referred to by a data source can reside anywhere on the LAN. The ODBC system files are not installed on your system by Windows 95. Rather, they are installed when you setup a separate database application, such as SQL Server Client or Visual Basic 4.0. When the 29

ODBC icon is installed in Control Panel, it uses a file called ODBCINST.DLL. It is also possible to administer your ODBC data sources through a stand-alone program called ODBCADM.EXE. There is a 16bit and a 32-bit version of this program and each maintains a separate list of ODBC data sources. From a programming perspective, the beauty of ODBC is that the application can be written to use the same set of function calls to interface with any data source, regardless of the database vendor. The source code of the application doesnt change whether it talks to Oracle or SQL Server. We only mention these two as an example. There are ODBC drivers available for several dozen popular database systems. Even Excel spreadsheets and plain text files can be turned into data sources. The operating system uses the Registry information written by ODBC Administrator to determine which low-level ODBC drivers are needed to talk to the data source (such as the interface to Oracle or SQL Server). The loading of the ODBC drivers is transparent to the ODBC application program. In a client/server environment, the ODBC API even handles many of the network issues for the application programmer. The advantages of this scheme are so numerous that you are probably thinking there must be some catch. The only disadvantage of ODBC is that it isnt as efficient as talking directly to the native database interface. ODBC has had many detractors make the charge that it is too slow. Microsoft has always claimed that the critical factor in performance is the quality of the driver software that is used. In our humble opinion, this is true. The availability of good ODBC drivers has improved a great deal recently. And anyway, the criticism about performance is somewhat analogous to those who said that compilers would never match the speed of pure assembly language. Maybe not, but the compiler (or ODBC) gives you the opportunity to write cleaner programs, which means you finish sooner. Meanwhile, computers get faster every year. JDBC:In an effort to set an independent database standard API for Java; Sun Microsystems developed Java Database Connectivity, or JDBC. JDBC offers a generic SQL database access mechanism that provides a consistent interface to a variety of RDBMSs. This consistent interface is achieved through the use of plugin database connectivity modules, or drivers. If a database vendor wishes to have JDBC support, he or she must provide the driver for each platform that the database and Java run on. To gain a wider acceptance of JDBC, Sun based JDBCs framework on ODBC. As you discovered earlier in this chapter, ODBC has widespread support on a variety of platforms. Basing JDBC on ODBC will allow vendors to bring JDBC drivers to market much faster than developing a completely new connectivity solution. JDBC was announced in March of 1996. It was released for a 90 day public review that ended June 8, 1996. Because of user input, the final JDBC v1.0 specification was released soon after. 30

The remainder of this section will cover enough information about JDBC for you to know what it is about and how to use it effectively. This is by no means a complete overview of JDBC. JDBC Goals:Few software packages are designed without goals in mind. JDBC is one that, because of its many goals, drove the development of the API. These goals, in conjunction with early reviewer feedback, have finalized the JDBC class library into a solid framework for building database applications in Java. The goals that were set for JDBC are important. They will give you some insight as to why certain classes and functionalities behave the way they do. The eight design goals for JDBC are as follows: SQL Level API The designers felt that their main goal was to define a SQL interface for Java. Although not the lowest database interface level possible, it is at a low enough level for higher-level tools and APIs to be created. Conversely, it is at a high enough level for application programmers to use it confidently. Attaining this goal allows for future tool vendors to generate JDBC code and to hide many of JDBCs complexities from the end user. SQL Conformance SQL syntax varies as you move from database vendor to database vendor. In an effort to support a wide variety of vendors, JDBC will allow any query statement to be passed through it to the underlying database driver. This allows the connectivity module to handle non-standard functionality in a manner that is suitable for its users. JDBC must be implemental on top of common database interfaces The JDBC SQL API must sit on top of other common SQL level APIs. This goal allows JDBC to use existing ODBC level drivers by the use of a software interface. This interface would translate JDBC calls to ODBC and vice versa. Provide a Java interface that is consistent with the rest of the Java system Because of Javas acceptance in the user community thus far, the designers feel that they should not stray from the current design of the core Java system. Keep it simple This goal probably appears in all software design goal listings. JDBC is no exception. Sun felt that the design of JDBC should be very simple, allowing for only one method of completing a task per mechanism. Allowing duplicate functionality only serves to confuse the users of the API. 31

Use strong, static typing wherever possible Strong typing allows for more error checking to be done at compile time; also, less error appear at runtime. Keep the common cases simple Because more often than not, the usual SQL calls used by the programmer are simple SELECTs, INSERTs, DELETEs and UPDATEs, these queries should be simple to perform with JDBC. However, more complex SQL statements should also be possible. Finally we decided to proceed the implementation using Java Networking. And for dynamically updating the cache table we go for MS Access database.

Java is also unusual in that each Java program is both compiled and interpreted. With a compile you translate a Java program into an intermediate language called Java byte codes the platformindependent code instruction is passed and run on the computer.

Compilation happens just once; interpretation occurs each time the program is executed. The figure illustrates how this works.

Java Program My Program Interpreter Compilers

You can think of Java byte codes as the machine code instructions for the Java Virtual Machine (Java VM). Every Java interpreter, whether its a Java development tool or a Web browser that can run Java applets, is an implementation of the Java VM. The Java VM can also be implemented in hardware. Java byte codes help make write once, run anywhere possible. You can compile your Java program into byte codes on my platform that has a Java compiler. The byte codes can then be run any implementation of the Java VM. For example, the same Java program can run Windows NT, Solaris, and Macintosh. 32

NETWORKING:TCP/IP stack The TCP/IP stack is shorter than the OSI one:

TCP is a connection-oriented protocol; UDP (User Datagram Protocol) is a connectionless protocol. IP datagrams The IP layer provides a connectionless and unreliable delivery system. It considers each datagram independently of the others. Any association between datagram must be supplied by the higher layers. The IP layer supplies a checksum that includes its own header. The header includes the source and destination addresses. The IP layer handles routing through an Internet. It is also responsible for breaking up large datagram into smaller ones for transmission and reassembling them at the other end. UDP UDP is also connectionless and unreliable. What it adds to IP is a checksum for the contents of the datagram and port numbers. These are used to give a client/server model - see later. TCP TCP supplies logic to give a reliable connection-oriented protocol above IP. It provides a virtual circuit that two processes can use to communicate. 33

INTERNET ADDRESSES In order to use a service, you must be able to find it. The Internet uses an address scheme for machines so that they can be located. The address is a 32 bit integer which gives the IP address. This encodes a network ID and more addressing. The network ID falls into various classes according to the size of the network address. NETWORK ADDRESS Class A uses 8 bits for the network address with 24 bits left over for other addressing. Class B uses 16 bit network addressing. Class C uses 24 bit network addressing and class D uses all 32. SUBNET ADDRESS Internally, the UNIX network is divided into sub networks. Building 11 is currently on one sub network and uses 10-bit addressing, allowing 1024 different hosts. HOST ADDRESS 8 bits are finally used for host addresses within our subnet. This places a limit of 256 machines that can be on the subnet. TOTAL ADDRESS

The 32 bit address is usually written as 4 integers separated by dots. PORT ADDRESSES A service exists on a host, and is identified by its port. This is a 16 bit number. To send a message to a server, you send it to the port for that service of the host that it is running on. This is not location transparency! Certain of these ports are "well known". SOCKETS 34

A socket is a data structure maintained by the system to handle network connections. A socket is created using the call socket. It returns an integer that is like a file descriptor. In fact, under Windows, this handle can be used with Read File and Write File functions. #include <sys/types.h> #include <sys/socket.h> int socket(int family, int type, int protocol); Here "family" will be AF_INET for IP communications, protocol will be zero, and type will depend on whether TCP or UDP is used. Two processes wishing to communicate over a network create a socket each. These are similar to two ends of a pipe - but the actual pipe does not yet exist. JFree Chart JFreeChart is a free 100% Java chart library that makes it easy for developers to display professional quality charts in their applications. JFreeChart's extensive feature set includes: A consistent and well-documented API, supporting a wide range of chart types; A flexible design that is easy to extend, and targets both server-side and client-side applications; Support for many output types, including Swing components, image files (including PNG and JPEG), and vector graphics file formats (including PDF, EPS and SVG); JFreeChart is "open source" or, more specifically, free software. It is distributed under the terms of the GNU Lesser General Public Licence (LGPL), which permits use in proprietary applications. 1. MAP VISUALIZATIONS Charts showing values that relate to geographical areas. Some examples include: (a) population density in each state of the United States, (b) income per capita for each country in Europe, (c) life expectancy in each country of the world. The tasks in this project include: Sourcing freely redistributable vector outlines for the countries of the world, states/provinces in particular countries (USA in particular, but also other areas); Creating an appropriate dataset interface (plus default implementation), a rendered, and integrating this with the existing XYPlot class in JFreeChart; Testing, documenting, testing some more, documenting some more. 2. TIME SERIES CHART INTERACTIVITY 35

Implement a new (to JFreeChart) feature for interactive time series charts --- to display a separate control that shows a small version of ALL the time series data, with a sliding "view" rectangle that allows you to select the subset of the time series data to display in the main chart. 3. DASHBOARDS There is currently a lot of interest in dashboard displays. Create a flexible dashboard mechanism that supports a subset of JFreeChart chart types (dials, pies, thermometers, bars, and lines/time series) that can be delivered easily via both Java Web Start and an applet. 4. PROPERTY EDITORS The property editor mechanism in JFreeChart only handles a small subset of the properties that can be set for charts. Extend (or reimplement) this mechanism to provide greater an end-user control over the appearance of the chart.

JDBC DRIVER TYPES: There are various types of Drivers, identified by the sun, such that each one has some unique features and facilitates a connection to the database. 1. The JDBC_ODBC bridge provides JDBC access via most ODBC drivers. Note that some ODBC binary code and in many cases database client code must be loaded on each client machine that uses this driver, so this kind of diver is most appropriate on a corporate network, or for application server code written in java in a 3-tier architecture. 2. A native-API partly-Java 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. A net-protocol all Java driver translates JDBC calls into a DBMS-independent net protocol, which is then translated, to a DBMS protocol by server. This net server middleware is able to connect it all java clients to many different databases. The specific protocol used depends on the vendor. In general. This is the 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 support Intranet access they must handle the additional requirements for security, access through firewall, etc. that the web imposes. Several vendors are adding JDBC drivers to their existing database middleware products. 4. A native-protocol all-Java driver converts JDBC calla into the network protocol used by DBMSs directly. This allows a direct call from the client machine to the DBMS server and is a practical solution for 36

Intranet access. Since many of these protocols are proprietary the database vendors themselves will be the primary source for this style of driver . several database vendors have these in progress. In Telecom Customer Services the database is maintained by using Oracle 8i database. The tables in the database are normalized up to second normal form and the JDBC driver used to connect the database is type-4 driver( thin driver ).

UML NOTATIONS:
UML is a notation that resulted from the unification of Object Modeling Technique, Booch and OOSE. UML has been designed for a broad range of applications. Hence, it provides constructs for a broad range of systems and activities.

OVERVIEW OF UML:
Use case diagrams: Use cases are used during requirements elicitation and analysis to represenet the functionality of the system. Use cases focus on the behavior of the system from an external point of view. A use case describes a function provided by system that yields a visible result for an actor. An actor describes any entity that interacts with the system. The actors are outside the boundary of the system, whereas the use cases are inside the boundary of the system. Actors are represented with stick figures, use cases with ovals, and the boundary of the system with a box enclosing the use cases.

Class diagrams : Class diagrams are used to describe the structure of the system. Classes are abstractions that specify the common structure and behavior of a set of objects. Objects are instances of classes that are created, modified, and destroyed during the execution of the system. Objects have state that includes the values of its attributes and its relationships with other objects. Class diagrams describes the system in terms of objects, classes, attributes, operations and their associations. 37

Sequence diagrams: Sequence diagrams are used to formalize the behavior of the system and to visualize the communication among objects. They are useful for identifying additional objects that participates in the use cases. A sequence diagram represents the interactions that take place among these objects.

Activity diagrams: An activity diagram describes a system in terms of activities. Activities are states that represent the execution of a set of operations. The completion of these operations triggers a transition to another activity. Activity diagrams are similar to flowchart diagrams in that they can be used to represent control flow and data flow.

Implementation Model

JDBC Jdbc

38

MySq l

client

Data Base

5.2.2 OUTPUT SCREENS:-

HOME PAGE:-

39

PUBLIC REGISTRATION:-

40

41

CANDIDATE REGISTRATION:-

42

43

44

VOTING:-

45

REGION OF VOTING:-

46

47

ELECTION COMMISIONER LOGIN:-

48

RESULT:-

49

6. TESTING VALIDATION AND RESULTS


6.1 INTRODUCTION:50

Software testing is a critical element of software quality assurance and represents the ultimate review of specification, design and coding. Testing is the exposure of the system to trial input to see whether it produces correct output.

6.2 TESTING METHODOLOGIES:The purpose of testing is to discover errors. Testing is the process of trying to discover every conceivable

fault or weakness in a work product. It provides a way to check the functionality of components, sub assemblies, assemblies and/or a finished product It is the process of exercising software with the intent of ensuring that the Software system meets its requirements and user expectations and does not fail in an unacceptable manner. There are various types of test. Each test type addresses a specific testing requirement.

TYPES OF TESTS:UNIT TESTING:Unit testing involves the design of test cases that validate that the internal program logic is functioning properly, and that program inputs produce valid outputs. All decision branches and internal code flow should be validated. It is the testing of individual software units of the application .it is done after the completion of an individual unit before integration. This is a structural testing, that relies on knowledge of its construction and is invasive. Unit tests perform basic tests at component level and test a specific business process, application, and/or system configuration. Unit tests ensure that each unique path of a business process performs accurately to the documented specifications and contains clearly defined inputs and expected results.

INTEGRATION TESTING:`Integration tests are designed to test integrated software components to determine if they actually run as one program. Testing is event driven and is more concerned with the basic outcome of screens or fields. Integration tests demonstrate that although the components were individually satisfaction, as shown by successfully unit testing, the combination of components is correct and consistent. Integration testing is specifically aimed at exposing the problems that arise from the combination of components.

FUNCTIONAL TEST:Functional tests provide systematic demonstrations that functions tested are available as specified by the business and technical requirements, system documentation, and user manuals. Functional testing is centered on the following items: 51

Valid Input Invalid Input Functions Output

: identified classes of valid input must be accepted. : identified classes of invalid input must be rejected. : identified functions must be exercised. : identified classes of application outputs must be exercised.

Systems/Procedures: interfacing systems or procedures must be invoked. Organization and preparation of functional tests is focused on requirements, key functions, or special test cases. In addition, systematic coverage pertaining to identify Business process flows; data fields, predefined processes, and successive processes must be considered for testing. Before functional testing is complete, additional tests are identified and the effective value of current tests is determined.

SYSTEM TEST:System testing ensures that the entire integrated software system meets requirements. It tests a configuration to ensure known and predictable results. An example of system testing is the configuration oriented system integration test. System testing is based on process descriptions and flows, emphasizing pre-driven process links and integration points.

WHITE BOX TESTING:White Box Testing is a testing in which the software tester has knowledge of the inner workings, structure and language of the software, or at least its purpose. It is purpose. It is used to test areas that cannot be reached from a black box level. BLACK BOX TESTING:Black Box Testing is testing the software without any knowledge of the inner workings, structure or language of the module being tested. Black box tests, as most other kinds of tests, must be written from a definitive source document, such as specification or requirements document, such as specification or requirements document. It is a testing in which the software under test is treated, as a black box .you cannot see into it. The test provides inputs and responds to outputs without considering how the software works.

UNIT TESTING:Unit testing is usually conducted as part of a combined code and unit test phase of the software lifecycle, although it is not uncommon for coding and unit testing to be conducted as two distinct phases. 52

Test strategy and approach Field testing will be performed manually and functional tests will be written in detail. Test objectives All field entries must work properly. Pages must be activated from the identified link. The entry screen, messages and responses must not be delayed.

Features to be tested Verify that the entries are of the correct format No duplicate entries should be allowed

INTEGRATION TESTING:Software integration testing is the incremental integration testing of two or more integrated software components on a single platform to produce failures caused by interface defects. The task of the integration test is to check that components or software applications, e.g. components in a software system or one step up software applications at the company level interact without error.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.
ACCEPTANCE TESTING:-

User Acceptance Testing is a critical phase of any project and requires significant participation by the end user. It also ensures that the system meets the functional requirements.

6.3 RESULT ANALYSIS:-

This project is working successfully. All programs are running effectively. The code is compiled and the product was tested successfully. The registration module is perfectly inserting the values into database.

53

The database is connected effectively. The verification can be done using unique constraint in the registration module as page level validates. The voting module is working effectively. The voting module avoids duplicates voting. Literature survey had given us satisfaction. The module design and implementation module work given good satisfaction. All phase are tested successfully. this project can deploy successfully now.

7.CONCLUSION AND FUTURE SCOPE OF WORK

As a whole of this we conclude that, the project that we have designed will improve the state of democracy and voting rate. The metro people, new generation and celebrities can use this system effectively.

54

This site will eliminate the travelling problems and reduces the eco burden. Election results can be obtained easily. The following thing you have remember when you want to develop this project. Take database backs. Analyses the constraints before going into the project design.

FUTURE SCOPE:The project has a bright future scope. This project can be developed by using face recognition, thumb impression, or retina scans so that it will give more secure authentication. This project can develop in various languages, so that it reaches the rural areas. We can also develop online voting booths.

8.BIBLIOGRAPHY
1. www.wikipedia.com 2. www.vtubooks.com 3. www.McGrahillEnggingCS.vom

55

4. www.absone.com 5. www.computeredu.com 6. Database Management Systems: by Ragu Ramakrishna, Gehreke.

7. The Java Complete reference; by Herbert schildt. 8. Java; by Balaguruswamy. 9. Network security essential; by William Stallings. 10. Computer Networks; by Tanenbum.

9. ANNEXURES PROJECT CODING:-

1.HOME PAGE:<%-Document : home1 Created on : Jun 9, 2011, 10:49:14 AM Author : Administrator 56

--%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <title>Online National Polling</title></head> <body> <center> <img src="eci.jpg"> <h2><font color="cray">Online National Polling</font></h2> </center> <hr> <table align="center"> <tr> <td><a href="genpub.jsp">New voter Registration </a></td> <td><img src="navi.gif"></td> <td><a href="genpub.jsp">Old voter Registration </a></td> <td><img src="navi.gif"></td> <td><a href="canreg.jsp">Candidate Registration</a></td><td> <img src="navi.gif"></td>

<td><a href="ecom.jsp">Election Commission Officer </a></td> <td><img src="navi.gif"></td> <td><a href="newrg.jsp">vote </a></td> <td><img src="navi.gif"></td> <td><a href="result.jsp">result </a></td> </tr> </table> <br> <br> <marquee><font color="green" size="5" style="font-style: italic">Online National Polling</font></marquee> <table align="left"> <tr><td width=700 height=300><font color=" blue" > Lok Sabha is composed of representatives of the people chosen by direct election on the basis of the adult suffrage. The maximum strength of the House envisaged by the Constitution is 552, which is made up by election 57

of upto 530 members to represent the States, upto 20 members to represent the Union Territories and not more than two members of the Anglo-Indian Community to be nominated by the Hon'ble President, if, in his/her opinion, that community is not adequately represented in the House. The total elective membership is distributed among the States in such a way that the ratio between the number of seats allotted to each State and the population of the State is, so far as practicable, the same for all States. </font></td> <td></tr> </table> <br><br><br><br><br> <table align="right"> <tr><img src="lstv.jpg"></tr> <br> <tr><img src="evm2.jpg"></tr> </table> </table> </body> </html> </body> </html>

2.REGISTRATION PHASE:HTML PAGE:<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <center> <img src="loksabha.gif"> <h2><font color="cray"></font></h2> <br> <br> <table align="center"> <hr> <tr> <td><a href="genpub.jsp">New voter Registration </a></td> <td><img src="navi.gif"></td> <td><a href="genpub.jsp">Old voter Registration </a></td> <td><img src="navi.gif"></td> <td><a href="canreg.jsp">Candidate Registration</a></td><td> <td><img src="navi.gif"></td> <td><a href="ecom.jsp">Election Commission Officer </a></td> <td><img src="navi.gif"></td> 58

<td><a href="newrg.jsp">vote </a></td> <td><img src="navi.gif"></td> <td><a href="result.jsp">result </a></td> </tr></table> <br> <center> <h2><font color="cray" style="font-style: italic">GENERAL PUBLIC REGISTRATION FORM</font></h2> <form name="f" action="genpub1.jsp" method="get"> <table><tr><td>Registration id</td><td><input type="text" name="regid"></td></tr> <tr><td>Ration Id</td><td><input type="text" name="ratid"></td></tr> <tr><td>name</td><td><input type="text" name="n"></td></tr> <tr><td>address</td><td><input type="text" name="a"></td></tr> <tr><td>phone</td><td><input type="text" name="j"></td></tr> <tr><td>region</td><td> <select name="r"> <option value="-1"></option> <option value="ap">Andhra Pradesh</option> <option value="ap">Arunachal Pradesh</option> <option value="am">Assam</option> <option value="bi">Bihar</option> <option value="cg">chandighar</option> <option value="ch">Chhatthisgarth</option> <option value="ga">Goa</option> <option value="gj">Gujarath</option> <option value="hr">Haryana</option> <option value="hp">Himachal Pradesh</option> <option value="jk"> Jammu and khashmir</option> <option value="jk">Jarkhand</option> <option value="kr">karnataka</option> <option value="ke">Kerala</option> <option value="mp">Madhya Pradesh</option> <option value="mh">Maharashtra</option> <option value="mn">Manipur</option> <option value="mg">Meghalaya</option> <option value="mj">Mijoram</option> <option value="nl">Nagaland</option> <option value="or">orrissa</option> <option value="pj">Punjab</option> <option value="rj">rajasthan</option> <option value="sk">Sikkim</option> <option value="tn">tamilnadu</option> <option value="tr">Tripura</option> <option value="up">uttar pradesh</option> <option value="uk">Uttarkhand</option> <option value="wb">West Bengal</option> </select> </td></tr> <tr><td>gender</td><td><input type="radio" name="g" value="male">Male <input type="radio" name="g" value="Female">FeMale</td></tr> <tr><td>password</td><td><input type="password" name="password"></td></tr> <tr><td>re-enter password</td><td><input type="password"name="password"></td></tr> 59

<tr><td>digital signature</td><td><input type="number" name="k"></td></tr> <tr><td>Enter digital signature</td><td><input type="number"name="l"></td></tr> <br> <tr><td><input type="submit" value="register"></td><td><input type="submit" value="cancel"></td><td><input type="submit" value="clear"></td></tr> </table> </form></center> </body> </html>

JSP PAGE:<%-Document : newreg Created on : Jun 6, 2011, 3:20:20 PM Author : Administrator --%> <%@page import="java.sql.*"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <center> <img src="eci.jpg"> <br> <br> <h2><font color="cray"></font></h2> </center> <a href="home1.jsp">Home</a> <br> <center> <% System.out.println("Entered"); String regid=request.getParameter("regid"); System.out.println(regid); String ratid=request.getParameter("ratid"); String name=request.getParameter("n"); String address=request.getParameter("a"); String phone=request.getParameter("j"); String region=request.getParameter("r"); String Gender=request.getParameter("g"); String password=request.getParameter("password"); 60

String Reenterpassword=request.getParameter("password"); String Digitalsignature=request.getParameter("k"); String Enterdigitalsignature=request.getParameter("l"); DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","onlinepolling","online"); Statement stmt=con.createStatement(); String sql="insert into generalpubreg1 values('"+regid+"','"+ratid+"','"+name+"','"+address+"','"+phone+"','"+region+"','"+Gender+"','"+password+"','"+ Reenterpassword+"','"+Digitalsignature+"','"+Enterdigitalsignature+"')"; System.out.println(sql); int i=stmt.executeUpdate(sql); if(i>0) { out.println("Inserted successfully"); } else { out.println("Unsuuccesfull"); } %> <br> <br> <tr><td><input type="submit" value="ok"></td></tr> </center> </body> </html>

3.CANDIDATE NOMINATION PHASE:-

HTML PAGE:-

<%-Document : lgn1 Created on : Jun 7, 2011, 2:52:32 PM Author --%> : Administrator

<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" <html> <head> 61

<meta http-equiv="Content-Type" content="text/html; "> <title>JSP Page</title> </head> <body> <center> <img src="loksabha.gif"> <h2><font color="cray"></font></h2> <br> <br> <table align="center"> <hr> <tr> <td><a href="genpub.jsp">New voter Registration </a></td> <td> <img src="navi.gif"> </td> <td><a href="genpub.jsp">Old voter Registration </a></td> <td><img src="navi.gif"></td> <td><a href="canreg.jsp">Candidate Registration</a></td> <td> <img src="navi.gif"></td> <td><a href="ecom.jsp">Election Commission Officer </a></td> <td><img src="navi.gif"></td> <td><a href="newrg.jsp">vote </a></td> <td><img src="navi.gif"></td> <td><a href="result.jsp">result </a></td> </table> <br> <center> 62

<h2><font color="cray" style="font-style: italic">CANDIDATE REGISTRATION FORM</font></h2> <form name="f" action="canreg1.jsp" method="get"> <table><tr><td>Registration id</td><td><input type="text" name="regid"></td></tr> <tr><td>Name of candidate</td><td><input type="text" name="a"></td></tr> <tr><td>Party name</td><td><input type="name" name="b"></td></tr> <tr><td>region of participating</td><td> <select name="c"> <option value="-1"></option> <option value="ap">Andhra Pradesh</option> <option value="ap">Arunachal Pradesh</option> <option value="am">Assam</option> <option value="bi">Bihar</option> <option value="cg">chandighar</option> <option value="ch">Chhatthisgarth</option> <option value="ga">Goa</option> <option value="gj">Gujarath</option> <option value="hr">Haryana</option> <option value="hp">Himachal Pradesh</option> <option value="jk"> Jammu and khashmir</option> <option value="jk">Jarkhand</option> <option value="kr">karnataka</option> <option value="ke">Kerala</option> <option value="mp">Madhya Pradesh</option> <option value="mh">Maharashtra</option> <option value="mn">Manipur</option> 63

<option value="mg">Meghalaya</option> <option value="mj">Mijoram</option> <option value="nl">Nagaland</option> <option value="or">orrissa</option> <option value="pj">Punjab</option> <option value="rj">rajasthan</option> <option value="sk">Sikkim</option> <option value="tn">tamilnadu</option> <option value="tr">Tripura</option> <option value="up">uttar pradesh</option> <option value="uk">Uttarkhand</option> <option value="wb">West Bengal</option> </select> </td></tr> <tr><td>address</td><td><input type="text" name="d"></td></tr> <tr><td>phone</td><td><input type="name" name="e"></td></tr> <tr><td>password</td><td><input type="password" name="password"></td></tr> <tr><td>re-enter password</td><td><input type="password" name="password"></td></tr> <tr><td>gender</td><td><input type="radio" name="g" value="male">Male <input type="radio" name="g" value="Female">FeMale</td></tr> <br>

<tr><td><input type="submit" value="register"></td><td> <input type="submit" value="cancel"></td><td><input type="submit" value="clear"></td></tr>

</table> </form> 64

</center> </body> </html>

JSP PAGE:-

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>newrg1.jsp</title> </head> <body> <%@page import="java.sql.*"%> <%@page contentType="text/html" %> <body> <center> <img src="eci.jpg"> <br> <br> <h2><font color="cray"></font></h2> </center> <a href="home1.jsp">Home</a> <br> <center> <% String regid=request.getParameter("regid"); String nameofcandidate=request.getParameter("a"); String partyname=request.getParameter("b"); String regionofparticipating=request.getParameter("c"); String address=request.getParameter("d"); String phone=request.getParameter("e"); String password=request.getParameter("password"); String Reenterpassword=request.getParameter("password"); String Gender=request.getParameter("g"); DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","onlinepolling","online"); Statement stmt=con.createStatement(); String sql="insert into candidatereg values ('"+regid+"','"+nameofcandidate+"','"+partyname+"','"+regionofparticipating+"','"+address+"','"+phone+"','"+pass word+"','"+Reenterpassword+"','"+Gender+"')"; int i=stmt.executeUpdate(sql); if(i>0) { 65

out.println("Inserted successfully"); } else { out.println("Unsuuccesfull"); } %> <br> <br> <tr><td><input type="submit" value="ok"></td></tr> </center> </body> </html>

4.VOTING PHASE:HTML PAGE:<%-Document : LOGIN2 Created on : Jun 7, 2011, 3:57:35 PM Author : Administrator --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <center> <img src="loksabha.gif"> <h2><font color="cray"></font></h2> </center> <a href="home1.jsp">Home</a> <table align="center"> <tr> <td><a href="genpub.jsp">New voter Registration </a></td> <td><img src="navi.gif"></td> <td><a href="genpub.jsp">Old voter Registration </a></td> <td><img src="navi.gif"></td> 66

<td><a href="canreg.jsp">Candidate Registration</a></td><td> <img src="navi.gif"></td>

<td><a href="ecom.jsp">Election Commission Officer</a></td> <td><img src="navi.gif"></td> <td><a href="newrg.jsp">vote </a></td> <td><img src="navi.gif"></td> <td><a href="result.jsp">result </a></td> <hr> </table> <br> <center> <h2><font color="cray" style="font-style: italic">VOTE</font></h2> <form name="f" action="newrg2.jsp" method="get"> <table><tr><td>Registration id</td><td><input type="text" name="regid"></td></tr> <tr><td>region of voting</td><td> <select name="c"> <option value="-1"></option> <option value="ap">Andhra Pradesh</option> <option value="ap">Arunachal Pradesh</option> <option value="am">Assam</option> <option value="bi">Bihar</option> <option value="cg">chandighar</option> <option value="ch">Chhatthisgarth</option> <option value="ga">Goa</option> <option value="gj">Gujarath</option> <option value="hr">Haryana</option> <option value="hp">Himachal Pradesh</option> <option value="jk"> Jammu and khashmir</option> <option value="jk">Jarkhand</option> <option value="kr">karnataka</option> <option value="ke">Kerala</option> <option value="mp">Madhya Pradesh</option> <option value="mh">Maharashtra</option> <option value="mn">Manipur</option> <option value="mg">Meghalaya</option> <option value="mj">Mijoram</option> <option value="nl">Nagaland</option> <option value="or">orrissa</option> <option value="pj">Punjab</option> <option value="rj">rajasthan</option> <option value="sk">Sikkim</option> <option value="tn">tamilnadu</option> <option value="tr">Tripura</option> <option value="up">uttar pradesh</option> <option value="uk">Uttarkhand</option> 67

<option value="wb">West Bengal</option> </select> </td></tr> <tr><td>password</td><td><input type="password" name="password"></td></tr> <tr><td>digital signature</td><td><input type="number" name="k"></td></tr> <tr><td>reEnter digital signature</td><td><input type="number"name="l"></td></tr> <tr><td><input type="submit" value="checkout"></td><td><input type="submit" value="cancel"></td><td><input type="submit" value="clear"></td></tr>

</table> </form></center> </body> </html>

JSP PAGE:<%-Document : newreg Created on : Jun 6, 2011, 3:20:20 PM Author : Administrator --%> <%@page import="java.sql.*"%> <%@page contentType="text/html" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>newrg2.jsp</title> </head> <body> <% String regid=request.getParameter("regid"); session.setAttribute("user", regid); String regionofvoting=request.getParameter("c"); String password=request.getParameter("password"); String Digitalsignature=request.getParameter("k"); String reenterdigitalsignature=request.getParameter("l"); DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","onlinepolling","online"); 68

Statement stmt=con.createStatement(); String sql="insert into vote values ('"+regid+"','"+regionofvoting+"','"+password+"','"+Digitalsignature+"','"+reenterdigitalsignature+"')"; int i=stmt.executeUpdate(sql); if(i>0) { response.sendRedirect("voting.jsp"); } else { out.println("Unsuuccesfull"); } %> </body> </html>

AFTER LOGIN:HTML PAGE:<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <center> <img src="loksabha.gif"> <h2><font color="cray"></font></h2> <hr> <br><br> <hr> <center> <tr> <td><a href="genpub.jsp">New voter Registration </a></td> <td><img src="navi.gif"></td> <td><a href="genpub.jsp">Old voter Registration </a></td> <td><img src="navi.gif"></td> <td><a href="canreg.jsp">Candidate Registration</a></td> <td><img src="navi.gif"></td> <td><a href="ecom.jsp">Election Commission Officer </a></td> <td><img src="navi.gif"></td> <td><a href="newrg.jsp">vote </a></td> <td><img src="navi.gif"></td> <td><a href="result.jsp">result </a></td> 69

</tr> <br> <br> <h2><font color="cray" style="font-style: italic">WELCOME TO ONLINE NATIONAL POLLING REGION </font></h2> <form name="f" action="voting1.jsp" method="get"> <h2><font color="cray" style="font-style: italic">RANGAREDDY</font></h2> <form name="f" action="voting1.jsp" method="get"> <br> <br> <table border="5"> <thead> <tr> <th>prathap</th> <th>ysrcongress</th> <th><input type="radio" name="g" value="ysr"></th> </tr> </thead> <tbody> <tr> <td> chinna </td> <td>congress</td> <td><input type="radio" name="g" value="con" ></td> </tr> <tr> <td>vikas </td> <td>tdp</td> <td><input type="radio" name="g" value="tdp"></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> <br><br> <tr><td><input type="submit" value="vote"></td> <td><input type="submit" value="cancel"></td></tr> </tbody> <br> <br> <marquee><font color="cray" style="font-style: italic" size="6">VOTE IS OUR BIRTH RIGHT </font></marquee> </center> 70

</body> </html>

JSP PAGE:-

<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>newrg3.jsp</title> </head> <%@page import="java.sql.*"%> <%@page contentType="text/html" %> <body><center> <img src="eci.jpg"> <br> <br> <h2><font color="cray"></font></h2> </center> <a href="home1.jsp">Home</a> <br> <center> </body> <% String name=(String)session.getAttribute("user"); String vote=request.getParameter("g"); DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","onlinepolling","online"); Statement stmt=con.createStatement(); String sql="insert into VOTING values ('"+vote+"','"+name+"')"; int i=stmt.executeUpdate(sql); if(i>0) { out.println("Successfully ur vote is casted"); } else { out.println("Unsuuccesfull"); } %><br> <br> <tr><td><input type="submit" value="ok"></td></tr> 71

</center> </body> </html>

ELECTION COMMISIONER LOGIN PHASE:HTML PAGE:<%-Document : LOGIN4 Created on : Jun 8, 2011, 1:05:46 PM Author : Administrator --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <center> <img src="eci.jpg"> <h2><font color="cray">Online National Polling</font></h2> </center> <a align="left" href="home1.jsp">Home</a> <hr> <center> <tr> <td><a href="genpub.jsp">New voter Registration </a></td> <td><img src="navi.gif"></td> <td><a href="genpub.jsp">Old voter Registration </a></td> <td><img src="navi.gif"></td> <td><a href="canreg.jsp">Candidate Registration</a></td> <td><img src="navi.gif"></td> <td><a href="ecom.jsp">Election Commission Officer </a></td> <td><img src="navi.gif"></td> <td><a href="newrg.jsp">vote </a></td> <td><img src="navi.gif"></td> <td><a href="result.jsp">result </a></td> </tr> <br> 72

<br> <h2><font color="cray" style="font-style: italic">ELECTION COMMISION OFFICER</font></h2> <form name="f" action="ecom1.jsp" method="get"> <table><tr><td>userid</td><td><input type="text" name="userid"></td></tr> <tr><td>password</td><td><input type="password" name="password"></td></tr> <tr><td><input type="submit" value="submit"></td><td><input type="submit" value="cancel"></td></tr> </table> </center> </form> </body> </html>

JSP PAGE:<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>newrg4.jsp</title> </head> <body> <%@page import="java.sql.*"%> <%@page contentType="text/html" %> <% try{ String userid=request.getParameter("userid"); String password=request.getParameter("password"); if(userid.equals("commisioner") && password.equals("commisioner")) response.sendRedirect("result.jsp"); else {%> <jsp:include page="ecom.jsp"></jsp:include><% out.println("Invalid UserName/Password"); } }catch(Exception ex){ ex.printStackTrace(); } 73

%> </body> </html>

4.RESULT PHASE:HTML PAGE:<%-Document : result Created on : Jun 9, 2011, 12:26:13 PM Author : Administrator --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <html> <head><title>Online National Polling</title></head> <body> <center> <img src="eci.jpg"> <h2><font color="cray" >Online National Polling</font></h2> </center> <a align="left" href="ecom.jsp">logout</a> <hr> <br><br> <br> <br> <marquee><font color="green" size="5" style="font-style: italic">Online National Polling</font></marquee> <table align="left"> <tr><td width=700 height=300><font color="pinkgray" > Lok Sabha is composed of representatives of the people chosen by direct election on the basis of the adult suffrage. The maximum strength of the House envisaged by the Constitution is 552, which is made up by election of upto 530 members to represent the States, upto 20 members to represent the Union Territories and not more than two members of the Anglo-Indian Community to be nominated by the Hon'ble President, if, in his/her opinion, 74

that community is not adequately represented in the House. The total elective membership is distributed among the States in such a way that the ratio between the number of seats allotted to each State and the population of the State is, so far as practicable, the same for all States. </font></td> <td></tr> </table> <br><br><br><br><br> <table align="right"> <tr><TH><font color="cray">RESULT</font></TH></tr> <tr><td><a href="result1.jsp">Result</a></td></tr> </table> </body> </html>

JSP PAGE:<%-Document : result1 Created on : Jun 9, 2011, 12:53:24 PM Author : Administrator --%> <%@page import="java.sql.*"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body><center> <img src="eci.jpg"> <br> <br> <h2><font color="cray"></font></h2> </center> <a href="home1.jsp">Home</a> <br> <center> </body> <% DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","onlinepolling","online"); Statement stmt=con.createStatement(); String str="select * from voting"; ResultSet rs=stmt.executeQuery(str); int i=0,j=0,k=0; 75

while(rs.next()) { if(rs.getString(1).equals("ysr")) { i++; } else if(rs.getString(1).equals("con")) { j++; } else if(rs.getString(1).equals("tdp")) { k++; } } out.println("<center>Tdp got "+k+" votes<br>"); out.println("Ysr got "+i+" votes<br>"); out.println("con got "+j+" votes<br></center>"); %> <br><br><br><br><br> <table align="right">SSSSSSS <tr><img src="lstv.jpg"></tr> <br> <tr><img src="evm2.jpg"></tr> </table></body> </html>

76

You might also like