Sie sind auf Seite 1von 282

A PROJECT

ON

GPF MANAGEMENT
SYSTEM
OF
BIHAR STATE ELECTRICITY
BOARD

Under The Guidence Of:-


MR.AMIT ANAND
DEPUTY DIRECTOR IT

PATNA WOMEN’S college


WITH POTENCIAL FOR EXCELLENCE
NAAC accredited ‘A’ grade Bailey Road, patna
GPF MANAGMENT SYSTEM

DEVELOPED BY:-
Richa (87)

PATNA WOMEN’S COLLEGE Page 2


GPF MANAGMENT SYSTEM

CERTIFICATE OF APPROVAL

This is to certify that this project entitled “GPF management


system” developed by veena kumari of department of
computer science, session 2009-2012 of Patna women’s
college is worthy of consideration for the partial fulfillment of
the requirement for the award of degree of B.A. in computer
application from Patna University.

…………………………………………….. ……………………………………………..

INTERNAL EXAMINER EXTERNAL EXAMINER

……………………………………………..

CO-ORDINATOR

PATNA WOMEN’S COLLEGE Page 3


GPF MANAGMENT SYSTEM

DECLARATION

I hereby inform you that the project work entitled “GPF


Management System” is an authentic work carried out by her
at Patna under the guidance of Mr. AMIT ANAND OF
B.S.E.B., Patna for partial fulfillment of the degree of
BCA(Bachelor Of Computer Application) and this project has
not been submitted anywhere else for the award of any other
degree.

SUBMITTED BY:

Richa (roll no – 87)

PATNA WOMEN’S COLLEGE Page 4


GPF MANAGMENT SYSTEM

ACKNOWLEDMENT

Guidance, cooperation and inspiration are the important factors in


accomplishment of an assigned task. Preparation of this project , lead me to
express my profound sense of gratitude and cumulative appreciation to all
those who have helped us throughout the tenure of my project.
I would like to thank GOD because without his blessings it would be nearly
impossible to complete the task. I would also like to thank my parents who
provide me the needful support , courage and inspiration as and when
needed.
Mr. Amitanand, Project incharge of B.S.E.B. , to whom I owe profound sense
of gratitude , because he Helped us in and out . he provident all technical
support for the project . he helped me in understanding all the issues relevant
to our project . His valuable suggestions for amendments helped our project to
take its final form.

I would like to thank our principal Dr. Sister DORIS D’SOUZA whose friendly,
cooperative and inspirational

Words always helped us to complete the project in the best manner . I would
also like to thank our coordinator mam ‘ Mrs. APRAJITA KRISHNA’ for
providing us the best environment required for the proper completion of a full-
pledged project . our endeavor is also gift of faculties members who taught us
the basics of the subject in friendly and supportive way.
Last but not the least ; I would like to thank our seniors whose tips of making a
good project can’t be ignored.

PATNA WOMEN’S COLLEGE Page 5


GPF MANAGMENT SYSTEM

PEFACE

I have made this software under the demand of the BCA course to
undergo On-Job-Training in the final year . Training can be done by
any private or public sector organization where I can employ all the
studied computer languages and the tools. The objective of the
training is that the students should experience or gain the practical
knowledge of working environment and I have gained this very
experience from B.S.E.B , Bailey road ,Patna.
The project incharge has given us the responsibility of developing
‘GPF MANAGEMENT SYSTEM’ We made a study and overviewed the
section . We have gathered necessary and relevant information
regarding the section with the cordial support of the project
incharge.
“GPF Management System” is the outcome of that proposal. The
frontend used in its development is java(jdk 1.5.0) and SQL Server
2005 , the RDBMS package, as the backend.
The project contains information about organization, provides
general provident fund,software for the employee information in
B.S.E.B. department and other details using the latest facilities as well
as following the sequential actions of the different phases in the
system development life cycle.

PATNA WOMEN’S COLLEGE Page 6


GPF MANAGMENT SYSTEM

Contents
Pag
e No

1. INTRODUCTION 7-17
2. FEASIBILITY STUDY 18-20
3. INITIAL INVESTIGATION 21-24
4. SYSTEM ANALYSIS 25-35
5. CODING AND SYSTEM DESIGN 36-249
6. SYSTEM TESTING AND 250-254
IMPLEMENTATION
7. RUN TIME WINDOWS 255-281
8. PROJECT MAINTAINANCE 279-282
9. BIBLIOGRAPHY 283-285

PATNA WOMEN’S COLLEGE Page 7


GPF MANAGMENT SYSTEM

INTRODUCTION

PATNA WOMEN’S COLLEGE Page 8


GPF MANAGMENT SYSTEM

About BSEB

BSEB was constituted under section 5 of Electricity supply Act, 1948


vide Bihar Government’s Notification number 2884-A/AI-121/57
dated 25th March , 1958 with effect from 1st April , 1958 . The Board
was given the responsibility of promoting coordinated development
of generation, Transmission and Distribution of Electricity in the state
in an efficient and economic manner.
The chairman heads the Bihar State Electricity Board and
there are posts of Member Administration. Member Finance,
Member Generation, Member Transmission and Member
Distribution.
At the Zonal level, Work is supervised by General
Managers-cum-Chief Engineers. A Chief Engineer is assisted by Suptd.
Engineers, Executive Engineers, Assistant Engineer and Junior
Engineer.

PATNA WOMEN’S COLLEGE Page 9


GPF MANAGMENT SYSTEM

ABOUT MY PROJECT

Introduction and objective of the project:

This software is developed for the organization “BIHAR STATE


ELECTRICITY BORAD” for handling the GPF management system”. This
electronic system has been designed to benefit the employees . this
software is made to work in place of existing system with some
added features, better management with the help of user-friendly
interface with an electronic speed and accuracy per excellence.
This project was very chanllenging because it has database of large
and complex information about employees. We have to maintain all
employees’ database along with their contribution, loan , refund etc
through this software. It has also the process of GPF yearly statement
to the employee.
To do all these processes, we have used JAVA due to its user-friendly
tools to develop interface & SQL SERVER 2005 for maintaining the
database as SQL server is secure , sharable, accurate and consistent
perspectives.
We tried to make this software almost customized, don’t have to
make any changes in database. Everything is handed through the
interface.

PATNA WOMEN’S COLLEGE Page 10


GPF MANAGMENT SYSTEM

OBJECTIVES

Our objective was to provide BSEB GPF Management System with


powerful , flexible and portable software . We tried to make such
software that fulfill the requirements of GPF management in the
BSEB dept. , and at the sane time in a full interactive , iconize
graphical and assistive manner. Among our objectives , we also
concentrated upon an effective and normalized database that will
act as the firm base for the software. This system is developed
with the expectations that it will decrease the work load of the
employee . The overall objectives of the software are as follows:-

 The aim of the proposed system is to provide complete


information to all department of the organization regarding
employee and their GPF calculation related information of the
employee.

 The proposed system gives accurate and instant reporting by


reducing man power requirement.

 The system provide queries and reliable at all level at any point
of time.

 This software can incorporate all the possible checks , control in


software itself.

PATNA WOMEN’S COLLEGE Page 11


GPF MANAGMENT SYSTEM

TOOLS AND ENVIRONEMENT USED

APPLICATION : GPF MANAGEMENT SYSTEM

OPERATING SYSTEM : WINDOWS XP

FRONT END : JAVA(jdk1.5.0)

BACK END : SQL SERVER 2005

PATNA WOMEN’S COLLEGE Page 12


GPF MANAGMENT SYSTEM

ABOUT WINDOW XP

Window XP is another version of windows operating system. It


was developed by Microsoft.
It has many improvedfeatures. It can be used in both stand alone
and network operating syatem.
It supports multiple user accounts. There are many new and
exciting features, which have make it very useful and highly
secure operating system.
Overall security has been improved, making it even safer for shop
and browse on the internet. Password facility for login is used and
the user cannot ignore it.
Windows XP represents the evolutionary step in the progress of
windows operating system . It is bigger, faster and more capable
than anything that has gone before.

PATNA WOMEN’S COLLEGE Page 13


GPF MANAGMENT SYSTEM

System requirements for Windows XP Home and


Professional editions as follows:

Minimum Recommended
Processor 233MHz 300 MHz /higher
Memory 64 MB RAM 128 MB RAM / higher
Video adapter Super VGA(800 x 600) or higher
and monitor resolution
Hard drive disk 1.5 GB or higher
Free spaces
Drives CD-ROM DRIVE or DVD DRIVE
Input devices Keyboard,Mouse or any compatible
pointing device
Sound Sound cards,Speakers or head
phones

PATNA WOMEN’S COLLEGE Page 14


GPF MANAGMENT SYSTEM

ABOUT SQL SERVER 2005

Introduction

SQL SERVER 2005 is one of the most popular Database


Management System used by most of the organization for storing
and maintaining the database of an enterprise. It falls under the
category of RDBMS(Relational Database Management System). It
is a backend language supporting largest of the databases ,
potentially terabytes in size.
In order to access data within the SQL Server database, all
programs and user’s must use SQL(Structured Query language).
SQL is the set of commands that is recognized by nearly all
RDBMS. It is a language that enables one to create and operate on
relational databases, which are sets of related information stored
in tables.
Features:

 Platform Independent
Network based architectures involve multiple hardware and
software plarforms and sql server delivers on all the major
platforms.

PATNA WOMEN’S COLLEGE Page 15


GPF MANAGMENT SYSTEM

 Client-Server Architecture
It is good to store data on server and provide facilities to access
data with restricted permission to the client. This feature can be
easily developed to SQL Server’s database.

 Data Security Feature


SQL Server database is a secure database. No one can view/edit
database without prior permission of the legal management
authority. Apart from these features SQL Server application
supports strong set of predefined modules such a good RDBMS
database.

PATNA WOMEN’S COLLEGE Page 16


GPF MANAGMENT SYSTEM

ABOUT JAVA

Introduction

Java is an object-oriented programming language that was designed


to meet the need for a platform independent language. Java is used
to create applications that can run on a single computer as well as a
distributed network . java is both a language and a technology used
to develop stand-alone and Internet-based applications.

Features:

(1) Simple: -
Java is a simple language that can be learned easily. A java
programmer does not need to know the internal details of java as to
how memory is allocated to data because in java , the programmer
does not need to handle memory manipulation.
(2) Object-oriented:-
Java supports the object-oriented approach to develop
programs.It supports various features of an object-oriented language,
such as abstraction , encapsulation , and polymorphism. The java
language does not support stand-alone statements.
(3) Compiled and Interpreted:-

PATNA WOMEN’S COLLEGE Page 17


GPF MANAGMENT SYSTEM

The java programs are the first compiled and then


interpreted. When we compile a java source code file (.java), the java
compiler generates the Bytecode , which is a compiled java program
with a .class extension. The Java Virtual Machine (JVM) then
interprets this Bytecode into the computer code and runs it.
(4) Portable:-

Portability refers to the ability of a program to run on any


platform without changing the source code of the program .
The program developed on one computer can run on another
computer, which might have a different platform . Java enables
the creation of representation called Java Bytecode.
(5) Distributed:-

Java is used to develop application that can be distributed


among various computers on the network. Java is designed for
the distributed environment of the Internet because it supports
the various Internet protocols, such as Transmission Control
Protocols and Internet Protocol (TCP/IP).
(6) Secure:-

Java has built-in security features that verify that the program
do not perform any destructive task, such as accessing the files
on a remote system. Java does not allow the use of explicit
pointers , which are used to refer to the memory locations in a
c++ program. All references to the memory are symbolic
references, which means that the programs cannot access
memory locations without proper authorization.

PATNA WOMEN’S COLLEGE Page 18


GPF MANAGMENT SYSTEM

FEASIBILITY
STUDY

PATNA WOMEN’S COLLEGE Page 19


GPF MANAGMENT SYSTEM

FEASIBILITY STUDY

INTRODUCTION

A feasibility study is an evaluation of a proposal , designed to


determine the difficulty in carrying out a designated task. It
determines whether a certain plan of action is feasible – that is ,
whether or not it work, and whether or not it is worth doing
economically . it evaluates the best system to choose in terms of
economic, technical and operational constraints. If the feasibility
study is to serve as a decision document, it must answer three key
questions:
o Is there a new and better way to do the job that will benefit the
user?
o What are the cost and savings and the alternative ?
o What is recommended?
In this phase , after conducting the feasibility, the candidates system,
which popped up is known as “BSEB”. The three key consideration
are involved in the feasibility analysis:
 Economic
 Technology and system feasibility
 Operational

Economic Feasibility

PATNA WOMEN’S COLLEGE Page 20


GPF MANAGMENT SYSTEM

It is better known as cost/benefit analysis, which determines


the benefits and savings that are expected from a candidate
system and compare them with costs. If benefits outweigh
costs, then the decision is made to design and implement the
system . Economic feasibility depends upon development cost,
operating cost , hardware cost.
To us, the cost incurred on the development of the system was
tolerable. That’s why proposed system was accepted as economically
feasible.
Technology and System Feasibility

The assessment is based on an outline design of system


requirements in terms of Input , Processes , Output , Fields,
Programs , and Procedures. This can be quantified in terms of
volumes of data , trends , frequency of updating, etc. In order
to estimate whether the new system will perform adequately or
not . Technological feasibility is a capability , in terms of
software, hardware , personnel and expertise,
to handle the completion of the project.
BSEB has all the needed hardware , software as well as good
computer operators to handle the software . Thereby the proposed
system was technically feasible to implement.
Operational Feasibility

It is a measure of how well a proposed system solves the


problems, and takes advantage of the opportunities identified
during scope definition and how it satisfies the requirements
identified in the requirements analysis phase of system
development. The proposed system will fulfill all the
PATNA WOMEN’S COLLEGE Page 21
GPF MANAGMENT SYSTEM

requirements of the organization . So the system was


operational feasible as well.

INITIAL
INVESTIGATION

PATNA WOMEN’S COLLEGE Page 22


GPF MANAGMENT SYSTEM

PROJECT LIFE CYCLE

The phased life-cycle model is most popular and best suitable


model for different kind of projects . So, it was decided that
Phases Life-Cycle Model would be followed for the Software-
Development Life Cycle Model.
The phased model segments the software life cycle into a series of
successive activities. Each phase requires well-defined products.
As per name this model breaks the project in different phases:
Analyst, Design, System Coding , Implementation and
Maintenance. Further refinements to the model include iteration
back to the previous stages in order to project designing and
development of project in phase wise. As it is easier and
beneficial. This model sometimes also known as Waterfall Model.

PATNA WOMEN’S COLLEGE Page 23


GPF MANAGMENT SYSTEM

Water fall model


Problem
Definition

Feasibility
Study

Analysis

Design

Coding

Testing

Implement
ation

Maintenance

PATNA WOMEN’S COLLEGE Page 24


GPF MANAGMENT SYSTEM

PROJECT EVOLUTION AND PLAN


BSEB project was based on phase model, so it was divided into
various phases. One of the difficult tasks was how to manage these
activities . For this purpose we decided to use the PERT chart
technique . PERT (Program Evaluation and Review Technique) is used
when there is good deal of uncertainty regarding the time taken by
various activities in the Project. Through PERT technique we find out
three estimates for each activity of the BSEB: most optimistic time ,
most pessimistic time , and the most likely time for completion of
each activity is known as events or milestones in the project.
On the basis the PERT technique we find out the events of the
different activities . This project plan is given below:
Stating date: 15th May,2011
Project schedule:

Project Activities Duration Status


Recognition of need 15/May/2011 20/May/2011 Complete

Feasibility Study 21/May/2011 01/July/2011 Complete

System analysis 02/June/201118/June/2011 Complete

System Design 19/July/2011 30/July/2011 Complete

Coding/debugging 01/July/2011 23/July/2011 Complete

System Testing 24/July/2011 10/Aug/2011 Complete

Implementation 11/Aug/2011 processing

PATNA WOMEN’S COLLEGE Page 25


GPF MANAGMENT SYSTEM

SYSTEM
ANALYSIS

PATNA WOMEN’S COLLEGE Page 26


GPF MANAGMENT SYSTEM

EXISTING SYSTEM

The existing system of BSEB is fully manual . For maintaining data


that are related to employee is handle by the employee . BSEB has
large number of employee and maintaining their record is difficult for
them because existing system has no GUI interface , not interactive
and not in assistive manner. And it is difficult and expensive too in
maintaining all the record manually . Also there is chance of loss
data.

Limitation with the Existing system:


 Delicacy of data.
 Inappropriate procedural flow.
 Difficult to retrieve right information.
 Limited reporting and less security.
 Inefficient method of record keeping.
 Data movement by paper
 No knowledge sharing.

PATNA WOMEN’S COLLEGE Page 27


GPF MANAGMENT SYSTEM

PROPOSED SYSTEM

After analyzing the existing system of GPF management system of


BSEB , the conclusion was drawn that the history and calculation of
each data is very much important . So all the activities subjected to a
data unit should be recorded correctly and must be calculated
accurately. Main objective of the proposed system is to reduce the
effort in managing the GPF system from existing system.

BENEFITS OF NEW PROPOSED SYSTEM


 Reduce operator workload.
 System is accurate, timely and comprehensive.
 System is flexible that can be changed according to the need
of the future.
 It provides high security.
 Reduction in duplication of efforts by updating at one place.
 Avoidance of errors.
 Various reports can be generated at any time.
 Quality improvements in overall system performance.
 Better control over the system even while making it more
flexible.

PATNA WOMEN’S COLLEGE Page 28


GPF MANAGMENT SYSTEM

ENTITY-RELATIONSHIP DIAGRAM
Designatio
n
GPF
Addres Month
contributo
s
n
Name Employe
Employe
e code DA
e code
Volume

EMPLOYEE GE GPF AC/NO


T

GE PAY GIVE
T N

REFUND YEARLY STATEMENT


LOAN

Date Balanc
Balanc Balance
Date of e (B/F)
e (C/F)
Employe of refun
e code issue d

Loan Refund LOAN


Employe
amoun amoun TAKEN
e AC/NO
t t

Employe
Insatllmen LOAN
e code
tamount REFUND

PATNA WOMEN’S COLLEGE Page 29


GPF MANAGMENT SYSTEM

DATA FLOW DIAGRAM

GPF
MANAGEMENT
SYSTEM

Employee Administrator

Level-0 DFD

PATNA WOMEN’S COLLEGE Page 30


GPF MANAGMENT SYSTEM

LEVEL-1 DFD
INTEND
1.0
ERROR MESSAGE REGISTRATION EMPINFO-DETAILS

LOAN-DETAILS
1.1
PROVIDE

GPF AC/NO 1.3

LOAN

1.2
GPF
CALCULATION

1.4
GPF-DETAILS
REFUND

REFUND-DETAILS

PATNA WOMEN’S COLLEGE Page 31


GPF MANAGMENT SYSTEM

Logical database designing

The fundamental objective of database design is to minimize the


usage of secondary memory spaces as well as to work efficiently and
easily . Some important modules in our project are as follows:

 Administrator module
 Employee detail module
 GPF calculation module
 Loan module
 Refund module

Administrator Module
The administrator module is basically designed for security purposes,
by which an authorized person of the company can access the data,
which has the permission to access the software by giving username,
password that means the information of the company is locked, by
username and password to protect from unauthorized accessibility.
Employee Details Module
The employee details module is designed for keeping the information
of employees. It keeps the basic information of a employee like
name, date of joining , address , designation , basic salary , nominee
names etc.

PATNA WOMEN’S COLLEGE Page 32


GPF MANAGMENT SYSTEM

GPF Calculation Module


The GPF calculation module is very important one of all these
modules because it is designed for calculating GPF of each employee.
This module contains all the information that are related to
calculation of a GPF like basic , contribution ,DA, loan refunded etc.

Loan Details Module


The loan module is designed for keeping the details of employee’s
loan. This module contains all attributes that are very important for
maintaining the loan like loan amount ,date of loan taken , no of
installment, installment amount ,purpose of loan etc.

Refund Details Module


The refund module is designed for keeping the information of
employee’s refund. This module keeps the details that are related to
loan refunded like loan amount , refund amount, date of refund, loan
balance etc.

PATNA WOMEN’S COLLEGE Page 33


GPF MANAGMENT SYSTEM

Data Structures for all the modules:

Login form structure

Attributes Data types Description


User_id Varchar(10) User id of administrator &
operator
User_passwd Varchar(20) Password of administrator
&operator
User_post Varchar(20) Designation of user

Employee details structure


Attributes Data types Description
Acno Varchar(6) Ac/no of employee
Code Varchar(6) Code of employee
Volume Varchar(2) Volume of employee
F_name Varchar(10) First name of employee
M_name Varchar(10) Middle name of employee
L_name Varchar(10) Last name of employee
Sex Varchar(6) Sex of employee
Designation Varchar(20) Designation of employee
Dob Date Date of birth
Doj Date Date of joining
Caste Varchar(15) Caste of employee
Religion Varchar(15) Religion of employee
Fa_name Varchar(30) Employee father’s name
M_no Varchar(10) Mobile no of employee
M_status Varchar(10) Marital status of employee

PATNA WOMEN’S COLLEGE Page 34


GPF MANAGMENT SYSTEM

S_name Varchar(30) Spouse name of employee


Add Varchar(40) Present address of employee
Add1 Varchar(40) Permanent address of
employee
Basic Float Basic salary of employee
Idmark Varchar(20) Identification mark of
employee
N_1name Varchar(30) Nominee1 name
N_2name Varchar(30) Nominee2 name
N_3name Varchar(30) Nominee3name
N_1age Varchar(2) Nominee1 age
N_2age Varchar(2) Nominee2 age
N_3age Varchar(2) Nominee 3 age
N_1relation Varchar(10) Nominee 1 relation
N_2relation Varchar(10) Nominee2 relation
N_3relation Varchar(10) Nominee3 relation
N_1pa Int Nominee1 payable part
N_2pa Int Nominee2 payable part
N_3pa Int Nominee3 payable part

GPF calculation structure

Attribute Data types Description


Acno Varchar(6) Ac/no of employee
Date Date Date of contribution
Contributed Float Amount contributed
DA Float DA given by company

PATNA WOMEN’S COLLEGE Page 35


GPF MANAGMENT SYSTEM

Loan details structure


Attribute Data types Description
Acno Varchar(6) Ac/no of employee
Date Date Date of loan taken
L_type Varchar(20) Type of loan
L_amount Float Loan amount taken
I_no Int No. of installment
I_amount Float Installment amount
Remarks Varchar(20) Purpose of loan

Refund details structure

Attributes Data types Description


Acno Varchar(6) Ac/no of employee
Date Date Date of loan refund
R_amt Float Refund amount
Balance Float Loan balance

GPF summary structure


Attributes Data types Description
Acno Varchar(6) Ac/no of employee
GPF_B_F Float GPF back forward
G_C Float GPF yearly contribution
Interest Int Interest given
Tot Float Contribution & interest

PATNA WOMEN’S COLLEGE Page 36


GPF MANAGMENT SYSTEM

G_total Float GPF carry Forward

CODING AND SYSTEM


DESIGN

PATNA WOMEN’S COLLEGE Page 37


GPF MANAGMENT SYSTEM

CODING IN SQL

1. User
create table user
(
User_id Varchar(10),
User_passwd Varchar(20),
User_post Varchar(20)
);
2. Empinfo

create table EMPINFO


(
Acno varchar(6),
Code Varchar(6),
Volume Varchar(2),
F_name Varchar(10),
M_name Varchar(10),
L_name Varchar(10),
Sex varchar(6),
Designation Varchar(20),
dob date,
doj date,
Caste Varchar(15),
Religion Varchar(15),
Fa_name varchar(30),
M_no varchar(10),
PATNA WOMEN’S COLLEGE Page 38
GPF MANAGMENT SYSTEM

M_status varchar(10),
S_name varchar(30),
Add Varchar(40),
Add1 Varchar(40),
basic float(6),
Idmark Varchar(20),
N_1name Varchar(30),
N_2name Varchar(30),
N_3name Varchar(30),
N_1age Varchar(2),
N_2age Varchar(2),
N_3age Varchar(2),
N_1relation Varchar(10),
N_2relation Varchar(10),
N_3relation varchar(10),
N_1pa int,
N_2pa int,
N_3pa int
);

3. gpf
create table gpf
(
Acno Varchar(6),
Date Date,
Contributed float(6),
DA float(6),
);

4. loan
create table loan
PATNA WOMEN’S COLLEGE Page 39
GPF MANAGMENT SYSTEM

(
Acno varchar(6),
Date date,
L_TYPE varchar(15),
L_amount float(6),
I_NO INT,
I_amount float(6),
Remarks varchar(20)
);

5. refund
create table refund
(
Acno varchar(6),
Date date,
R_amt float(6),
Balance float(6)
);

6. GPFSUMMARY
create table GPFSUMMARY
(
Acno varchar(6),
GPF_B_F float,
G_C float,
Interest int,
PATNA WOMEN’S COLLEGE Page 40
GPF MANAGMENT SYSTEM

Tot float,
G_total float
);

CODE FOR
LOGIN FORM

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
PATNA WOMEN’S COLLEGE Page 41
GPF MANAGMENT SYSTEM

import java.sql.*;
public class Login extends JFrame implements
ActionListener,Runnable
{
boolean pflag = false;
Thread thread1;
Connection cn;
PreparedStatement stmt;
ResultSet rs;
JScrollPane scrollPane;
GridBagLayout gb1 = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
JLabel lblhead = new JLabel("LOGIN
FOrm",JLabel.CENTER);
JPanel pnl = new JPanel(new GridLayout(1,3,10,20));
ImageIcon im = new ImageIcon("icon_sign.gif");
JLabel i = new JLabel(im,JLabel.LEFT);
ImageIcon logo = new ImageIcon("bseb-logo.jpg");
JLabel l = new JLabel(logo,JLabel.RIGHT);
JPanel pn = new JPanel(new GridLayout(1,15,5,10));
JTextField txtuid= new JTextField(10);
JPasswordField txtpwd = new JPasswordField(10);

PATNA WOMEN’S COLLEGE Page 42


GPF MANAGMENT SYSTEM

JButton login = new JButton("LOGIN");


JButton exit = new JButton("EXIT");
JButton create = new JButton("CREATE ");
JProgressBar pb = new JProgressBar();
public login()
{
JPanel panel1 = new JPanel()
{
};
panel1.setOpaque(false);
panel1.setPreferredSize(new Dimension(75,90));
panel1.setLayout(new GridLayout(1,3));
JPanel panel = new JPanel()
{
};
panel.setOpaque(false);
panel1.setPreferredSize(new Dimension(75,90));
scrollPane = new JScrollPane(panel);
getContentPane().add(scrollPane);
panel.setLayout(gb1);
add(panel1,BorderLayout.NORTH);
panel1.add(i);

PATNA WOMEN’S COLLEGE Page 43


GPF MANAGMENT SYSTEM

panel1.add(lblhead);
panel1.add(l);
panel1.setBackground(Color.WHITE);
lblhead.setFont(new Font("Times",Font.BOLD,20));
addcomp(1,0,1,1,new JLabel(" "),panel);
addcomp(2,0,1,1,new JLabel("USER ID"),panel);
addcomp(2,1,1,1,txtuid,panel);
addcomp(2,2,1,1,new JLabel(" "),panel);
addcomp(3,0,1,1,new JLabel("PASSWORD"),panel);
addcomp(3,1,1,1,txtpwd,panel);
addcomp(3,2,1,1,new JLabel(""),panel);
txtpwd.setEchoChar('*');
addcomp(4,0,110,0,pb,panel);
pb.setStringPainted(true);
pb.setForeground(Color.pink);
add(pn,BorderLayout.SOUTH);
pn.add(new JLabel(" "));
pn.add(login);
login.addActionListener(this);
pn.add(exit);
exit.addActionListener(this);
pn.add(create);

PATNA WOMEN’S COLLEGE Page 44


GPF MANAGMENT SYSTEM

create.addActionListener(this);
pn.add(new JLabel(""));
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(this,ex.toString());
}
setLocation(50,50);
setSize(500,400);
setTitle("LOGIN FORM");
setVisible(true);
}
public void addcomp(int row,int col,int wide,int
high,Component c , Container cn)
{
gbc.gridx = col;
gbc.gridy = row;
gbc.gridheight = high;
gbc.gridwidth = wide;

PATNA WOMEN’S COLLEGE Page 45


GPF MANAGMENT SYSTEM

gbc.fill = GridBagConstraints.BOTH;
gbc.weightx=1;
gbc.weighty=1;
gbc.insets = new Insets(2,2,2,2);
gb1.setConstraints(c,gbc);
cn.add(c);
if(c instanceof JButton)
((JButton)c).addActionListener(this);
}
public void actionPerformed(ActionEvent a)
{
if(a.getSource()==exit)
dispose();
if(a.getSource()==create)
{
this.dispose();
createuser usr= new createuser();
usr.setBounds(325,170,600,400);
}
if(a.getSource()==login)
{
thread1 = new Thread(this);

PATNA WOMEN’S COLLEGE Page 46


GPF MANAGMENT SYSTEM

pb.setValue(0);
pflag = true;
thread1.start();
}
}
public void run()
{
try
{
while(pflag)
{
if(pb.getValue()<100)
{
pb.setValue(pb.getValue()+5);
Thread.sleep(400);
}
else
{
pflag=false;
String uid = "",pwd="";
try
{

PATNA WOMEN’S COLLEGE Page 47


GPF MANAGMENT SYSTEM

cn=DriverManager.getConnection("jdbc:odbc:MYDATASOURC
E2","sa","kankarbagh");
stmt=cn.prepareStatement("select * from ACCOUNT where
username=? and password =?");
stmt.setString(1,txtuid.getText().trim());
stmt.setString(2,txtpwd.getText().trim());
ResultSet rs=stmt.executeQuery();
if(!rs.next())
{
JOptionPane.showMessageDialog(this,"UserId or password is
invalid");
txtuid.setText("");
txtpwd.setText("");
txtuid.requestFocus();
}
else
{
JOptionPane.showMessageDialog(this,"Welcome
"+rs.getString(1));
new Menu();
}
}
catch(Exception e)

PATNA WOMEN’S COLLEGE Page 48


GPF MANAGMENT SYSTEM

{
JOptionPane.showMessageDialog(this,e);
}
}
}
}
catch(InterruptedException e)
{
}
pb.setValue(0);
}
public static void main(String args[ ])
{
login obj = new login();
}
}

PATNA WOMEN’S COLLEGE Page 49


GPF MANAGMENT SYSTEM

CODE FOR CREATE USER FORM

import java.awt.*;
import java.sql.*;
import javax.swing.*;
import java.awt.event.*;
public class createuser extends JFrame implements
ActionListener
{
Connection cn;
Statement stmt;
ResultSet rs;
PATNA WOMEN’S COLLEGE Page 50
GPF MANAGMENT SYSTEM

JScrollPane scrollpane;
GridBagLayout gb1= new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
JLabel head = new JLabel("CREATE USER",JLabel.CENTER);
JPanel panel = new JPanel(new GridLayout(1,1,10,10));
ImageIcon logo = new ImageIcon("bseb-logo.jpg");
JLabel i = new JLabel(logo,JLabel.LEFT);
JLabel admin = new JLabel("ADMINISTRATOR ID");
JTextField tadmin = new JTextField(15);
JLabel password = new JLabel("PASSWORD");
JPasswordField tpassword = new JPasswordField(15);
JButton ok = new JButton("OK");
JLabel user = new JLabel(" USER NAME");
JTextField tuser = new JTextField(15);
JLabel userpwd = new JLabel(" PASSWORD");
JPasswordField tuserpwd = new JPasswordField(15);
JLabel confirmpwd = new JLabel("CONFIRM PASSWORD");
JPasswordField tconfirmpwd = new JPasswordField(15);
JLabel post = new JLabel(" POST");
JTextField tpost = new JTextField(15);
JButton search = new JButton("SEARCH");
JButton create = new JButton("CREATE");

PATNA WOMEN’S COLLEGE Page 51


GPF MANAGMENT SYSTEM

JButton cancel = new JButton("CANCEL");


Panel pnl = new Panel(new GridLayout(1,4,20,20));
public createuser()
{
JPanel panel1 = new JPanel()
{
};
panel1.setOpaque(false);
panel1.setPreferredSize(new Dimension(90,90));
panel1.setLayout(new GridLayout(1,3));
JPanel panel = new JPanel()
{
};
panel.setOpaque(false);
panel.setPreferredSize(new Dimension(90,70));
scrollpane = new JScrollPane(panel);
getContentPane().add(scrollpane);
panel.setLayout(gb1);
add(panel1,BorderLayout.NORTH);
panel1.add(i);
panel1.add(head);
head.setFont(new Font("Times",Font.BOLD,22));

PATNA WOMEN’S COLLEGE Page 52


GPF MANAGMENT SYSTEM

addcomp(1,0,1,1, admin,panel);
addcomp(1,1,1,1,tadmin,panel);
addcomp(1,2,1,1,password,panel);
addcomp(1,3,1,1,tpassword,panel);
addcomp(2,3,1,1,ok,panel);
add(pnl,BorderLayout.SOUTH);
pnl.add(new JLabel(" "));
pnl.add(cancel);
cancel.addActionListener(this);
pnl.add(create);
create.addActionListener(this);
pnl.add(new JLabel(" "));
user.setEnabled(false);
tuser.setEnabled(false);
userpwd.setEnabled(false);
tuserpwd.setEnabled(false);
confirmpwd.setEnabled(false);
confirmpwd.setEnabled(false);
post.setEnabled(false);
tpost.setEnabled(false);
addcomp(3,0,1,1,user,panel);
addcomp(3,1,1,1,tuser,panel);

PATNA WOMEN’S COLLEGE Page 53


GPF MANAGMENT SYSTEM

addcomp(4,0,1,1,userpwd,panel);
addcomp(4,1,1,1,tuserpwd,panel);
addcomp(5,0,1,1,confirmpwd,panel);
addcomp(5,1,1,1,tconfirmpwd,panel);
addcomp(6,0,1,1,post,panel);
addcomp(6,1,1,1,tpost,panel);
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(this,ex.toString());
}
setTitle("CREATE NEW USER");
setLocation(50,50);
setSize(600,400);
setVisible(true);
}
public void addcomp(int row,int col,int wide,int
high,Component com , Container cn)
{

PATNA WOMEN’S COLLEGE Page 54


GPF MANAGMENT SYSTEM

gbc.gridx = col;
gbc.gridy = row;
gbc.gridheight = high;
gbc.gridwidth = wide;
gbc.fill = GridBagConstraints.BOTH;
gbc.weightx=1;
gbc.weighty=1;
gbc.insets = new Insets(2,2,2,2);
gb1.setConstraints(com,gbc);
cn.add(com);
if(com instanceof JButton)
((JButton)com).addActionListener(this);
com.setFont(new Font("Times",Font.BOLD,15));
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==cancel)
{
dispose();
login usr = new login();
usr.setBounds(325,170,540,350);
}

PATNA WOMEN’S COLLEGE Page 55


GPF MANAGMENT SYSTEM

if(ae.getSource()==ok)
{
String uid="",pwd="",posts="";
try
{
cn =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE
5","sa","kankarbagh");
stmt = cn.createStatement();
rs=stmt.executeQuery("select username,password from
ACCOUNT where desg = 'administrator' and username =
'"+tadmin.getText()+"'");
while(rs.next())
{
uid = rs.getString(1).trim();
pwd = rs.getString(2).trim();
}
if(uid.equalsIgnoreCase(tadmin.getText())&&pwd.equals(S
tring.valueOf(tpassword.getPassword())))
{
user.setEnabled(true);
tuser.setEnabled(true);
userpwd.setEnabled(true);
tuserpwd.setEnabled(true);
PATNA WOMEN’S COLLEGE Page 56
GPF MANAGMENT SYSTEM

confirmpwd.setEnabled(true);
tconfirmpwd.setEnabled(true);
post.setEnabled(true);
tpost.setEnabled(true);
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e.toString());
}
}
if(ae.getSource()==create)
{
try
{
cn =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE
5","sa","kankarbagh");
stmt = cn.createStatement();
stmt.executeUpdate("insert into ACCOUNT
values('"+tuser.getText()+"','"+new
String(tuserpwd.getPassword())+"','"+tpost.getText()
+"')");

PATNA WOMEN’S COLLEGE Page 57


GPF MANAGMENT SYSTEM

JOptionPane.showMessageDialog(this,"NEW USER
CREATED");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e.toString());
}
}
}
public static void main(String [] args)
{
createuser obj = new createuser();
}
}

PATNA WOMEN’S COLLEGE Page 58


GPF MANAGMENT SYSTEM

CODE FOR MAIN FORM

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
public class Menu extends JFrame
{
PATNA WOMEN’S COLLEGE Page 59
GPF MANAGMENT SYSTEM

public Menu()
{
setTitle("Menu");
setSize(700, 700);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar)
JMenu fileMenu = new JMenu("File");
JMenu transMenu = new JMenu("Transaction");
JMenu queryMenu = new JMenu("Query");
JMenu reportMenu = new JMenu("Report");
JMenu quitMenu = new JMenu("Quit");
menuBar.add(fileMenu);
menuBar.add(transMenu);
menuBar.add(queryMenu);
menuBar.add(reportMenu);
menuBar.add(quitMenu);
JMenuItem entryAction = new JMenuItem("Entry");
JMenuItem openAction = new JMenuItem("Employee
detail");
JMenuItem loanAction = new JMenuItem("Loan");
JMenuItem refundAction = new JMenuItem("Refund");
JMenuItem updateAction = new JMenuItem("Update");
JMenuItem deleteAction = new JMenuItem("Delete");

PATNA WOMEN’S COLLEGE Page 60


GPF MANAGMENT SYSTEM

JMenuItem gpfAction = new JMenuItem("GPF");


JMenuItem ldetAction = new JMenuItem("Loan details");
JMenuItem exitAction = new JMenuItem("Exit");
JMenuItem rdetAction = new JMenuItem("Refund
details");
JMenuItem employeeAction = new JMenuItem("Employee
wise");
JMenuItem monthAction = new JMenuItem("Month
wise");
JMenuItem yearAction = new JMenuItem("Year wise");
fileMenu.add(entryAction);
fileMenu.add(updateAction);
fileMenu.add(deleteAction);
transMenu.add(gpfAction);
transMenu.add(loanAction);
transMenu.add(refundAction);
queryMenu.add(openAction);
queryMenu.add(ldetAction);
queryMenu.add(gpfdetAction);
reportMenu.add(employeeAction);
reportMenu.add(monthAction);
reportMenu.add(yearAction);
quitMenu.add(exitAction);
entryAction.addActionListener(new ActionListener() {
PATNA WOMEN’S COLLEGE Page 61
GPF MANAGMENT SYSTEM

public void actionPerformed(ActionEvent arg0) {


new Registration();
}
}
);
openAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new show();
}
}
);
updateAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new modify();
}
});
deleteAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new delete();
}
}
);

PATNA WOMEN’S COLLEGE Page 62


GPF MANAGMENT SYSTEM

ldetAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new loandet();
}
}
);
rdetAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new gpfdet();
}
}
);
gpfAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new GPF();
}
}
);
loanAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new loan();
}

PATNA WOMEN’S COLLEGE Page 63


GPF MANAGMENT SYSTEM

}
);
refundAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
refund rd = new refund();
}
}
);
employeeAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new empreport();
}
}
);
monthAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new monthreport();
}
}
);
yearAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {

PATNA WOMEN’S COLLEGE Page 64


GPF MANAGMENT SYSTEM

new yearreport();
}
}
);
exitAction.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
dispose();
}
}
);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
setTitle("Main Form");
}
public static void main(String[] args) {
Menu me = new Menu();
}
}

PATNA WOMEN’S COLLEGE Page 65


GPF MANAGMENT SYSTEM

CODE FOR REGISTRATION FORM

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class Registration extends JFrame implements
ActionListener
{
JPanel panel;
JLabel Head;

PATNA WOMEN’S COLLEGE Page 66


GPF MANAGMENT SYSTEM

JLabel Head1;
JLabel lID;
JLabel lacno;
JLabel lvolume;
JLabel lfname;
JLabel lmname;
JLabel llname;
JLabel lsex;
JLabel lDesignation;
JLabel lDOB;
JLabel ldoj;
JLabel lcaste;
JLabel lreligion;
JLabel lfathername;
JLabel lmobileno;
JLabel lmaritalstatus;
JLabel lspousename;
JLabel lAddress;
JLabel lAddress1;
JLabel lbasic;
JLabel lidmark;
JLabel lnominee1;

PATNA WOMEN’S COLLEGE Page 67


GPF MANAGMENT SYSTEM

JLabel lnominee2;
JLabel lnominee3;
JLabel lnom1age;
JLabel lnom2age;
JLabel lnom3age;
JLabel lnom1relation;
JLabel lnom2relation;
JLabel lnom3relation;
JLabel lnom1pa;
JLabel lnom2pa;
JLabel lnom3pa;
JLabel lstate;
JLabel lcity;
JButton submit;
JButton reset;
JButton exit;
JTextField tID;
JTextField tacno;
JTextField tvolume;
JTextField tfname;
JTextField tmname;
JTextField tlname;

PATNA WOMEN’S COLLEGE Page 68


GPF MANAGMENT SYSTEM

JTextField tsex;
JTextField tDesignation;
JTextField tDOB;
JTextField tdoj;
JTextField tfathername;
JTextField tmobileno;
JTextField tspousename;
JTextField tAddress;
JTextField tidmark;
JTextField tnominee1;
JTextField tnominee2;
JTextField tnominee3;
JTextField tAddress1;
JTextField tnom1age;
JTextField tnom2age;
JTextField tnom3age;
JTextField tnom1relation;
JTextField tnom2relation;
JTextField tnom3relation;
JTextField tnom1pa;
JTextField tnom2pa;
JTextField tnom3pa;

PATNA WOMEN’S COLLEGE Page 69


GPF MANAGMENT SYSTEM

JTextField tstate;
JTextField tcity;
JTextField tbasic;
JComboBox cb1;
JComboBox cb2;
JComboBox cb3;
JComboBox cb4;
JRadioButton rb1;
JRadioButton rb2;
GridBagLayout g;
GridBagConstraints gbc;
Connection con;
PreparedStatement stat;
public Registration()
{
g = new GridBagLayout();
gbc = new GridBagConstraints();
panel = (JPanel)getContentPane();
panel.setLayout(null);
ImageIcon im = new ImageIcon("bseb-logo.jpg");
JLabel logo = new JLabel(im,JLabel.LEFT);
logo.setBounds(400,2,120,100);

PATNA WOMEN’S COLLEGE Page 70


GPF MANAGMENT SYSTEM

panel.add(logo);
ImageIcon i = new ImageIcon("icon_reg.gif");
JLabel blogo = new JLabel(i,JLabel.LEFT);
blogo.setBounds(0,0,84,70);
panel.add(blogo);
Head=new JLabel("GPF REGISTRATION FORM");
Head.setFont(new Font("Times",Font.BOLD,20));
Head.setBounds(500,25,900,30);
panel.add(Head);
lID= new JLabel("CODE");
lID.setFont(new Font("Times",Font.BOLD,15));
lID.setBounds(40,35,90,100);
panel.add(lID);
tID = new JTextField(5);
tID.setFont(new Font("Times",Font.BOLD,15));
tID.setBounds(250,70,90,30);
panel.add(tID);
lacno= new JLabel("AC/NO");
lacno.setBounds(600,35,90,100);
lacno.setFont(new Font("Times",Font.BOLD,15));
panel.add(lacno);
tacno = new JTextField(5);

PATNA WOMEN’S COLLEGE Page 71


GPF MANAGMENT SYSTEM

tacno.setFont(new Font("Times",Font.BOLD,15));
tacno.setBounds(760,70,90,30);
panel.add(tacno);
lvolume= new JLabel("VOLUME");
lvolume.setBounds(920,35,90,100);
lvolume.setFont(new Font("Times",Font.BOLD,15));
panel.add(lvolume);
cb1= new JComboBox();
cb1.addItem("1");
cb1.addItem("2");
cb1.addItem("3");
cb1.addItem("4");
cb1.addItem("5");
cb1.addItem("6");
cb1.addItem("7");
cb1.addItem("8");
cb1.addItem("9");
cb1.setBounds(1050,70,90,30);
cb1.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb1);
lfname= new JLabel("FIRST NAME");
lfname.setBounds(40,35,100,200);

PATNA WOMEN’S COLLEGE Page 72


GPF MANAGMENT SYSTEM

lfname.setFont(new Font("Times",Font.BOLD,15));
panel.add(lfname);
tfname = new JTextField(30);
tfname.setFont(new Font("Times",Font.BOLD,15));
tfname.setBounds(250,120,90,30);
panel.add(tfname);
lmname= new JLabel("MIDDLE NAME");
lmname.setBounds(600,35,150,200);
lmname.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmname);
tmname = new JTextField(30);
tmname.setFont(new Font("Times",Font.BOLD,15));
tmname.setBounds(760,120,90,30);
panel.add(tmname);
llname= new JLabel("LAST NAME");
llname.setBounds(920,35,150,200);
llname.setFont(new Font("Times",Font.BOLD,15));
panel.add(llname);
tlname = new JTextField(15);
tlname.setFont(new Font("Times",Font.BOLD,15));
tlname.setBounds(1050,120,90,30);
panel.add(tlname);

PATNA WOMEN’S COLLEGE Page 73


GPF MANAGMENT SYSTEM

lsex = new JLabel("SEX");


lsex.setBounds(40,35,90,300);
lsex.setFont(new Font("Times",Font.BOLD,15));
panel.add(lsex);
rb1 = new JRadioButton("MALE");
rb2 = new JRadioButton("FEMALE");
ButtonGroup bg = new ButtonGroup();
rb1.setBounds(250,170,80,30);
rb1.setFont(new Font("Times",Font.BOLD,15));
rb2.setBounds(340,170,100,30);
rb2.setFont(new Font("Times",Font.BOLD,15));
panel.add(rb1);
panel.add(rb2);
bg.add(rb1);
bg.add(rb2);
lDesignation = new JLabel("DESIGNATION");
lDesignation.setBounds(600,35,150,300);
lDesignation.setFont(new Font("Times",Font.BOLD,15));
panel.add(lDesignation);
tDesignation = new JTextField(20);
tDesignation.setFont(new Font("Times",Font.BOLD,15));
tDesignation.setBounds(760,170,150,30);

PATNA WOMEN’S COLLEGE Page 74


GPF MANAGMENT SYSTEM

panel.add(tDesignation);
lDOB = new JLabel("DATE OF BIRTH");
lDOB.setBounds(40,35,150,400);
lDOB.setFont(new Font("Times",Font.BOLD,15));
panel.add(lDOB);
tDOB = new JTextField(30);
tDOB.setFont(new Font("Times",Font.BOLD,15));
tDOB.setBounds(250,220,90,30);
panel.add(tDOB);
ldoj = new JLabel("DATE OF JOINING");
ldoj.setBounds(600,30,150,400);
ldoj.setFont(new Font("Times",Font.BOLD,15));
panel.add(ldoj);
tdoj = new JTextField(30);
tdoj.setFont(new Font("Times",Font.BOLD,15));
tdoj.setBounds(760,220,90,30);
panel.add(tdoj);
lcaste = new JLabel("CASTE");
lcaste.setBounds(40,35,90,500);
lcaste.setFont(new Font("Times",Font.BOLD,15));
panel.add(lcaste);
cb4= new JComboBox();

PATNA WOMEN’S COLLEGE Page 75


GPF MANAGMENT SYSTEM

cb4.addItem("GENERAL");
cb4.addItem("SC");
cb4.addItem("ST");
cb4.addItem("OBC");
cb4.setBounds(250,270,110,30);
cb4.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb4);
lreligion = new JLabel("RELIGION");
lreligion.setBounds(600,35,90,500);
lreligion.setFont(new Font("Times",Font.BOLD,15));
panel.add(lreligion);
cb2= new JComboBox();
cb2.addItem("HINDU");
cb2.addItem("MUSLIM");
cb2.addItem("CHRISTIAN");
cb2.addItem("SHIKH");
cb2.setBounds(760,270,90,30);
cb2.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb2);
lfathername = new JLabel("FATHER'S NAME");
lfathername.setBounds(40,35,140,600);
lfathername.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 76


GPF MANAGMENT SYSTEM

panel.add(lfathername);
tfathername = new JTextField(30);
tfathername.setFont(new Font("Times",Font.BOLD,15));
tfathername.setBounds(250,320,200,30);
panel.add(tfathername);
lmobileno = new JLabel("MOBILE NO");
lmobileno.setBounds(600,35,140,600);
lmobileno.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmobileno);
tmobileno = new JTextField(30);
tmobileno.setFont(new Font("Times",Font.BOLD,15));
tmobileno.setBounds(760,320,90,30);
panel.add(tmobileno);
lmaritalstatus = new JLabel("MARITAL STATUS");
lmaritalstatus.setBounds(40,35,150,700);
lmaritalstatus.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmaritalstatus);
cb3 = new JComboBox();
cb3.addItem("SINGLE");
cb3.addItem("MARRIED");
cb3.addItem("WIDOW");
cb3.setBounds(250,370,100,30);

PATNA WOMEN’S COLLEGE Page 77


GPF MANAGMENT SYSTEM

cb3.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb3);
lspousename = new JLabel("SPOUSE NAME");
lspousename.setBounds(40,35,150,800);
lspousename.setFont(new Font("Times",Font.BOLD,15));
panel.add(lspousename);
tspousename = new JTextField(30);
tspousename.setFont(new Font("Times",Font.BOLD,15));
lspousename.setFont(new Font("Times",Font.BOLD,15));
tspousename.setBounds(250,420,200,30);
panel.add(tspousename);
lAddress = new JLabel("PRESENT ADDRESS");
lAddress.setBounds(40,35,150,900);
lAddress.setFont(new Font("Times",Font.BOLD,15));
panel.add(lAddress);
tAddress = new JTextField(30);
tAddress.setFont(new Font("Times",Font.BOLD,15));
tAddress.setBounds(250,470,200,30);
panel.add(tAddress);
lAddress1 = new JLabel("PERMANENT ADDRESS");
lAddress1.setBounds(600,35,200,900);
lAddress1.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 78


GPF MANAGMENT SYSTEM

panel.add(lAddress1);
tAddress1 = new JTextField(30);
tAddress1.setFont(new Font("Times",Font.BOLD,15));
tAddress1.setBounds(780,470,200,30);
panel.add(tAddress1);
lbasic = new JLabel("BASIC SALARY");
lbasic.setBounds(40,35,200,1000);
lbasic.setFont(new Font("Times",Font.BOLD,15));
panel.add(lbasic);
tbasic = new JTextField(30);
tbasic.setFont(new Font("Times",Font.BOLD,15));
tbasic.setBounds(250,520,90,30);
panel.add(tbasic);
lidmark = new JLabel("IDENTIFICATION MARK");
lidmark.setBounds(600,35,200,1000);
lidmark.setFont(new Font("Times",Font.BOLD,15));
panel.add(lidmark);
tidmark = new JTextField(30);
tidmark.setFont(new Font("Times",Font.BOLD,15));
tidmark.setBounds(780,520,200,30);
panel.add(tidmark);
lnominee1 = new JLabel("NOMINEE 1");

PATNA WOMEN’S COLLEGE Page 79


GPF MANAGMENT SYSTEM

lnominee1.setBounds(40,30,100,1100);
lnominee1.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnominee1);
tnominee1 = new JTextField(30);
tnominee1.setFont(new Font("Times",Font.BOLD,15));
tnominee1.setBounds(250,570,150,30);
panel.add(tnominee1);
lnom1age = new JLabel("AGE");
lnom1age.setBounds(440,30,90,1100);
lnom1age.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnom1age);
tnom1age = new JTextField(2);
tnom1age.setFont(new Font("Times",Font.BOLD,15));
tnom1age.setBounds(490,570,90,30);
panel.add(tnom1age);
lnom1relation = new JLabel("RELATION");
lnom1relation.setFont(new Font("Times",Font.BOLD,15));
lnom1relation.setBounds(600,30,90,1100);
panel.add(lnom1relation);
tnom1relation = new JTextField(15);
tnom1relation.setFont(new Font("Times",Font.BOLD,15));
tnom1relation.setBounds(690,570,90,30);

PATNA WOMEN’S COLLEGE Page 80


GPF MANAGMENT SYSTEM

panel.add(tnom1relation);
lnom1pa = new JLabel("PAYABLE AMOUNT");
lnom1pa.setFont(new Font("Times",Font.BOLD,15));
lnom1pa.setBounds(800,30,150,1100);
panel.add(lnom1pa);
tnom1pa = new JTextField(15);
tnom1pa.setFont(new Font("Times",Font.BOLD,15));
tnom1pa.setBounds(950,570,90,30);
panel.add(tnom1pa);
lnominee2 = new JLabel("NOMINEE 2");
lnominee2.setFont(new Font("Times",Font.BOLD,15));
lnominee2.setBounds(40,35,100,1160);
panel.add(lnominee2);
tnominee2 = new JTextField(30);
tnominee2.setFont(new Font("Times",Font.BOLD,15));
tnominee2.setBounds(250,600,150,30);
panel.add(tnominee2);
lnom2age = new JLabel("AGE");
lnom2age.setFont(new Font("Times",Font.BOLD,15));
lnom2age.setBounds(440,35,90,1160);
panel.add(lnom2age);
tnom2age = new JTextField(2);

PATNA WOMEN’S COLLEGE Page 81


GPF MANAGMENT SYSTEM

tnom2age.setFont(new Font("Times",Font.BOLD,15));
tnom2age.setBounds(490,600,90,30);
panel.add(tnom2age);
lnom2relation = new JLabel("RELATION");
lnom2relation.setBounds(600,35,90,1160);
lnom2relation.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnom2relation);
tnom2relation = new JTextField(15);
tnom2relation.setFont(new Font("Times",Font.BOLD,15));
tnom2relation.setBounds(690,600,90,30);
panel.add(tnom2relation);
lnom2pa = new JLabel("PAYABLE AMOUNT");
lnom2pa.setFont(new Font("Times",Font.BOLD,15));
lnom2pa.setBounds(800,35,150,1160);
panel.add(lnom2pa);
tnom2pa = new JTextField(15);
tnom2pa.setFont(new Font("Times",Font.BOLD,15));
tnom2pa.setBounds(950,600,90,30);
panel.add(tnom2pa);
lnominee3 = new JLabel("NOMINEE 3");
lnominee3.setBounds(40,35,100,1230);
lnominee3.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 82


GPF MANAGMENT SYSTEM

panel.add(lnominee3);
tnominee3 = new JTextField(30);
tnominee3.setFont(new Font("Times",Font.BOLD,15));
tnominee3.setBounds(250,630,150,30);
panel.add(tnominee3);
lnom3age = new JLabel(" AGE");
lnom3age.setFont(new Font("Times",Font.BOLD,15));
lnom3age.setBounds(440,35,90,1230);
panel.add(lnom3age);
tnom3age = new JTextField(2);
tnom3age.setFont(new Font("Times",Font.BOLD,15));
tnom3age.setBounds(490,630,90,30);
panel.add(tnom3age);
lnom3relation = new JLabel("RELATION");
lnom3relation.setFont(new Font("Times",Font.BOLD,15));
lnom3relation.setBounds(600,35,90,1230);
panel.add(lnom3relation);
tnom3relation =new JTextField(15);
tnom3relation.setFont(new Font("Times",Font.BOLD,15));
tnom3relation.setBounds(690,630,90,30);
panel.add(tnom3relation);
lnom3pa = new JLabel("PAYABLE AMOUNT");

PATNA WOMEN’S COLLEGE Page 83


GPF MANAGMENT SYSTEM

lnom3pa.setFont(new Font("Times",Font.BOLD,15));
lnom3pa.setBounds(800,35,150,1230);
panel.add(lnom3pa);
tnom3pa = new JTextField(15);
tnom3pa.setFont(new Font("Times",Font.BOLD,15));
tnom3pa.setBounds(950,630,90,30);
panel.add(tnom3pa);
JButton submit = new JButton("SAVE");
submit.setFont(new Font("Times",Font.BOLD,15));
submit.setActionCommand("submit");
submit.setBounds(1100,400,80,40);
panel.add(submit);
JButton reset = new JButton("RESET");
reset.setFont(new Font("Times",Font.BOLD,15));
reset.setActionCommand("reset");
reset.setBounds(1100,500,90,40);
panel.add(reset);
JButton exit = new JButton("EXIT");
exit.setActionCommand("exit");
exit.setFont(new Font("Times",Font.BOLD,15));
exit.setBounds(1100,600,80,40);
panel.add(exit);

PATNA WOMEN’S COLLEGE Page 84


GPF MANAGMENT SYSTEM

exit.addActionListener(this);
submit.addActionListener(this);
reset.addActionListener(this);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(1220,720);
setVisible(true);
setTitle("Registration details");
panel.setBackground(Color.pink);
}
public void actionPerformed(ActionEvent ae){
if(ae.getActionCommand() == "submit"){
Try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE2",
"sa","kankarbagh");
stat=con.prepareStatement("INSERT INTO EMPINFO
VALUES(? , ?,? , ? , ? , ? , ? , ? , ? , ? , ? ,?, ? , ? ,? , ? , ? , ? , ?, ?, ?, ? , ? ,
? , ? , ? , ? , ? , ? , ? , ? , ? )");
String ID = tID.getText();
String acno = tacno.getText();
String volume = cb1.getSelectedItem().toString();
String fname = tfname.getText();

PATNA WOMEN’S COLLEGE Page 85


GPF MANAGMENT SYSTEM

String mname = tmname.getText();


String lname = tlname.getText();
String sex="";
if(rb1.isSelected()) {
sex="MALE";}
if(rb2.isSelected()){
sex="FEMALE";}
String desig = tDesignation.getText();
String dob = tDOB.getText();
String doj = tdoj.getText();
String caste = cb4.getSelectedItem().toString();
String religion = cb2.getSelectedItem().toString();
String fathername = tfathername.getText();
String mobileno=tmobileno.getText();
String spousename = tspousename.getText();
String address = tAddress.getText();
String address1 = tAddress1.getText();
String basic = tbasic.getText();
String idmark = tidmark.getText();
String maritalstatus =cb3.getSelectedItem().toString();
String nom1 = tnominee1.getText();
String nom2 = tnominee2.getText();

PATNA WOMEN’S COLLEGE Page 86


GPF MANAGMENT SYSTEM

String nom3 = tnominee3.getText();


String nom1relation = tnom1relation.getText();
String nom2relation= tnom2relation.getText();
String nom3relation = tnom3relation.getText();
String nom1age = tnom1age.getText();
String nom2age = tnom2age.getText();
String nom3age = tnom3age.getText();
String nom1pa = tnom1pa.getText();
String nom2pa = tnom2pa.getText();
String nom3pa = tnom3pa.getText();
stat.setString(1,ID);
stat.setString(2, acno);
stat.setString(3, volume);
stat.setString(4, fname);
stat.setString(5, mname);
stat.setString(6, lname);
stat.setString(7, sex);
stat.setString(8, desig);
stat.setString(9, dob);
stat.setString(10, doj );
stat.setString(11, caste);
stat.setString(12,religion);

PATNA WOMEN’S COLLEGE Page 87


GPF MANAGMENT SYSTEM

stat.setString(13, fathername);
stat.setString(14,mobileno);
stat.setString(15, maritalstatus);
stat.setString(16, spousename);
stat.setString(17,address);
stat.setString(18,address1);
stat.setFloat(19,Float.parseFloat(basic));
stat.setString(20,idmark);
stat.setString(21, nom1);
stat.setString(22, nom2);
stat.setString(23, nom3);
stat.setString(24, nom1age);
stat.setString(25, nom2age);
stat.setString(26, nom3age);
stat.setString(27, nom1relation);
stat.setString(28, nom2relation);
stat.setString(29, nom3relation);
stat.setInt(30,Integer.parseInt( nom1pa));
stat.setInt(31, Integer.parseInt(nom2pa));
stat.setInt(32, Integer.parseInt(nom3pa));
stat.executeUpdate();
JOptionPane.showMessageDialog(this,"Inserted
Sucessfully");

PATNA WOMEN’S COLLEGE Page 88


GPF MANAGMENT SYSTEM

}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e);
}
}
if(ae.getActionCommand() == "reset")
{
tID.setText(" ");
tacno.setText(" ");
tfname.setText(" ");
tmname.setText(" ");
tlname.setText("");
tDesignation.setText(" ");
tDOB.setText("");
tdoj.setText("");
tfathername.setText(" ");
tmobileno.setText("");
tspousename.setText(" ");
tAddress.setText("");
tAddress1.setText("");
tbasic.setText("");

PATNA WOMEN’S COLLEGE Page 89


GPF MANAGMENT SYSTEM

tidmark.setText(" ");
tnominee1.setText("");
tnominee2.setText("");
tnominee3.setText("");
tnom1age.setText("");
tnom2age.setText("");
tnom3age.setText("");
tnom1relation.setText("");
tnom2relation.setText("");
tnom3relation.setText("");
tnom1pa.setText("");
tnom2pa.setText("");
tnom3pa.setText("");
}
if(ae.getActionCommand() == "exit")
dispose();
}
public static void main(String[] args){
Registration reg=new Registration();
}
}
}

PATNA WOMEN’S COLLEGE Page 90


GPF MANAGMENT SYSTEM

CODE FOR UPDATE FORM

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class modify extends JFrame implements
ActionListener
{
JPanel panel;
JLabel Head;
JLabel Head1;
JLabel lID;

PATNA WOMEN’S COLLEGE Page 91


GPF MANAGMENT SYSTEM

JLabel lacno;
JLabel lvolume;
JLabel lfname;
JLabel lmname;
JLabel llname;
JLabel lsex;
JLabel lDesignation;
JLabel lDOB;
JLabel ldoj;
JLabel lcaste;
JLabel lreligion;
JLabel lfathername;
JLabel lmobileno;
JLabel lmaritalstatus;
JLabel lspousename;
JLabel lAddress;
JLabel lAddress1;
JLabel lbasic;
JLabel lidmark;
JLabel lnominee1;
JLabel lnominee2;
JLabel lnominee3;

PATNA WOMEN’S COLLEGE Page 92


GPF MANAGMENT SYSTEM

JLabel lnom1age;
JLabel lnom2age;
JLabel lnom3age;
JLabel lnom1relation;
JLabel lnom2relation;
JLabel lnom3relation;
JLabel lnom1pa;
JLabel lnom2pa;
JLabel lnom3pa;
JLabel lstate;
JLabel lcity;
JButton show;
JButton reset;
JButton exit;
JButton update;
JTextField tID;
JTextField tacno;
JTextField tvolume;
JTextField tfname;
JTextField tmname;
JTextField tlname;
JTextField tDesignation;

PATNA WOMEN’S COLLEGE Page 93


GPF MANAGMENT SYSTEM

JTextField tDOB;
JTextField tdoj;
JTextField tfathername;
JTextField tmobileno;
JTextField tspousename;
JTextField tAddress;
JTextField tAddress1;
JTextField tbasic;
JTextField tidmark;
JTextField tnominee1;
JTextField tnominee2;
JTextField tnominee3;
JTextField tnom1age;
JTextField tnom2age;
JTextField tnom3age;
JTextField tnom1relation;
JTextField tnom2relation;
JTextField tnom3relation;
JTextField tnom1pa;
JTextField tnom2pa;
JTextField tnom3pa;
JTextField tstate;

PATNA WOMEN’S COLLEGE Page 94


GPF MANAGMENT SYSTEM

JTextField tcity;
JComboBox cb1;
JComboBox cb2;
JComboBox cb3;
JComboBox cb4;
JRadioButton rb1;
JRadioButton rb2;
GridBagLayout g;
GridBagConstraints gbc;
Connection con;
PreparedStatement stmt;
public modify()
{
g = new GridBagLayout();
gbc = new GridBagConstraints();
panel = (JPanel)getContentPane();
panel.setLayout(null);
ImageIcon im = new ImageIcon("bseb-logo.jpg");
JLabel logo = new JLabel(im,JLabel.LEFT);
logo.setBounds(400,2,120,100);
panel.add(logo);
ImageIcon i = new ImageIcon("icon_reg.gif");

PATNA WOMEN’S COLLEGE Page 95


GPF MANAGMENT SYSTEM

JLabel blogo = new JLabel(i,JLabel.LEFT);


blogo.setBounds(0,0,84,70);
panel.add(blogo);
Head=new JLabel("UPDATE RECORD");
Head.setFont(new Font("Times",Font.BOLD,20));
Head.setBounds(500,25,900,30);
panel.add(Head);
lID= new JLabel("CODE");
lID.setFont(new Font("Times",Font.BOLD,15));
lID.setBounds(40,35,90,100);
panel.add(lID);
tID = new JTextField(5);
tID.setFont(new Font("Times",Font.BOLD,15));
tID.setBounds(250,70,90,30);
panel.add(tID);
lacno= new JLabel("AC/NO");
lacno.setBounds(600,35,90,100);
lacno.setFont(new Font("Times",Font.BOLD,15));
panel.add(lacno);
tacno = new JTextField(5);
tacno.setFont(new Font("Times",Font.BOLD,15));
tacno.setBounds(760,70,90,30);

PATNA WOMEN’S COLLEGE Page 96


GPF MANAGMENT SYSTEM

panel.add(tacno);
lvolume= new JLabel("VOLUME");
lvolume.setBounds(920,35,90,100);
lvolume.setFont(new Font("Times",Font.BOLD,15));
panel.add(lvolume);
cb1= new JComboBox();
cb1.addItem("1");
cb1.addItem("2");
cb1.addItem("3");
cb1.addItem("4");
cb1.addItem("5");
cb1.addItem("6");
cb1.addItem("7");
cb1.addItem("8");
cb1.addItem("9");
cb1.setBounds(1050,70,90,30);
cb1.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb1);
lfname= new JLabel("FIRST NAME");
lfname.setBounds(40,35,100,200);
lfname.setFont(new Font("Times",Font.BOLD,15));
panel.add(lfname);

PATNA WOMEN’S COLLEGE Page 97


GPF MANAGMENT SYSTEM

tfname = new JTextField(30);


tfname.setFont(new Font("Times",Font.BOLD,15));
tfname.setBounds(250,120,90,30);
panel.add(tfname);
lmname= new JLabel("MIDDLE NAME");
lmname.setBounds(600,35,150,200);
lmname.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmname);
tmname = new JTextField(30);
tmname.setFont(new Font("Times",Font.BOLD,15));
tmname.setBounds(760,120,90,30);
panel.add(tmname);
llname= new JLabel("LAST NAME");
llname.setBounds(920,35,150,200);
llname.setFont(new Font("Times",Font.BOLD,15));
panel.add(llname);
tlname = new JTextField(15);
tlname.setFont(new Font("Times",Font.BOLD,15));
tlname.setBounds(1050,120,90,30);
panel.add(tlname);
lsex = new JLabel("SEX");
lsex.setBounds(40,35,90,300);

PATNA WOMEN’S COLLEGE Page 98


GPF MANAGMENT SYSTEM

lsex.setFont(new Font("Times",Font.BOLD,15));
panel.add(lsex);
rb1 = new JRadioButton("MALE");
rb2 = new JRadioButton("FEMALE");
ButtonGroup bg = new ButtonGroup();
rb1.setBounds(250,170,80,30);
rb1.setFont(new Font("Times",Font.BOLD,15));
rb2.setBounds(340,170,100,30);
rb2.setFont(new Font("Times",Font.BOLD,15));
panel.add(rb1);
panel.add(rb2);
bg.add(rb1);
bg.add(rb2);
lDesignation = new JLabel("DESIGNATION");
lDesignation.setBounds(600,35,150,300);
lDesignation.setFont(new Font("Times",Font.BOLD,15));
panel.add(lDesignation);
tDesignation = new JTextField(20);
tDesignation.setFont(new Font("Times",Font.BOLD,15));
tDesignation.setBounds(760,170,150,30);
panel.add(tDesignation);
lDOB = new JLabel("DATE OF BIRTH");

PATNA WOMEN’S COLLEGE Page 99


GPF MANAGMENT SYSTEM

lDOB.setBounds(40,35,150,400);
lDOB.setFont(new Font("Times",Font.BOLD,15));
panel.add(lDOB);
tDOB = new JTextField(30);
tDOB.setFont(new Font("Times",Font.BOLD,15));
tDOB.setBounds(250,220,90,30);
panel.add(tDOB);
ldoj = new JLabel("DATE OF JOINING");
ldoj.setBounds(600,30,150,400);
ldoj.setFont(new Font("Times",Font.BOLD,15));
panel.add(ldoj);
tdoj = new JTextField(30);
tdoj.setFont(new Font("Times",Font.BOLD,15));
tdoj.setBounds(760,220,90,30);
panel.add(tdoj);
lcaste = new JLabel("CASTE");
lcaste.setBounds(40,35,90,500);
lcaste.setFont(new Font("Times",Font.BOLD,15));
panel.add(lcaste);
cb4= new JComboBox();
cb4.addItem("GENERAL");
cb4.addItem("SC");

PATNA WOMEN’S COLLEGE Page 100


GPF MANAGMENT SYSTEM

cb4.addItem("ST");
cb4.addItem("OBC");
cb4.setBounds(250,270,110,30);
cb4.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb4);
lreligion = new JLabel("RELIGION");
lreligion.setBounds(600,35,90,500);
lreligion.setFont(new Font("Times",Font.BOLD,15));
panel.add(lreligion);
cb2= new JComboBox();
cb2.addItem("HINDU");
cb2.addItem("MUSLIM");
cb2.addItem("CHRISTIAN");
cb2.addItem("SHIKH");
cb2.setBounds(760,270,90,30);
cb2.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb2);
lfathername = new JLabel("FATHER'S NAME");
lfathername.setBounds(40,35,140,600);
lfathername.setFont(new Font("Times",Font.BOLD,15));
panel.add(lfathername);
tfathername = new JTextField(30);

PATNA WOMEN’S COLLEGE Page 101


GPF MANAGMENT SYSTEM

tfathername.setFont(new Font("Times",Font.BOLD,15));
tfathername.setBounds(250,320,200,30);
panel.add(tfathername);
lmobileno = new JLabel("MOBILE NO");
lmobileno.setBounds(600,35,140,600);
lmobileno.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmobileno);
tmobileno = new JTextField(30);
tmobileno.setFont(new Font("Times",Font.BOLD,15));
tmobileno.setBounds(760,320,90,30);
panel.add(tmobileno);
lmaritalstatus = new JLabel("MARITAL STATUS");
lmaritalstatus.setBounds(40,35,150,700);
lmaritalstatus.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmaritalstatus);
cb3 = new JComboBox();
cb3.addItem("SINGLE");
cb3.addItem("MARRIED");
cb3.addItem("WIDOW");
cb3.setBounds(250,370,100,30);
cb3.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb3);

PATNA WOMEN’S COLLEGE Page 102


GPF MANAGMENT SYSTEM

lspousename = new JLabel("SPOUSE NAME");


lspousename.setBounds(40,35,150,800);
lspousename.setFont(new Font("Times",Font.BOLD,15));
panel.add(lspousename);
tspousename = new JTextField(30);
tspousename.setFont(new Font("Times",Font.BOLD,15));
lspousename.setFont(new Font("Times",Font.BOLD,15));
tspousename.setBounds(250,420,200,30);
panel.add(tspousename);
lAddress = new JLabel("PRESENT ADDRESS");
lAddress.setBounds(40,35,150,900);
lAddress.setFont(new Font("Times",Font.BOLD,15));
panel.add(lAddress);
tAddress = new JTextField(30);
tAddress.setFont(new Font("Times",Font.BOLD,15));
tAddress.setBounds(250,470,200,30);
panel.add(tAddress);
lAddress1 = new JLabel("PERMANENT ADDRESS");
lAddress1.setBounds(600,35,200,900);
lAddress1.setFont(new Font("Times",Font.BOLD,15));
panel.add(lAddress1);
tAddress1 = new JTextField(30);

PATNA WOMEN’S COLLEGE Page 103


GPF MANAGMENT SYSTEM

tAddress1.setFont(new Font("Times",Font.BOLD,15));
tAddress1.setBounds(780,470,200,30);
panel.add(tAddress1);
lbasic = new JLabel("BASIC SALARY");
lbasic.setBounds(40,35,200,1000);
lbasic.setFont(new Font("Times",Font.BOLD,15));
panel.add(lbasic);
tbasic = new JTextField(30);
tbasic.setFont(new Font("Times",Font.BOLD,15));
tbasic.setBounds(250,520,90,30);
panel.add(tbasic);
lidmark = new JLabel("IDENTIFICATION MARK");
lidmark.setBounds(600,35,200,1000);
lidmark.setFont(new Font("Times",Font.BOLD,15));
panel.add(lidmark);
tidmark = new JTextField(30);
tidmark.setFont(new Font("Times",Font.BOLD,15));
tidmark.setBounds(780,520,200,30);
panel.add(tidmark);
lnominee1 = new JLabel("NOMINEE 1");
lnominee1.setBounds(40,30,100,1100);
lnominee1.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 104


GPF MANAGMENT SYSTEM

panel.add(lnominee1);
tnominee1 = new JTextField(30);
tnominee1.setFont(new Font("Times",Font.BOLD,15));
tnominee1.setBounds(250,570,150,30);
panel.add(tnominee1);
lnom1age = new JLabel("AGE");
lnom1age.setBounds(440,30,90,1100);
lnom1age.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnom1age);
tnom1age = new JTextField(2);
tnom1age.setFont(new Font("Times",Font.BOLD,15));
tnom1age.setBounds(490,570,90,30);
panel.add(tnom1age);
lnom1relation = new JLabel("RELATION");
lnom1relation.setFont(new Font("Times",Font.BOLD,15));
lnom1relation.setBounds(600,30,90,1100);
panel.add(lnom1relation);
tnom1relation = new JTextField(15);
tnom1relation.setFont(new Font("Times",Font.BOLD,15));
tnom1relation.setBounds(690,570,90,30);
panel.add(tnom1relation);
lnom1pa = new JLabel("PAYABLE AMOUNT");

PATNA WOMEN’S COLLEGE Page 105


GPF MANAGMENT SYSTEM

lnom1pa.setFont(new Font("Times",Font.BOLD,15));
lnom1pa.setBounds(800,30,150,1100);
panel.add(lnom1pa);
tnom1pa = new JTextField(15);
tnom1pa.setFont(new Font("Times",Font.BOLD,15));
tnom1pa.setBounds(950,570,90,30);
panel.add(tnom1pa);
lnominee2 = new JLabel("NOMINEE 2");
lnominee2.setFont(new Font("Times",Font.BOLD,15));
lnominee2.setBounds(40,35,100,1160);
panel.add(lnominee2);
tnominee2 = new JTextField(30);
tnominee2.setFont(new Font("Times",Font.BOLD,15));
tnominee2.setBounds(250,600,150,30);
panel.add(tnominee2);
lnom2age = new JLabel("AGE");
lnom2age.setFont(new Font("Times",Font.BOLD,15));
lnom2age.setBounds(440,35,90,1160);
panel.add(lnom2age);
tnom2age = new JTextField(2);
tnom2age.setFont(new Font("Times",Font.BOLD,15));
tnom2age.setBounds(490,600,90,30);

PATNA WOMEN’S COLLEGE Page 106


GPF MANAGMENT SYSTEM

panel.add(tnom2age);
lnom2relation = new JLabel("RELATION");
lnom2relation.setBounds(600,35,90,1160);
lnom2relation.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnom2relation);
tnom2relation = new JTextField(15);
tnom2relation.setFont(new Font("Times",Font.BOLD,15));
tnom2relation.setBounds(690,600,90,30);
panel.add(tnom2relation);
lnom2pa = new JLabel("PAYABLE AMOUNT");
lnom2pa.setFont(new Font("Times",Font.BOLD,15));
lnom2pa.setBounds(800,35,150,1160);
panel.add(lnom2pa);
tnom2pa = new JTextField(15);
tnom2pa.setFont(new Font("Times",Font.BOLD,15));
tnom2pa.setBounds(950,600,90,30);
panel.add(tnom2pa);
lnominee3 = new JLabel("NOMINEE 3");
lnominee3.setBounds(40,35,100,1230);
lnominee3.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnominee3);
tnominee3 = new JTextField(30);

PATNA WOMEN’S COLLEGE Page 107


GPF MANAGMENT SYSTEM

tnominee3.setFont(new Font("Times",Font.BOLD,15));
tnominee3.setBounds(250,630,150,30);
panel.add(tnominee3);
lnom3age = new JLabel(" AGE");
lnom3age.setFont(new Font("Times",Font.BOLD,15));
lnom3age.setBounds(440,35,90,1230);
panel.add(lnom3age);
tnom3age = new JTextField(2);
tnom3age.setFont(new Font("Times",Font.BOLD,15));
tnom3age.setBounds(490,630,90,30);
panel.add(tnom3age);
lnom3relation = new JLabel("RELATION");
lnom3relation.setFont(new Font("Times",Font.BOLD,15));
lnom3relation.setBounds(600,35,90,1230);
panel.add(lnom3relation);
tnom3relation =new JTextField(15);
tnom3relation.setFont(new Font("Times",Font.BOLD,15));
tnom3relation.setBounds(690,630,90,30);
panel.add(tnom3relation);
lnom3pa = new JLabel("PAYABLE AMOUNT");
lnom3pa.setFont(new Font("Times",Font.BOLD,15));
lnom3pa.setBounds(800,35,150,1230);

PATNA WOMEN’S COLLEGE Page 108


GPF MANAGMENT SYSTEM

panel.add(lnom3pa);
tnom3pa = new JTextField(15);
tnom3pa.setFont(new Font("Times",Font.BOLD,15));
tnom3pa.setBounds(950,630,90,30);
panel.add(tnom3pa);
JButton show = new JButton("SHOW");
show.setActionCommand("show");
show.setFont(new Font("Times",Font.BOLD,15));
show.setBounds(1100,400,100,40);
panel.add(show);
JButton update = new JButton("UPDATE");
update.setFont(new Font("Times",Font.BOLD,15));
update.setActionCommand("update");
update.setBounds(1100,450,100,40);
panel.add(update);
JButton reset = new JButton("RESET");
reset.setFont(new Font("Times",Font.BOLD,15));
reset.setActionCommand("reset");
reset.setBounds(1100,500,100,40);
panel.add(reset);
JButton exit = new JButton("EXIT");
exit.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 109


GPF MANAGMENT SYSTEM

exit.setActionCommand("exit");
exit.setBounds(1100,550,100,40);
panel.add(exit);
exit.addActionListener(this);
reset.addActionListener(this);
show.addActionListener(this);
update.addActionListener(this);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(1250,750);
setVisible(true);
setTitle("Update form");
panel.setBackground(Color.pink);
}
public void actionPerformed(ActionEvent ae){
if(ae.getActionCommand() == "show"){
if(tID.getText().trim().length()==0){
JOptionPane.showMessageDialog(this,"Code cant be left
blank");
return;}
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

PATNA WOMEN’S COLLEGE Page 110


GPF MANAGMENT SYSTEM

con=DriverManager.getConnection("jdbc:odbc:MYDATASOURC
E2","sa","kankarbagh");
stmt=con.prepareStatement("select * from EMPINFO where
code=?");
stmt.setString(1,tID.getText());
ResultSet rs=stmt.executeQuery();
if(!rs.next()){
JOptionPane.showMessageDialog(this,"Code is not Valid");}
else{
tacno.setText(rs.getString(2));
String volume=rs.getString(3).toString().trim();
if(volume.equalsIgnoreCase("1")){
cb4.setSelectedIndex(0);}
if(volume.equalsIgnoreCase("2")){
cb4.setSelectedIndex(1);}
if(volume.equalsIgnoreCase("3")){
cb4.setSelectedIndex(2);}
if(volume.equalsIgnoreCase("4")){
cb4.setSelectedIndex(3);}
if(volume.equalsIgnoreCase("5")){
cb4.setSelectedIndex(4);}
if(volume.equalsIgnoreCase("6")){

PATNA WOMEN’S COLLEGE Page 111


GPF MANAGMENT SYSTEM

cb4.setSelectedIndex(5);}
if(volume.equalsIgnoreCase("7")){
cb4.setSelectedIndex(6);}
if(volume.equalsIgnoreCase("8")){
cb4.setSelectedIndex(7);}
if(volume.equalsIgnoreCase("9")){
cb4.setSelectedIndex(8);}
tfname.setText(rs.getString(4));
tmname.setText(rs.getString(5));
tlname.setText(rs.getString(6));
String sex=rs.getString(7).toString().trim();
if(sex.equalsIgnoreCase("MALE")){
rb1.setSelected(true);}
if(sex.equalsIgnoreCase("FEMALE")){
rb2.setSelected(true);}
tDesignation.setText(rs.getString(8));
tDOB.setText(rs.getString(9));
tdoj.setText(rs.getString(10));
String caste=rs.getString(11).toString().trim();
if(caste.equalsIgnoreCase("GENERAL")){
cb1.setSelectedIndex(0);}
if(caste.equalsIgnoreCase("SC")){

PATNA WOMEN’S COLLEGE Page 112


GPF MANAGMENT SYSTEM

cb1.setSelectedIndex(1);}
if(caste.equalsIgnoreCase("ST")){
cb1.setSelectedIndex(2);}
if(caste.equalsIgnoreCase("OBC")){
cb1.setSelectedIndex(2);}
String religion=rs.getString(12).toString().trim();
if(religion.equalsIgnoreCase("HINDU")){
cb2.setSelectedIndex(0);}
if(religion.equalsIgnoreCase("MUSLIM")){
cb2.setSelectedIndex(1);}
if(religion.equalsIgnoreCase("CHRISTIAN")){
cb2.setSelectedIndex(2);}
if(religion.equalsIgnoreCase("SHIKH")){
cb2.setSelectedIndex(3);}
tfathername.setText(rs.getString(13));
tmobileno.setText(rs.getString(14));
String ms=rs.getString(15).toString().trim();
if(ms.equalsIgnoreCase("SINGLE")){
cb3.setSelectedIndex(0);}
if(ms.equalsIgnoreCase("MARRIED")){
cb3.setSelectedIndex(1);}
if(ms.equalsIgnoreCase("WIDOW")){

PATNA WOMEN’S COLLEGE Page 113


GPF MANAGMENT SYSTEM

cb3.setSelectedIndex(2);}
tspousename.setText(rs.getString(16));
tAddress.setText(rs.getString(17));
tAddress1.setText(rs.getString(18));
tbasic.setText(rs.getString(19));
tidmark.setText(rs.getString(20));
tnominee1.setText(rs.getString(21));
tnominee2.setText(rs.getString(22));
tnominee3.setText(rs.getString(23));
tnom1age.setText(rs.getString(24));
tnom2age.setText(rs.getString(25));
tnom3age.setText(rs.getString(26));
tnom1relation.setText(rs.getString(27));
tnom2relation.setText(rs.getString(28));
tnom3relation.setText(rs.getString(29));
tnom1pa.setText(rs.getString(30));
tnom2pa.setText(rs.getString(31));
tnom3pa.setText(rs.getString(32));}}
catch(Exception e){
JOptionPane.showMessageDialog(this,e);}}
if(ae.getActionCommand() == "reset"){
tacno.setText(" ");

PATNA WOMEN’S COLLEGE Page 114


GPF MANAGMENT SYSTEM

tidmark.setText(" ");
tDesignation.setText(" ");
tID.setText(" ");
tdoj.setText("");
tfname.setText(" ");
tfathername.setText(" ");
tspousename.setText(" ");
tID.setText(" ");
tAddress.setText("");
tAddress1.setText("");
tlname.setText("");
tDOB.setText("");
tmobileno.setText("");
tnominee1.setText("");
tnominee2.setText("");
tnominee3.setText("");
tnom1age.setText("");
tnom2age.setText("");
tnom3age.setText("");
tnom1relation.setText("");
tnom2relation.setText("");
tnom3relation.setText("");

PATNA WOMEN’S COLLEGE Page 115


GPF MANAGMENT SYSTEM

tnom1pa.setText("");
tnom2pa.setText("");
tnom3pa.setText("");
tbasic.setText("");}
if(ae.getActionCommand() == "exit")
dispose();
if(ae.getActionCommand() == "update"){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:MYDATASOURC
E2","sa","kankarbagh");
stmt = con.prepareStatement("UPDATE EMPINFO SET
DESIGNATION = ? , M_NO = ? ,M_STATUS = ? , S_NAME = ? , ADD1
= ? , BASIC= ?
,IDMARK= ?,N_1NAME=?,N_2NAME=?,N_3NAME=?,N_1AGE=?,N_
2AGE=?,N_3AGE=?,N_1RELATION=?,N_2RELATION=?,N_3RELAT
ION=?,N_1PA=?,N_2PA=?,N_3PA=? WHERE CODE = ?");
String designation = tDesignation.getText();
String mobileno = tmobileno.getText();
String maritalstatus = cb3.getSelectedItem().toString();
String spousename = tspousename.getText();
String address= tAddress.getText();
String idmark = tidmark.getText();
Float basic = Float.parseFloat(tbasic.getText().toString());

PATNA WOMEN’S COLLEGE Page 116


GPF MANAGMENT SYSTEM

String nom1 = tnominee1.getText();


String nom2 = tnominee2.getText();
String nom3 = tnominee3.getText();
String nom1age = tnom1age.getText();
String nom2age = tnom2age.getText();
String nom3age = tnom3age.getText();
String nom1relation = tnom1relation.getText();
String nom2relation = tnom2relation.getText();
String nom3relation = tnom3relation.getText();
int nom1pa = Integer.parseInt(tnom1pa.getText().toString());
int nom2pa = Integer.parseInt(tnom2pa.getText().toString());
int nom3pa = Integer.parseInt(tnom3pa.getText().toString());
String id = tID.getText();
stmt.setString(1,designation);
stmt.setString(2,mobileno);
stmt.setString(3,maritalstatus);
stmt.setString(4,spousename);
stmt.setString(5,address);
stmt.setFloat(6,basic);
stmt.setString(7,idmark);
stmt.setString(8,nom1);
stmt.setString(9,nom2);

PATNA WOMEN’S COLLEGE Page 117


GPF MANAGMENT SYSTEM

stmt.setString(10,nom3);
stmt.setString(11,nom1age);
stmt.setString(12,nom2age);
stmt.setString(13,nom3age);
stmt.setString(14,nom1relation);
stmt.setString(15,nom2relation);
stmt.setString(16,nom3relation);
stmt.setInt(17,nom1pa);
stmt.setInt(18,nom2pa);
stmt.setInt(19,nom3pa);
stmt.setString(20,id);
stmt.executeUpdate();
con.close();
JOptionPane.showMessageDialog(this,"ROW UPDATED");}
catch(Exception e){
JOptionPane.showMessageDialog(this,"ROW CANNOT BE
UPDATED");}}}
public static void main(String[] args){
modify reg=new modify();

PATNA WOMEN’S COLLEGE Page 118


GPF MANAGMENT SYSTEM

CODE FOR DELETE FORM

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.util.Calendar;
public class delete extends JFrame implements
ActionListener,FocusListener
{
Connection con;
PreparedStatement stmt;
public delete()

PATNA WOMEN’S COLLEGE Page 119


GPF MANAGMENT SYSTEM

{
GridBagLayout g = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
JPanel panel = (JPanel)getContentPane();
panel.setLayout(null);
ImageIcon im = new ImageIcon("bseb-logo.jpg");
JLabel logo = new JLabel(im,JLabel.LEFT);
logo.setBounds(400,2,120,100);
panel.add(logo);
ImageIcon i = new ImageIcon("icon_reg.gif");
JLabel blogo = new JLabel(i,JLabel.LEFT);
blogo.setBounds(0,0,84,70);
panel.add(blogo);
Head=new JLabel("DELETE RECORD");
Head.setFont(new Font("Times",Font.BOLD,20));
Head.setBounds(500,25,900,30);
panel.add(Head);
JLabel lID= new JLabel("CODE");
lID.setFont(new Font("Times",Font.BOLD,15));
lID.setBounds(40,35,90,100);
panel.add(lID);
JTextField tID = new JTextField(5);

PATNA WOMEN’S COLLEGE Page 120


GPF MANAGMENT SYSTEM

tID.setBounds(250,70,90,30);
panel.add(tID);
JLabel lacno= new JLabel("AC/NO");
lacno.setBounds(600,35,90,100);
lacno.setFont(new Font("Times",Font.BOLD,15));
panel.add(lacno);
JTextField tacno = new JTextField(5);
tacno.setBounds(760,70,90,30);
panel.add(tacno);
JLabel lvolume= new JLabel("VOLUME");
lvolume.setBounds(920,35,90,100);
lvolume.setFont(new Font("Times",Font.BOLD,15));
panel.add(lvolume);
JComboBox cb1= new JComboBox();
cb1.addItem("1");
cb1.addItem("2");
cb1.addItem("3");
cb1.addItem("4");
cb1.addItem("5");
cb1.addItem("6");
cb1.addItem("7");
cb1.addItem("8");

PATNA WOMEN’S COLLEGE Page 121


GPF MANAGMENT SYSTEM

cb1.addItem("9");
cb1.setBounds(1050,70,90,30);
cb1.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb1);
JLabel lfname= new JLabel("FIRST NAME");
lfname.setBounds(40,35,100,200);
lfname.setFont(new Font("Times",Font.BOLD,15));
panel.add(lfname);
JTextField tfname = new JTextField(30);
tfname.setBounds(250,120,90,30);
panel.add(tfname);
JLabel lmname= new JLabel("MIDDLE NAME");
lmname.setBounds(600,35,150,200);
lmname.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmname);
JTextField tmname = new JTextField(30);
tmname.setBounds(760,120,90,30);
panel.add(tmname);
JLabel llname= new JLabel("LAST NAME");
llname.setBounds(920,35,150,200);
llname.setFont(new Font("Times",Font.BOLD,15));
panel.add(llname);

PATNA WOMEN’S COLLEGE Page 122


GPF MANAGMENT SYSTEM

JTextField tlname = new JTextField(15);


tlname.setBounds(1050,120,90,30);
panel.add(tlname);
JLabel lsex = new JLabel("SEX");
lsex.setBounds(40,35,90,300);
lsex.setFont(new Font("Times",Font.BOLD,15));
panel.add(lsex);
JRadioButton rb1 = new JRadioButton("MALE");
JRadioButton rb2 = new JRadioButton("FEMALE");
ButtonGroup bg = new ButtonGroup();
rb1.setBounds(250,170,80,30);
rb1.setFont(new Font("Times",Font.BOLD,15));
rb2.setBounds(340,170,100,30);
rb2.setFont(new Font("Times",Font.BOLD,15));
panel.add(rb1);
panel.add(rb2);
bg.add(rb1);
bg.add(rb2);
JLabel lDesignation = new JLabel("DESIGNATION");
lDesignation.setBounds(600,35,150,300);
lDesignation.setFont(new Font("Times",Font.BOLD,15));
panel.add(lDesignation);

PATNA WOMEN’S COLLEGE Page 123


GPF MANAGMENT SYSTEM

JTextField tDesignation = new JTextField(20);


tDesignation.setBounds(760,170,150,30);
panel.add(tDesignation);
JLabel lDOB = new JLabel("DATE OF BIRTH");
lDOB.setBounds(40,35,150,400);
lDOB.setFont(new Font("Times",Font.BOLD,15));
panel.add(lDOB);
JTextField tDOB = new JTextField(30);
tDOB.setBounds(250,220,90,30);
panel.add(tDOB);
JLabel ldoj = new JLabel("DATE OF JOINING");
ldoj.setBounds(600,30,150,400);
ldoj.setFont(new Font("Times",Font.BOLD,15));
panel.add(ldoj);
tdoj = new JTextField(30);
tdoj.setBounds(760,220,90,30);
panel.add(tdoj);
JLabel lcaste = new JLabel("CASTE");
lcaste.setBounds(40,35,90,500);
lcaste.setFont(new Font("Times",Font.BOLD,15));
panel.add(lcaste);
JComboBox cb4= new JComboBox();

PATNA WOMEN’S COLLEGE Page 124


GPF MANAGMENT SYSTEM

cb4.addItem("GENERAL");
cb4.addItem("SC");
cb4.addItem("ST");
cb4.addItem("OBC");
cb4.setBounds(250,270,110,30);
cb4.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb4);
JLabel lreligion = new JLabel("RELIGION");
lreligion.setBounds(600,35,90,500);
lreligion.setFont(new Font("Times",Font.BOLD,15));
panel.add(lreligion);
JComboBox cb2= new JComboBox();
cb2.addItem("HINDU");
cb2.addItem("MUSLIM");
cb2.addItem("CHRISTIAN");
cb2.addItem("SHIKH");
cb2.setBounds(760,270,90,30);
cb2.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb2);
JLabel lfathername = new JLabel("FATHER'S NAME");
lfathername.setBounds(40,35,140,600);
lfathername.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 125


GPF MANAGMENT SYSTEM

panel.add(lfathername);
tfathername = new JTextField(30);
tfathername.setBounds(250,320,200,30);
panel.add(tfathername);
JLabel lmobileno = new JLabel("MOBILE NO");
lmobileno.setBounds(600,35,140,600);
lmobileno.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmobileno);
JTextField tmobileno = new JTextField(30);
tmobileno.setBounds(760,320,90,30);
panel.add(tmobileno);
JLabel lmaritalstatus = new JLabel("MARITAL STATUS");
lmaritalstatus.setBounds(40,35,150,700);
lmaritalstatus.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmaritalstatus);
JComboBox cb3 = new JComboBox();
cb3.addItem("SINGLE");
cb3.addItem("MARRIED");
cb3.addItem("WIDOW");
cb3.setBounds(250,370,100,30);
cb3.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb3);

PATNA WOMEN’S COLLEGE Page 126


GPF MANAGMENT SYSTEM

JLabel lspousename = new JLabel("SPOUSE NAME");


lspousename.setBounds(40,35,150,800);
lspousename.setFont(new Font("Times",Font.BOLD,15));
panel.add(lspousename);
JTextField tspousename = new JTextField(30);
tspousename.setBounds(250,420,200,30);
panel.add(tspousename);
JLabel lAddress = new JLabel("PRESENT ADDRESS");
lAddress.setBounds(40,35,150,900);
lAddress.setFont(new Font("Times",Font.BOLD,15));
panel.add(lAddress);
JTextField tAddress = new JTextField(30);
tAddress.setBounds(250,470,200,30);
panel.add(tAddress);
JLabel lAddress1 = new JLabel("PERMANENT ADDRESS");
lAddress1.setBounds(600,35,200,900);
lAddress1.setFont(new Font("Times",Font.BOLD,15));
panel.add(lAddress1);
JTextField tAddress1 = new JTextField(30);
tAddress1.setBounds(780,470,200,30);
panel.add(tAddress1);
JLabel lbasic = new JLabel("BASIC SALARY");

PATNA WOMEN’S COLLEGE Page 127


GPF MANAGMENT SYSTEM

lbasic.setBounds(40,35,200,1000);
lbasic.setFont(new Font("Times",Font.BOLD,15));
panel.add(lbasic);
JTextField tbasic = new JTextField(30);
tbasic.setBounds(250,520,90,30);
panel.add(tbasic);
JLabel lidmark = new JLabel("IDENTIFICATION MARK");
lidmark.setBounds(600,35,200,1000);
lidmark.setFont(new Font("Times",Font.BOLD,15));
panel.add(lidmark);
JTextField tidmark = new JTextField(30);
tidmark.setBounds(780,520,200,30);
panel.add(tidmark);
JLabel lnominee1 = new JLabel("NOMINEE 1");
lnominee1.setBounds(40,30,100,1100);
lnominee1.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnominee1);
JTextField tnominee1 = new JTextField(30);
tnominee1.setBounds(250,570,150,30);
panel.add(tnominee1);
l JLabel nom1age = new JLabel("AGE");
lnom1age.setBounds(440,30,90,1100);

PATNA WOMEN’S COLLEGE Page 128


GPF MANAGMENT SYSTEM

lnom1age.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnom1age);
JTextField tnom1age = new JTextField(2);
tnom1age.setBounds(490,570,90,30);
panel.add(tnom1age);
JLabel lnom1relation = new JLabel("RELATION");
lnom1relation.setFont(new Font("Times",Font.BOLD,15));
lnom1relation.setBounds(600,30,90,1100);
panel.add(lnom1relation);
JTextField tnom1relation = new JTextField(15);
tnom1relation.setBounds(690,570,90,30);
panel.add(tnom1relation);
JLabel lnom1pa = new JLabel("PAYABLE AMOUNT");
lnom1pa.setFont(new Font("Times",Font.BOLD,15));
lnom1pa.setBounds(800,30,150,1100);
panel.add(lnom1pa);
JTextField tnom1pa = new JTextField(15);
tnom1pa.setBounds(950,570,90,30);
panel.add(tnom1pa);
JLabel lnominee2 = new JLabel("NOMINEE 2");
lnominee2.setFont(new Font("Times",Font.BOLD,15));
lnominee2.setBounds(40,35,100,1160);

PATNA WOMEN’S COLLEGE Page 129


GPF MANAGMENT SYSTEM

panel.add(lnominee2);
JTextField tnominee2 = new JTextField(30);
tnominee2.setBounds(250,600,150,30);
panel.add(tnominee2);
JLabel lnom2age = new JLabel("AGE");
lnom2age.setFont(new Font("Times",Font.BOLD,15));
lnom2age.setBounds(440,35,90,1160);
panel.add(lnom2age);
JTextField tnom2age = new JTextField(2);
tnom2age.setBounds(490,600,90,30);
panel.add(tnom2age);
JLabel lnom2relation = new JLabel("RELATION");
lnom2relation.setBounds(600,35,90,1160);
lnom2relation.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnom2relation);
JTextField tnom2relation = new JTextField(15);
tnom2relation.setBounds(690,600,90,30);
panel.add(tnom2relation);
JLabel lnom2pa = new JLabel("PAYABLE AMOUNT");
lnom2pa.setFont(new Font("Times",Font.BOLD,15));
lnom2pa.setBounds(800,35,150,1160);
panel.add(lnom2pa);

PATNA WOMEN’S COLLEGE Page 130


GPF MANAGMENT SYSTEM

JTextField tnom2pa = new JTextField(15);


tnom2pa.setBounds(950,600,90,30);
panel.add(tnom2pa);
JLabel lnominee3 = new JLabel("NOMINEE 3");
lnominee3.setBounds(40,35,100,1230);
lnominee3.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnominee3);
JTextField tnominee3 = new JTextField(30);
tnominee3.setBounds(250,630,150,30);
panel.add(tnominee3);
JLabel lnom3age = new JLabel(" AGE");
lnom3age.setBounds(440,35,90,1230);
panel.add(lnom3age);
JTextField tnom3age = new JTextField(2);
lnom3age.setFont(new Font("Times",Font.BOLD,15));
tnom3age.setBounds(490,630,90,30);
panel.add(tnom3age);
JLabel lnom3relation = new JLabel("RELATION");
lnom3relation.setFont(new Font("Times",Font.BOLD,15));
lnom3relation.setBounds(600,35,90,1230);
panel.add(lnom3relation);
JTextField tnom3relation =new JTextField(15);

PATNA WOMEN’S COLLEGE Page 131


GPF MANAGMENT SYSTEM

tnom3relation.setBounds(690,630,90,30);
panel.add(tnom3relation);
JLabel lnom3pa = new JLabel("PAYABLE AMOUNT");
lnom3pa.setFont(new Font("Times",Font.BOLD,15));
lnom3pa.setBounds(800,35,150,1230);
panel.add(lnom3pa);
JTextField tnom3pa = new JTextField(15);
tnom3pa.setBounds(950,630,90,30);
panel.add(tnom3pa);
JButton show = new JButton("SHOW");
show.setActionCommand("show");
show.setFont(new Font("Times",Font.BOLD,15));
show.setBounds(1100,400,100,40);
panel.add(show);
JButton delete = new JButton("DELETE");
delete.setFont(new Font("Times",Font.BOLD,15));
delete.setActionCommand("update");
delete.setBounds(1100,450,100,40);
panel.add(delete);
JButton reset = new JButton("RESET");
reset.setFont(new Font("Times",Font.BOLD,15));
reset.setActionCommand("reset");

PATNA WOMEN’S COLLEGE Page 132


GPF MANAGMENT SYSTEM

reset.setBounds(1100,500,100,40);
panel.add(reset);
JButton exit = new JButton("EXIT");
exit.setFont(new Font("Times",Font.BOLD,15));
exit.setActionCommand("exit");
exit.setBounds(1100,550,100,40);
panel.add(exit);
exit.addActionListener(this);
reset.addActionListener(this);
show.addActionListener(this);
delete.addActionListener(this);
setTitle("Delete record");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(1250,750);
setVisible(true);
panel.setBackground(Color.pink);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getActionCommand() == "show")
{
if(tID.getText().trim().length()==0)

PATNA WOMEN’S COLLEGE Page 133


GPF MANAGMENT SYSTEM

{
JOptionPane.showMessageDialog(this,"Code cant be left
blank");
return;
}
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5","
sa","kankarbagh");
stmt=con.prepareStatement("select * from EMPINFO where
code=?");
stmt.setString(1,tID.getText());
ResultSet rs=stmt.executeQuery();
if(!rs.next())
{
JOptionPane.showMessageDialog(this,"Code is not Valid");
}
else
{
tacno.setText(rs.getString(2));
String volume=rs.getString(3).toString().trim();

PATNA WOMEN’S COLLEGE Page 134


GPF MANAGMENT SYSTEM

if(volume.equalsIgnoreCase("1"))
{
cb4.setSelectedIndex(0);
}
if(volume.equalsIgnoreCase("2"))
{
cb4.setSelectedIndex(1);
}
if(volume.equalsIgnoreCase("3"))
{
cb4.setSelectedIndex(2);
}
if(volume.equalsIgnoreCase("4"))
{
cb4.setSelectedIndex(3);
}
if(volume.equalsIgnoreCase("5"))
{
cb4.setSelectedIndex(4);
}
if(volume.equalsIgnoreCase("6"))
{

PATNA WOMEN’S COLLEGE Page 135


GPF MANAGMENT SYSTEM

cb4.setSelectedIndex(5);
}
if(volume.equalsIgnoreCase("7"))
{
cb4.setSelectedIndex(6);
}
if(volume.equalsIgnoreCase("8"))
{
cb4.setSelectedIndex(7);
}
if(volume.equalsIgnoreCase("9"))
{
cb4.setSelectedIndex(8);
}
tfname.setText(rs.getString(4));
tmname.setText(rs.getString(5));
tlname.setText(rs.getString(6));
String sex=rs.getString(7).toString().trim();
if(sex.equalsIgnoreCase("MALE"))
{
rb1.setSelected(true);
}

PATNA WOMEN’S COLLEGE Page 136


GPF MANAGMENT SYSTEM

if(sex.equalsIgnoreCase("FEMALE"))
{
rb2.setSelected(true);
}
tDesignation.setText(rs.getString(8));
tDOB.setText(rs.getString(9));
tdoj.setText(rs.getString(10));
String caste=rs.getString(11).toString().trim();
if(caste.equalsIgnoreCase("GENERAL"))
{
cb1.setSelectedIndex(0);
}
if(caste.equalsIgnoreCase("SC"))
{
cb1.setSelectedIndex(1);
}
if(caste.equalsIgnoreCase("ST"))
{
cb1.setSelectedIndex(2);
}
if(caste.equalsIgnoreCase("OBC"))
{

PATNA WOMEN’S COLLEGE Page 137


GPF MANAGMENT SYSTEM

cb1.setSelectedIndex(2);
}
String religion=rs.getString(12).toString().trim();
if(religion.equalsIgnoreCase("HINDU"))
{
cb2.setSelectedIndex(0);
}
if(religion.equalsIgnoreCase("MUSLIM"))
{
cb2.setSelectedIndex(1);
}
if(religion.equalsIgnoreCase("CHRISTIAN"))
{
cb2.setSelectedIndex(2);
}
if(religion.equalsIgnoreCase("SHIKH"))
{
cb2.setSelectedIndex(3);
}
tfathername.setText(rs.getString(13));
tmobileno.setText(rs.getString(14));
String ms=rs.getString(15).toString().trim();

PATNA WOMEN’S COLLEGE Page 138


GPF MANAGMENT SYSTEM

if(ms.equalsIgnoreCase("SINGLE"))
{
cb3.setSelectedIndex(0);
}
if(ms.equalsIgnoreCase("MARRIED"))
{
cb3.setSelectedIndex(1);
}
if(ms.equalsIgnoreCase("WIDOW"))
{
cb3.setSelectedIndex(2);
}
tspousename.setText(rs.getString(16));
tAddress.setText(rs.getString(17));
tAddress1.setText(rs.getString(18));
tbasic.setText(rs.getString(19));
tidmark.setText(rs.getString(20));
tnominee1.setText(rs.getString(21));
tnominee2.setText(rs.getString(22));
tnominee3.setText(rs.getString(23));
tnom1relation.setText(rs.getString(24));
tnom2relation.setText(rs.getString(25));

PATNA WOMEN’S COLLEGE Page 139


GPF MANAGMENT SYSTEM

tnom3relation.setText(rs.getString(26));
tnom1age.setText(rs.getString(27));
tnom2age.setText(rs.getString(28));
tnom3age.setText(rs.getString(29));
tnom1pa.setText(rs.getString(30));
tnom2pa.setText(rs.getString(31));
tnom3pa.setText(rs.getString(32));
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e);
}
}
if(ae.getActionCommand() == "reset")
{
tacno.setText(" ");
tidmark.setText(" ");
tDesignation.setText(" ");
tID.setText(" ");
tdoj.setText("");
tfname.setText(" ");

PATNA WOMEN’S COLLEGE Page 140


GPF MANAGMENT SYSTEM

tfathername.setText(" ");
tspousename.setText(" ");
tID.setText(" ");
tAddress.setText("");
tAddress1.setText("");
tlname.setText("");
tDOB.setText("");
tmobileno.setText("");
tnominee1.setText("");
tnominee2.setText("");
tnominee3.setText("");
tnom1age.setText("");
tnom2age.setText("");
tnom3age.setText("");
tnom1relation.setText("");
tnom2relation.setText("");
tnom3relation.setText("");
tnom1pa.setText("");
tnom2pa.setText("");
tnom3pa.setText("");
tbasic.setText("");
}

PATNA WOMEN’S COLLEGE Page 141


GPF MANAGMENT SYSTEM

if(ae.getActionCommand() == "delete")
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5","
sa","kankarbagh");
stmt=con.prepareStatement("Delete from EMPINFO where
code=?");
stmt.setString(1,tID.getText());
stmt.executeUpdate();
con.close();
JOptionPane.showMessageDialog(this,"Records deleted
sucessfully");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,"Record not deleted ");
}
}
if(ae.getActionCommand() == "exit")
System.exit(0);

PATNA WOMEN’S COLLEGE Page 142


GPF MANAGMENT SYSTEM

}
public static void main(String[] args)
{
delete reg=new delete();
}
}

PATNA WOMEN’S COLLEGE Page 143


GPF MANAGMENT SYSTEM

CODE FOR GPF CALCULATION FORM

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class GPF extends JFrame implements ActionListener
{
Connection con;
PreparedStatement stat;
public GPF(){
GridBagLayout g = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
JPanel panel = (JPanel)getContentPane();
panel.setLayout(null);
ImageIcon im = new ImageIcon("bseb-logo.jpg");

PATNA WOMEN’S COLLEGE Page 144


GPF MANAGMENT SYSTEM

JLabel logo = new JLabel(im,JLabel.LEFT);


logo.setBounds(0,2,120,100);
panel.add(logo);
JLabel Head=new JLabel("MONTHLY GPF CALCULATION");
Head.setFont(new Font("Times",Font.BOLD,20));
Head.setBounds(350,25,900,30);
panel.add(Head);
JLabel lacno= new JLabel("AC/NO");
lacno.setBounds(100,35,90,100);
lacno.setFont(new Font("Times",Font.BOLD,15));
panel.add(lacno);
JTextField tacno = new JTextField(6);
tacno.setBounds(200,70,90,30);
panel.add(tacno);
JLabel lmonth= new JLabel("MONTH");
lmonth.setBounds(550,35,100,100);
lmonth.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmonth);
JTextField tmonth = new JTextField(8);
tmonth.setBounds(700,70,90,30);
panel.add(tmonth);
JLabel lvolume= new JLabel("VOLUME");

PATNA WOMEN’S COLLEGE Page 145


GPF MANAGMENT SYSTEM

lvolume.setFont(new Font("Times",Font.BOLD,15));
lvolume.setBounds(100,35,100,200);
panel.add(lvolume);
JComboBox cb4= new JComboBox();
cb4.addItem("1");
cb4.addItem("2");
cb4.addItem("3");
cb4.addItem("4");
cb4.addItem("5");
cb4.addItem("6");
cb4.addItem("7");
cb4.addItem("8");
cb4.addItem("9");
cb4.setBounds(200,120,90,30);
cb4.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb4);
JLabel lcode = new JLabel("CODE");
lcode.setBounds(550,35,100,200);
lcode.setFont(new Font("Times",Font.BOLD,15));
panel.add(lcode);
JTextField tcode = new JTextField(6);
tcode.setBounds(700,120,90,30);

PATNA WOMEN’S COLLEGE Page 146


GPF MANAGMENT SYSTEM

panel.add(tcode);
JLabel lname= new JLabel(" NAME");
lname.setBounds(100,35,100,300);
lname.setFont(new Font("Times",Font.BOLD,15));
panel.add(lname);
JTextField tname = new JTextField(20);
tname.setBounds(200,170,100,30);
panel.add(tname);
JLabel ldesignation = new JLabel("DESIGNATION");
ldesignation.setBounds(550,35,150,300);
ldesignation.setFont(new Font("Times",Font.BOLD,15));
panel.add(ldesignation);
JTextField tDesignation = new JTextField(20);
tDesignation.setBounds(700,170,100,30);
panel.add(tDesignation);
JLabel lcontribution = new JLabel("GPF(C)");
lcontribution.setBounds(100,35,100,400);
lcontribution.setFont(new Font("Times",Font.BOLD,15));
panel.add(lcontribution);
JTextField tcontribution = new JTextField(8);
tcontribution.setBounds(200,220,90,30);
panel.add(tcontribution);

PATNA WOMEN’S COLLEGE Page 147


GPF MANAGMENT SYSTEM

JLabel lDA = new JLabel("GPF(D.A)");


lDA.setBounds(100,35,150,500);
lDA.setFont(new Font("Times",Font.BOLD,15));
panel.add(lDA);
JTextField tDA = new JTextField(8);
tDA.setBounds(200,270,90,30);
panel.add(tDA);
JButton search = new JButton("SEARCH");
search.setActionCommand("search");
search.setFont(new Font("Times",Font.BOLD,15));
search.setBounds(400,70,110,40);
panel.add(search);
JButton submit = new JButton("SUBMIT");
submit.setActionCommand("submit");
submit.setFont(new Font("Times",Font.BOLD,15));
submit.setBounds(300,400,100,40);
panel.add(submit);
JButton reset = new JButton("RESET");
reset.setActionCommand("reset");
reset.setBounds(400,400,100,40);
reset.setFont(new Font("Times",Font.BOLD,15));
panel.add(reset);

PATNA WOMEN’S COLLEGE Page 148


GPF MANAGMENT SYSTEM

JButton exit = new JButton("CANCEL");


exit.setActionCommand("exit");
exit.setFont(new Font("Times",Font.BOLD,15));
exit.setBounds(500,400,100,40);
panel.add(exit);
exit.addActionListener(this);
search.addActionListener(this);
submit.addActionListener(this);
reset.addActionListener(this);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(900,500);
setVisible(true);
setTitle("calculation");
panel.setBackground(Color.pink);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getActionCommand() == "submit")
{
System.out.println(" Executing...");
try
{

PATNA WOMEN’S COLLEGE Page 149


GPF MANAGMENT SYSTEM

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5","
sa","kankarbagh");
stat=con.prepareStatement("INSERT INTO GPF
VALUES(?,?,?,?)");
String month = tmonth.getText();
String acno = tacno.getText();
String contribution = tcontribution.getText();
String DA = tDA.getText();
stat.setString(1, month);
stat.setString(2, acno);
stat.setFloat(3, Float.parseFloat(contribution));
stat.setFloat(4, Float.parseFloat(DA));
stat.executeUpdate();
JOptionPane.showMessageDialog(this,"Inserted Sucessfully");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e);
}
}
if(ae.getActionCommand() == "reset")

PATNA WOMEN’S COLLEGE Page 150


GPF MANAGMENT SYSTEM

{
tacno.setText(" ");
tvolume.setText(" ");
tcode.setText(" ");
tname.setText(" ");
tmonth.setText(" ");
tcontribution.setText("");
tDesignation.setText("");
tDA.setText("");
tinterest.setText("");
}
if(ae.getActionCommand() == "exit")
dispose();
if(ae.getActionCommand() == "search")
{
if(tacno.getText().trim().length()==0)
{
JOptionPane.showMessageDialog(this,"acno cant be left
blank");
return;
}
try

PATNA WOMEN’S COLLEGE Page 151


GPF MANAGMENT SYSTEM

{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5","
sa","kankarbagh");
stat=con.prepareStatement("select volume , code , f_name ,
designation from EMPINFO where acno=?");
stat.setString(1,tacno.getText());
ResultSet rs=stat.executeQuery();
if(!rs.next())
{
JOptionPane.showMessageDialog(this,"acno is not Valid");
}
else
{
String volume=rs.getString(1).toString().trim();
if(volume.equalsIgnoreCase("1"))
{
cb4.setSelectedIndex(0);
}
if(volume.equalsIgnoreCase("2"))
{
cb4.setSelectedIndex(1);

PATNA WOMEN’S COLLEGE Page 152


GPF MANAGMENT SYSTEM

}
if(volume.equalsIgnoreCase("3"))
{
cb4.setSelectedIndex(2);
}
if(volume.equalsIgnoreCase("4"))
{
cb4.setSelectedIndex(3);
}
if(volume.equalsIgnoreCase("5"))
{
cb4.setSelectedIndex(4);
}
if(volume.equalsIgnoreCase("6"))
{
cb4.setSelectedIndex(5);
}
if(volume.equalsIgnoreCase("7"))
{
cb4.setSelectedIndex(6);
}
if(volume.equalsIgnoreCase("8"))

PATNA WOMEN’S COLLEGE Page 153


GPF MANAGMENT SYSTEM

{
cb4.setSelectedIndex(7);
}
if(volume.equalsIgnoreCase("9"))
{
cb4.setSelectedIndex(8);
}
tcode.setText(rs.getString(2));
tname.setText(rs.getString(3));
tDesignation.setText(rs.getString(4));
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e);
}
}
}
public static void main(String[] args)
{
GPF reg=new GPF(); }}

PATNA WOMEN’S COLLEGE Page 154


GPF MANAGMENT SYSTEM

CODE FOR LOAN FORM

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class loan extends JFrame implements ActionListener
{
GridBagLayout g;
GridBagConstraints gbc;
Connection con;

PATNA WOMEN’S COLLEGE Page 155


GPF MANAGMENT SYSTEM

PreparedStatement stat;
public loan()
{
GridBagLayout g = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
JPanel panel = (JPanel)getContentPane();
panel.setLayout(null);
ImageIcon im = new ImageIcon("bseb-logo.jpg");
JLabel logo = new JLabel(im,JLabel.LEFT);
logo.setBounds(0,2,120,100);
panel.add(logo);
JLabel Head=new JLabel("LOAN FORM");
Head.setFont(new Font("Times",Font.BOLD,24));
Head.setBounds(400,0,900,30);
panel.add(Head);
JLabel lacno= new JLabel("AC/NO");
lacno.setFont(new Font("Times",Font.BOLD,15));
lacno.setBounds(100,35,90,100);
panel.add(lacno);
JTextField tacno = new JTextField(6);
tacno.setBounds(300,70,90,30);
panel.add(tacno);

PATNA WOMEN’S COLLEGE Page 156


GPF MANAGMENT SYSTEM

JLabel ldate= new JLabel("DATE");


ldate.setFont(new Font("Times",Font.BOLD,15));
ldate.setBounds(550,35,50,100);
panel.add(ldate);
JTextField tdate = new JTextField(10);
tdate.setBounds(750,70,90,30);
panel.add(tdate);
JLabel lvolume= new JLabel("VOLUME");
lvolume.setFont(new Font("Times",Font.BOLD,15));
lvolume.setBounds(100,35,100,200);
panel.add(lvolume);
JComboBox cb4= new JComboBox();
cb4.addItem("1");
cb4.addItem("2");
cb4.addItem("3");
cb4.addItem("4");
cb4.addItem("5");
cb4.addItem("6");
cb4.addItem("7");
cb4.addItem("8");
cb4.addItem("9");
cb4.setBounds(300,120,90,30);

PATNA WOMEN’S COLLEGE Page 157


GPF MANAGMENT SYSTEM

cb4.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb4);
JLabel lcode= new JLabel("CODE");
lcode.setFont(new Font("Times",Font.BOLD,15));
lcode.setBounds(550,35,50,200);
panel.add(lcode);
JTextField tcode = new JTextField(30);
tcode.setBounds(750,120,90,30);
panel.add(tcode);
JLabel lname= new JLabel(" NAME");
lname.setFont(new Font("Times",Font.BOLD,15));
lname.setBounds(100,35,50,300);
panel.add(lname);
JTextField tname = new JTextField(20);
tname.setBounds(300,170,90,30);
panel.add(tname);
JLabel ldesignation = new JLabel("DESIGNATION");
ldesignation.setFont(new Font("Times",Font.BOLD,15));
ldesignation.setBounds(550,35,150,300);
panel.add(ldesignation);
JTextField tdesignation = new JTextField(30);
tdesignation.setBounds(750,170,90,30);

PATNA WOMEN’S COLLEGE Page 158


GPF MANAGMENT SYSTEM

panel.add(tdesignation);
JLabel lbalance = new JLabel(" GRAND BALANCE");
lbalance.setFont(new Font("Times",Font.BOLD,15));
lbalance.setBounds(100,35,150,400);
panel.add(lbalance);
JTextField tbalance = new JTextField(6);
tbalance.setBounds(300,220,100,30);
panel.add(tbalance);
JLabel lloantype = new JLabel("LOAN TYPE");
lloantype.setFont(new Font("Times",Font.BOLD,15));
lloantype.setBounds(100,35,100,500);
panel.add(lloantype);
JRadioButton rb1 = new JRadioButton("Refundabel");
JRadioButton rb2 = new JRadioButton("Non-Refundabel");
ButtonGroup bg = new ButtonGroup();
rb1.setBounds(300,270,155,30);
rb1.setFont(new Font("Times",Font.BOLD,15));
rb2.setBounds(300,300,155,30);
rb2.setFont(new Font("Times",Font.BOLD,15));
panel.add(rb1);
panel.add(rb2);
bg.add(rb1);

PATNA WOMEN’S COLLEGE Page 159


GPF MANAGMENT SYSTEM

bg.add(rb2);
JLabel lloanamount = new JLabel("LOAN AMOUNT");
lloanamount.setFont(new Font("Times",Font.BOLD,15));
lloanamount.setBounds(550,35,150,500);
panel.add(lloanamount);
JTextField tloanamount = new JTextField(30);
tloanamount.setBounds(750,270,90,30);
panel.add(tloanamount);
JLabel linstallmentno = new JLabel("NO.OF INSTALLMENT");
linstallmentno.setFont(new Font("Times",Font.BOLD,15));
linstallmentno.setBounds(100,35,200,650);
panel.add(linstallmentno);
JTextField tinstallmentno = new JTextField(30);
tinstallmentno.setBounds(300,350,90,30);
panel.add(tinstallmentno);
JLabel linstallmentamt = new JLabel("INSTALLMENT
AMOUNT");
linstallmentamt.setFont(new Font("Times",Font.BOLD,15));
linstallmentamt.setBounds(550,35,200,650);
panel.add(linstallmentamt);
JTextField tinstallmentamt = new JTextField(30);
tinstallmentamt.setBounds(750,350,90,30);

PATNA WOMEN’S COLLEGE Page 160


GPF MANAGMENT SYSTEM

panel.add(tinstallmentamt);
JLabel remarks=new JLabel("REMARKS");
remarks.setFont(new Font("Times",Font.BOLD,15));
remarks.setBounds(200,420,90,30);
panel.add(remarks);
JRadioButton rb3 = new JRadioButton("DAUGHTER
MARRIAGE");
JRadioButton rb4 = new JRadioButton("SON MARRIAGE");
JRadioButton rb5 = new JRadioButton("HOME LOAN");
JRadioButton rb6 = new JRadioButton("CHILD EDUCATION");
ButtonGroup bg1 = new ButtonGroup();
rb3.setBounds(300,430,180,40);
rb3.setFont(new Font("Times",Font.BOLD,15));
rb4.setBounds(300,480,180,40);
rb4.setFont(new Font("Times",Font.BOLD,15));
rb5.setBounds(300,530,180,40);
rb5.setFont(new Font("Times",Font.BOLD,15));
rb6.setBounds(300,580,180,40);
rb6.setFont(new Font("Times",Font.BOLD,15));
panel.add(rb3);
panel.add(rb4);
panel.add(rb5);

PATNA WOMEN’S COLLEGE Page 161


GPF MANAGMENT SYSTEM

panel.add(rb6);
bg1.add(rb3);
bg1.add(rb4);
bg1.add(rb5);
bg1.add(rb6);
JButton show = new JButton("SHOW");
show.setFont(new Font("Times",Font.BOLD,15));
show.setActionCommand("show");
show.setBounds(100,650,100,40);
panel.add(show);
JButton submit = new JButton("SUBMIT");
submit.setFont(new Font("Times",Font.BOLD,15));
submit.setActionCommand("submit");
submit.setBounds(200,650,100,40);
panel.add(submit);
JButton reset = new JButton("RESET");
reset.setFont(new Font("Times",Font.BOLD,15));
reset.setActionCommand("reset");
reset.setBounds(300,650,100,40);
panel.add(reset);
JButton exit = new JButton("EXIT");
exit.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 162


GPF MANAGMENT SYSTEM

exit.setActionCommand("exit");
exit.setBounds(400,650,100,40);
panel.add(exit);
JButton cal = new JButton("CALCULATE");
cal.setFont(new Font("Times",Font.BOLD,15));
cal.setActionCommand("cal");
cal.setBounds(500,650,130,40);
panel.add(cal);
exit.addActionListener(this);
submit.addActionListener(this);
reset.addActionListener(this);
show.addActionListener(this);
cal.addActionListener(this);
setTitle("Loan details");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(900,800);
setVisible(true);
panel.setBackground(Color.pink);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getActionCommand() == "submit")

PATNA WOMEN’S COLLEGE Page 163


GPF MANAGMENT SYSTEM

{
System.out.println(" Executing...");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5","
sa","kankarbagh");
stat=con.prepareStatement("INSERT INTO LOAN
VALUES(? , ? , ?,?, ? ,?,? )");
String acno = tacno.getText();
String date = tdate.getText();
String loantype="";
if(rb1.isSelected())
{
loantype="Refundable";
}
if(rb2.isSelected())
{
loantype="Non Refundable";
}
String loanamount = tloanamount.getText();
String installmentno = tinstallmentno.getText();

PATNA WOMEN’S COLLEGE Page 164


GPF MANAGMENT SYSTEM

String installmentamt = tinstallmentamt.getText();


String remarks="";
if(rb3.isSelected())
{
remarks="DAUGHTER MARRIAGE";
}
if(rb4.isSelected())
{
remarks="SON MARRIAGE";
}
if(rb5.isSelected())
{
remarks="HOME LOAN";
}
if(rb6.isSelected())
{
remarks="CHILD EDUCATION";
}
stat.setString(1, acno);
stat.setString(2, date);
stat.setString(3, loantype );
stat.setInt(4, Integer.parseInt(loanamount));

PATNA WOMEN’S COLLEGE Page 165


GPF MANAGMENT SYSTEM

stat.setString(5, installmentno);
stat.setString(6, installmentamt);
stat.setString(7,remarks);
stat.executeUpdate();
JOptionPane.showMessageDialog(this,"Inserted Sucessfully");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e);
}
}
if(ae.getActionCommand() == "reset")
{
tacno.setText(" ");
tvolume.setText(" ");
tcode.setText(" ");
tdate.setText(" ");
tloanamount.setText(" ");
tname.setText("");
tdesignation.setText("");
rb1.setSelected(false);
rb2.setSelected(false);

PATNA WOMEN’S COLLEGE Page 166


GPF MANAGMENT SYSTEM

tinstallmentno.setText("");
tinstallmentamt.setText("");
}
if(ae.getActionCommand() == "exit")
System.exit(0);
if(ae.getActionCommand() == "cal")
{
Float inst,lamt,iamt;
inst = Float.parseFloat(tinstallmentno.getText());
lamt =Float.parseFloat(tloanamount.getText());
iamt = lamt/inst;
tinstallmentamt.setText(String.valueOf(iamt));
}
if(ae.getActionCommand() == "show")
{
if(tacno.getText().trim().length()==0)
{
JOptionPane.showMessageDialog(this,"acno cant be left
blank");
return;
}
try

PATNA WOMEN’S COLLEGE Page 167


GPF MANAGMENT SYSTEM

{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5","
sa","kankarbagh");
stat=con.prepareStatement("select volume , code , f_name ,
designation from EMPINFO where acno=?");
stat.setString(1,tacno.getText());
ResultSet rs=stat.executeQuery();
if(!rs.next())
{
JOptionPane.showMessageDialog(this,"acno is not Valid");
}
else
{
String volume=rs.getString(1).toString().trim();
if(volume.equalsIgnoreCase("1"))
{
cb4.setSelectedIndex(0);
}
if(volume.equalsIgnoreCase("2"))
{
cb4.setSelectedIndex(1);

PATNA WOMEN’S COLLEGE Page 168


GPF MANAGMENT SYSTEM

}
if(volume.equalsIgnoreCase("3"))
{
cb4.setSelectedIndex(2);
}
if(volume.equalsIgnoreCase("4"))
{
cb4.setSelectedIndex(3);
}
if(volume.equalsIgnoreCase("5"))
{
cb4.setSelectedIndex(4);
}
if(volume.equalsIgnoreCase("6"))
{
cb4.setSelectedIndex(5);
}
if(volume.equalsIgnoreCase("7"))
{
cb4.setSelectedIndex(6);
}
if(volume.equalsIgnoreCase("8"))

PATNA WOMEN’S COLLEGE Page 169


GPF MANAGMENT SYSTEM

{
cb4.setSelectedIndex(7);
}
if(volume.equalsIgnoreCase("9"))
{
cb4.setSelectedIndex(8);
}
tcode.setText(rs.getString(2));
tname.setText(rs.getString(3));
tdesignation.setText(rs.getString(4));
tbalance.setText(rs.getString(5));
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e);
}
}
}
public static void main(String[] args)
{
loan reg=new loan(); } }

PATNA WOMEN’S COLLEGE Page 170


GPF MANAGMENT SYSTEM

CODE FOR LOAN REFUND FORM

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class refund extends JFrame implements
ActionListener
{
Connection con;
JComboBox cb4;
PreparedStatement stat;
public refund()
{
GridBagLayout g = new GridBagLayout();

PATNA WOMEN’S COLLEGE Page 171


GPF MANAGMENT SYSTEM

GridBagConstraints gbc = new GridBagConstraints();


JPanel panel = (JPanel)getContentPane();
panel.setLayout(null);
ImageIcon im = new ImageIcon("bseb-logo.jpg");
JLabel logo = new JLabel(im,JLabel.LEFT);
logo.setBounds(0,0,120,100);
panel.add(logo);
JLabel Head=new JLabel("LOAN REFUND");
Head.setFont(new Font("Times",Font.BOLD,24));
Head.setBounds(350,0,900,30);
panel.add(Head);
JLabel lacno= new JLabel("AC/NO");
lacno.setFont(new Font("Times",Font.BOLD,15));
lacno.setBounds(150,35,90,100);
panel.add(lacno);
JTextField tacno = new JTextField(6);
tacno.setBounds(250,70,90,30);
panel.add(tacno);
JLabel ldate= new JLabel("DATE");
ldate.setFont(new Font("Times",Font.BOLD,15));
ldate.setBounds(500,35,50,100);
panel.add(ldate);

PATNA WOMEN’S COLLEGE Page 172


GPF MANAGMENT SYSTEM

JTextField tdate = new JTextField(10);


tdate.setBounds(650,70,90,30);
panel.add(tdate);
JLabel lvolume= new JLabel("VOLUME");
lvolume.setFont(new Font("Times",Font.BOLD,15));
lvolume.setBounds(150,35,90,200);
panel.add(lvolume);
JComboBox cb4= new JComboBox();
cb4.addItem("1");
cb4.addItem("2");
cb4.addItem("3");
cb4.addItem("4");
cb4.addItem("5");
cb4.addItem("6");
cb4.addItem("7");
cb4.addItem("8");
cb4.addItem("9");
cb4.setBounds(250,120,90,30);
cb4.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb4);
JLabel lcode= new JLabel("CODE");
lcode.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 173


GPF MANAGMENT SYSTEM

lcode.setBounds(500,35,50,200);
panel.add(lcode);
JTextField tcode = new JTextField(30);
tcode.setBounds(650,120,90,30);
panel.add(tcode);
JLabel lname= new JLabel(" NAME");
lname.setFont(new Font("Times",Font.BOLD,15));
lname.setBounds(150,35,50,300);
panel.add(lname);
JTextField tname = new JTextField(20);
tname.setBounds(250,170,100,30);
panel.add(tname);
JLabel ldesignation = new JLabel("DESIGNATION");
ldesignation.setFont(new Font("Times",Font.BOLD,15));
ldesignation.setBounds(500,35,150,300);
panel.add(ldesignation);
JTextField tdesignation = new JTextField(30);
tdesignation.setBounds(650,170,100,30);
panel.add(tdesignation);
JLabel lloanamount = new JLabel("LOAN");
lloanamount.setFont(new Font("Times",Font.BOLD,15));
lloanamount.setBounds(150,35,100,400);

PATNA WOMEN’S COLLEGE Page 174


GPF MANAGMENT SYSTEM

panel.add(lloanamount);
JTextField tloanamount = new JTextField(10);
tloanamount.setBounds(250,220,90,30);
panel.add(tloanamount);
JLabel lrefundamount = new JLabel("REFUND");
lrefundamount.setFont(new Font("Times",Font.BOLD,15));
lrefundamount.setBounds(150,35,100,500);
panel.add(lrefundamount);
JTextField trefundamount = new JTextField(10);
trefundamount.setBounds(250,270,90,30);
panel.add(trefundamount);
JLabel lbalance = new JLabel("BALANCE");
lbalance.setFont(new Font("Times",Font.BOLD,15));
lbalance.setBounds(500,35,100,500);
panel.add(lbalance);
JTextField tbalance = new JTextField(10);
tbalance.setBounds(650,270,90,30);
panel.add(tbalance);
JButton show = new JButton("SHOW");
show.setFont(new Font("Times",Font.BOLD,15));
show.setActionCommand("show");
show.setBounds(100,400,100,40);

PATNA WOMEN’S COLLEGE Page 175


GPF MANAGMENT SYSTEM

panel.add(show);
JButton submit = new JButton("SUBMIT");
submit.setFont(new Font("Times",Font.BOLD,15));
submit.setActionCommand("submit");
submit.setBounds(200,400,100,40);
panel.add(submit);
JButton reset = new JButton("RESET");
reset.setFont(new Font("Times",Font.BOLD,15));
reset.setActionCommand("reset");
reset.setBounds(300,400,100,40);
panel.add(reset);
JButton cal = new JButton("CALCULATE");
cal.setFont(new Font("Times",Font.BOLD,15));
cal.setActionCommand("cal");
cal.setBounds(400,400,150,40);
panel.add(cal);
JButton exit = new JButton("EXIT");
exit.setActionCommand("exit");
exit.setFont(new Font("Times",Font.BOLD,15));
exit.setBounds(550,400,100,40);
panel.add(exit);
exit.addActionListener(this);

PATNA WOMEN’S COLLEGE Page 176


GPF MANAGMENT SYSTEM

submit.addActionListener(this);
reset.addActionListener(this);
show.addActionListener(this);
cal.addActionListener(this);
setTitle("Refund details");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(800,500);
setVisible(true);
panel.setBackground(Color.pink);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getActionCommand() == "submit")
{
System.out.println(" Executing...");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5","
sa","kankarbagh");
stat=con.prepareStatement("INSERT INTO REFUND VALUES(? ,
? , ? , ? )");

PATNA WOMEN’S COLLEGE Page 177


GPF MANAGMENT SYSTEM

String acno = tacno.getText();


String date = tdate.getText();
String refundamount = trefundamount.getText();
String balance = tbalance.getText();
stat.setString(1, acno);
stat.setString(2, date);
stat.setFloat(3, Float.parseFloat(refundamount));
stat.setFloat(4, Float.parseFloat(balance));
stat.executeUpdate();
JOptionPane.showMessageDialog(this,"Inserted Sucessfully");
}
catch(Exception e)
{
//System.out.println("Error "+e);
JOptionPane.showMessageDialog(this,e);
}
}
if(ae.getActionCommand() == "cal")
{
Float lamt,ramt,bal;
lamt = Float.parseFloat(tloanamount.getText());
ramt =Float.parseFloat(trefundamount.getText());

PATNA WOMEN’S COLLEGE Page 178


GPF MANAGMENT SYSTEM

bal = lamt-ramt;
tbalance.setText(String.valueOf(bal));
}

if(ae.getActionCommand() == "reset")
{
tacno.setText(" ");
tvolume.setText(" ");
tcode.setText(" ");
tdate.setText(" ");
tloanamount.setText(" ");
tname.setText(" ");
tdesignation.setText(" ");
tbalance.setText(" ");
trefundamount.setText(" ");
}
if(ae.getActionCommand() == "exit")
System.exit(0);
if(ae.getActionCommand() == "show")
{
if(tacno.getText().trim().length()==0)
{

PATNA WOMEN’S COLLEGE Page 179


GPF MANAGMENT SYSTEM

JOptionPane.showMessageDialog(this,"acno cant be left


blank");
return;
}
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5","
sa","kankarbagh");
stat=con.prepareStatement("select volume , code , f_name ,
designation,l_amount from EMPINFO,loan where
empinfo.acno=loan.acno");
ResultSet rs=stat.executeQuery();
if(!rs.next())
{
JOptionPane.showMessageDialog(this,"acno is not Valid");
}
else
{
String volume=rs.getString(1).toString().trim();
if(volume.equalsIgnoreCase("1"))
{
cb4.setSelectedIndex(0);
PATNA WOMEN’S COLLEGE Page 180
GPF MANAGMENT SYSTEM

}
if(volume.equalsIgnoreCase("2"))
{
cb4.setSelectedIndex(1);
}
if(volume.equalsIgnoreCase("3"))
{
cb4.setSelectedIndex(2);
}
if(volume.equalsIgnoreCase("4"))
{
cb4.setSelectedIndex(3);
}
if(volume.equalsIgnoreCase("5"))
{
cb4.setSelectedIndex(4);
}
if(volume.equalsIgnoreCase("6"))
{
cb4.setSelectedIndex(5);
}
if(volume.equalsIgnoreCase("7"))

PATNA WOMEN’S COLLEGE Page 181


GPF MANAGMENT SYSTEM

{
cb4.setSelectedIndex(6);
}
if(volume.equalsIgnoreCase("8"))
{
cb4.setSelectedIndex(7);
}
if(volume.equalsIgnoreCase("9"))
{
cb4.setSelectedIndex(8);
}
tcode.setText(rs.getString(2));
tname.setText(rs.getString(3));
tdesignation.setText(rs.getString(4));
tloanamount.setText(rs.getString(5));
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e);
}
}

PATNA WOMEN’S COLLEGE Page 182


GPF MANAGMENT SYSTEM

}
public static void main(String[] args)
{
refund r=new refund();
}
}

PATNA WOMEN’S COLLEGE Page 183


GPF MANAGMENT SYSTEM

CODE FOREMPLOYEE DETAIL

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class show extends JFrame implements
ActionListener
Connection con;
PreparedStatement stmt;
public show()
{

PATNA WOMEN’S COLLEGE Page 184


GPF MANAGMENT SYSTEM

GridBagLayout g = new GridBagLayout();


GridBagConstraints gbc = new GridBagConstraints();
JPanel panel = (JPanel)getContentPane();
panel.setLayout(null);
ImageIcon im = new ImageIcon("bseb-logo.jpg");
JLabel logo = new JLabel(im,JLabel.LEFT);
logo.setBounds(400,2,120,100);
panel.add(logo);
ImageIcon i = new ImageIcon("icon_reg.gif");
JLabel blogo = new JLabel(i,JLabel.LEFT);
blogo.setBounds(0,0,84,70);
panel.add(blogo);
JLabel Head=new JLabel("SHOW RECORD");
Head.setFont(new Font("Times",Font.BOLD,20));
Head.setBounds(500,25,900,30);
panel.add(Head);
JLabel lID= new JLabel("CODE");
lID.setFont(new Font("Times",Font.BOLD,15));
lID.setBounds(40,35,90,100);
panel.add(lID);
JTextField tID = new JTextField(5);
tID.setBounds(250,70,90,30);

PATNA WOMEN’S COLLEGE Page 185


GPF MANAGMENT SYSTEM

panel.add(tID);
JLabel lacno= new JLabel("AC/NO");
lacno.setBounds(600,35,90,100);
lacno.setFont(new Font("Times",Font.BOLD,15));
panel.add(lacno);
JTextField tacno = new JTextField(5);
tacno.setBounds(760,70,90,30);
panel.add(tacno);
JLabel lvolume= new JLabel("VOLUME");
lvolume.setBounds(920,35,90,100);
lvolume.setFont(new Font("Times",Font.BOLD,15));
panel.add(lvolume);
JComboBox cb1= new JComboBox();
cb1.addItem("1");
cb1.addItem("2");
cb1.addItem("3");
cb1.addItem("4");
cb1.addItem("5");
cb1.addItem("6");
cb1.addItem("7");
cb1.addItem("8");
cb1.addItem("9");

PATNA WOMEN’S COLLEGE Page 186


GPF MANAGMENT SYSTEM

cb1.setBounds(1050,70,90,30);
cb1.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb1);

JLabel lfname= new JLabel("FIRST NAME");


lfname.setBounds(40,35,100,200);
lfname.setFont(new Font("Times",Font.BOLD,15));
panel.add(lfname);
JTextField tfname = new JTextField(30);
tfname.setBounds(250,120,90,30);
panel.add(tfname);
JLabel lmname= new JLabel("MIDDLE NAME");
lmname.setBounds(600,35,150,200);
lmname.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmname);
JTextField tmname = new JTextField(30);
tmname.setBounds(760,120,90,30);
panel.add(tmname);
JLabel llname= new JLabel("LAST NAME");
llname.setBounds(920,35,150,200);
llname.setFont(new Font("Times",Font.BOLD,15));
panel.add(llname);

PATNA WOMEN’S COLLEGE Page 187


GPF MANAGMENT SYSTEM

JTextField tlname = new JTextField(15);


tlname.setBounds(1050,120,90,30);

panel.add(tlname);
JLabel lsex = new JLabel("SEX");
lsex.setBounds(40,35,90,300);
lsex.setFont(new Font("Times",Font.BOLD,15));
panel.add(lsex);
JRadioButton rb1 = new JRadioButton("MALE");
JRadioButton rb2 = new JRadioButton("FEMALE");
ButtonGroup bg = new ButtonGroup();
rb1.setBounds(250,170,80,30);
rb1.setFont(new Font("Times",Font.BOLD,15));
rb2.setBounds(340,170,100,30);
rb2.setFont(new Font("Times",Font.BOLD,15));
panel.add(rb1);
panel.add(rb2);
bg.add(rb1);
bg.add(rb2);
JLabel lDesignation = new JLabel("DESIGNATION");
lDesignation.setBounds(600,35,150,300);
lDesignation.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 188


GPF MANAGMENT SYSTEM

panel.add(lDesignation);
JTextField tDesignation = new JTextField(20);
tDesignation.setBounds(760,170,150,30);
panel.add(tDesignation);
JLabel lDOB = new JLabel("DATE OF BIRTH");
lDOB.setBounds(40,35,150,400);
lDOB.setFont(new Font("Times",Font.BOLD,15));
panel.add(lDOB);
JTextField tDOB = new JTextField(30);
tDOB.setBounds(250,220,90,30);
panel.add(tDOB);
JLabel ldoj = new JLabel("DATE OF JOINING");
ldoj.setBounds(600,30,150,400);
ldoj.setFont(new Font("Times",Font.BOLD,15));
panel.add(ldoj);
JTextField tdoj = new JTextField(30);
tdoj.setBounds(760,220,90,30);
panel.add(tdoj);
JLabel lcaste = new JLabel("CASTE");
lcaste.setBounds(40,35,90,500);
lcaste.setFont(new Font("Times",Font.BOLD,15));
panel.add(lcaste);

PATNA WOMEN’S COLLEGE Page 189


GPF MANAGMENT SYSTEM

JComboBox cb4= new JComboBox();


cb4.addItem("GENERAL");
cb4.addItem("SC");
cb4.addItem("ST");
cb4.addItem("OBC");
cb4.setBounds(250,270,110,30);
cb4.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb4);
JLabel lreligion = new JLabel("RELIGION");
lreligion.setBounds(600,35,90,500);
lreligion.setFont(new Font("Times",Font.BOLD,15));
panel.add(lreligion);
JComboBox cb2= new JComboBox();
cb2.addItem("HINDU");
cb2.addItem("MUSLIM");
cb2.addItem("CHRISTIAN");
cb2.addItem("SHIKH");
cb2.setBounds(760,270,90,30);
cb2.setFont(new Font("Times",Font.BOLD,15));
panel.add(cb2);
JLabel lfathername = new JLabel("FATHER'S NAME");
lfathername.setBounds(40,35,140,600);

PATNA WOMEN’S COLLEGE Page 190


GPF MANAGMENT SYSTEM

lfathername.setFont(new Font("Times",Font.BOLD,15));
panel.add(lfathername);
JTextField tfathername = new JTextField(30);
tfathername.setBounds(250,320,200,30);
panel.add(tfathername);
JLabel lmobileno = new JLabel("MOBILE NO");
lmobileno.setBounds(600,35,140,600);
lmobileno.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmobileno);
JTextField tmobileno = new JTextField(30);
tmobileno.setBounds(760,320,90,30);
panel.add(tmobileno);
JLabel lmaritalstatus = new JLabel("MARITAL STATUS");
lmaritalstatus.setBounds(40,35,150,700);
lmaritalstatus.setFont(new Font("Times",Font.BOLD,15));
panel.add(lmaritalstatus);
JComboBox cb3 = new JComboBox();
cb3.addItem("SINGLE");
cb3.addItem("MARRIED");
cb3.addItem("WIDOW");
cb3.setBounds(250,370,100,30);
cb3.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 191


GPF MANAGMENT SYSTEM

panel.add(cb3);
JLabel lspousename = new JLabel("SPOUSE NAME");
lspousename.setBounds(40,35,150,800);
lspousename.setFont(new Font("Times",Font.BOLD,15));
panel.add(lspousename);
JTextField tspousename = new JTextField(30);
tspousename.setBounds(250,420,200,30);
panel.add(tspousename);
JLabel lAddress = new JLabel("PRESENT ADDRESS");
lAddress.setBounds(40,35,150,900);
lAddress.setFont(new Font("Times",Font.BOLD,15));
panel.add(lAddress);
JTextField tAddress = new JTextField(30);
tAddress.setBounds(250,470,200,30);
panel.add(tAddress);
JLabel lAddress1 = new JLabel("PERMANENT ADDRESS");
lAddress1.setBounds(600,35,200,900);
lAddress1.setFont(new Font("Times",Font.BOLD,15));
panel.add(lAddress1);
JTextField tAddress1 = new JTextField(30);
tAddress1.setBounds(780,470,200,30);
panel.add(tAddress1);

PATNA WOMEN’S COLLEGE Page 192


GPF MANAGMENT SYSTEM

JLabel lbasic = new JLabel("BASIC SALARY");


lbasic.setBounds(40,35,200,1000);
lbasic.setFont(new Font("Times",Font.BOLD,15));
panel.add(lbasic);
JTextField tbasic = new JTextField(30);
tbasic.setBounds(250,520,90,30);
panel.add(tbasic);
JLabel lidmark = new JLabel("IDENTIFICATION MARK");
lidmark.setBounds(600,35,200,1000);
lidmark.setFont(new Font("Times",Font.BOLD,15));
panel.add(lidmark);
JTextField tidmark = new JTextField(30);
tidmark.setBounds(780,520,200,30);
panel.add(tidmark);
JLabel lnominee1 = new JLabel("NOMINEE 1");
lnominee1.setBounds(40,30,100,1100);
lnominee1.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnominee1);
JTextField tnominee1 = new JTextField(30);
tnominee1.setBounds(250,570,150,30);
panel.add(tnominee1);
JLabel lnom1age = new JLabel("AGE");

PATNA WOMEN’S COLLEGE Page 193


GPF MANAGMENT SYSTEM

lnom1age.setBounds(440,30,90,1100);
lnom1age.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnom1age);
JTextField tnom1age = new JTextField(2);
tnom1age.setBounds(490,570,90,30);
panel.add(tnom1age);
JLabel lnom1relation = new JLabel("RELATION");
lnom1relation.setFont(new Font("Times",Font.BOLD,15));
lnom1relation.setBounds(600,30,90,1100);
panel.add(lnom1relation);
JTextField tnom1relation = new JTextField(15);
tnom1relation.setBounds(690,570,90,30);
panel.add(tnom1relation);
JLabel lnom1pa = new JLabel("PAYABLE AMOUNT");
lnom1pa.setFont(new Font("Times",Font.BOLD,15));
lnom1pa.setBounds(800,30,150,1100);
panel.add(lnom1pa);
JTextField tnom1pa = new JTextField(15);
tnom1pa.setBounds(950,570,90,30);
panel.add(tnom1pa);
JLabel lnominee2 = new JLabel("NOMINEE 2");
lnominee2.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 194


GPF MANAGMENT SYSTEM

lnominee2.setBounds(40,35,100,1160);
panel.add(lnominee2);
JTextField tnominee2 = new JTextField(30);
tnominee2.setBounds(250,600,150,30);
panel.add(tnominee2);
JLabel lnom2age = new JLabel("AGE");
lnom2age.setFont(new Font("Times",Font.BOLD,15));
lnom2age.setBounds(440,35,90,1160);
panel.add(lnom2age);
JTextField tnom2age = new JTextField(2);
tnom2age.setBounds(490,600,90,30);
panel.add(tnom2age);
JLabel lnom2relation = new JLabel("RELATION");
lnom2relation.setBounds(600,35,90,1160);
lnom2relation.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnom2relation);
JTextField tnom2relation = new JTextField(15);
tnom2relation.setBounds(690,600,90,30);
panel.add(tnom2relation);
lnom2pa = new JLabel("PAYABLE AMOUNT");
lnom2pa.setFont(new Font("Times",Font.BOLD,15));
lnom2pa.setBounds(800,35,150,1160);

PATNA WOMEN’S COLLEGE Page 195


GPF MANAGMENT SYSTEM

panel.add(lnom2pa);
JTextField tnom2pa = new JTextField(15);
tnom2pa.setBounds(950,600,90,30);
panel.add(tnom2pa);
JLabel lnominee3 = new JLabel("NOMINEE 3");
lnominee3.setBounds(40,35,100,1230);
lnominee3.setFont(new Font("Times",Font.BOLD,15));
panel.add(lnominee3);
JTextField tnominee3 = new JTextField(30);
tnominee3.setBounds(250,630,150,30);
panel.add(tnominee3);
JLabel lnom3age = new JLabel(" AGE");
lnom3age.setBounds(440,35,90,1230);
panel.add(lnom3age);
JTextField tnom3age = new JTextField(2);
lnom3age.setFont(new Font("Times",Font.BOLD,15));
tnom3age.setBounds(490,630,90,30);
panel.add(tnom3age);
JLabel lnom3relation = new JLabel("RELATION");
lnom3relation.setFont(new Font("Times",Font.BOLD,15));
lnom3relation.setBounds(600,35,90,1230);
panel.add(lnom3relation);

PATNA WOMEN’S COLLEGE Page 196


GPF MANAGMENT SYSTEM

JTextField tnom3relation =new JTextField(15);


tnom3relation.setBounds(690,630,90,30);
panel.add(tnom3relation);
JLabel lnom3pa = new JLabel("PAYABLE AMOUNT");
lnom3pa.setFont(new Font("Times",Font.BOLD,15));
lnom3pa.setBounds(800,35,150,1230);
panel.add(lnom3pa);
JTextField tnom3pa = new JTextField(15);
tnom3pa.setBounds(950,630,90,30);
panel.add(tnom3pa);
JButton show = new JButton("SHOW");
show.setActionCommand("show");
show.setFont(new Font("Times",Font.BOLD,15));
show.setBounds(1100,400,100,40);
panel.add(show);
JButton reset = new JButton("RESET");
reset.setFont(new Font("Times",Font.BOLD,15));
reset.setActionCommand("reset");
reset.setBounds(1100,450,100,40);
panel.add(reset);
JButton exit = new JButton("EXIT");
exit.setFont(new Font("Times",Font.BOLD,15));

PATNA WOMEN’S COLLEGE Page 197


GPF MANAGMENT SYSTEM

exit.setActionCommand("exit");
exit.setBounds(1100,500,100,40);
panel.add(exit);
exit.addActionListener(this);
reset.addActionListener(this);
show.addActionListener(this);
setTitle("Employee details");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(1300,1300);
setVisible(true);
panel.setBackground(Color.pink);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getActionCommand() == "show")
{
if(tID.getText().trim().length()==0)
{
JOptionPane.showMessageDialog(this,"Code cant be left
blank");
return;
}

PATNA WOMEN’S COLLEGE Page 198


GPF MANAGMENT SYSTEM

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5",
"sa","kankarbagh");
stmt=con.prepareStatement("select * from EMPINFO where
code=?");
stmt.setString(1,tID.getText());
ResultSet rs=stmt.executeQuery();
if(!rs.next())
{
JOptionPane.showMessageDialog(this,"Code is not Valid");
}
else
{
tacno.setText(rs.getString(2));
String volume=rs.getString(3).toString().trim();
if(volume.equalsIgnoreCase("1"))
{
cb4.setSelectedIndex(0);
}
if(volume.equalsIgnoreCase("2"))

PATNA WOMEN’S COLLEGE Page 199


GPF MANAGMENT SYSTEM

{
cb4.setSelectedIndex(1);
}
if(volume.equalsIgnoreCase("3"))
{
cb4.setSelectedIndex(2);
}
if(volume.equalsIgnoreCase("4"))
{
cb4.setSelectedIndex(3);
}
if(volume.equalsIgnoreCase("5"))
{
cb4.setSelectedIndex(4);
}
if(volume.equalsIgnoreCase("6"))
{
cb4.setSelectedIndex(5);
}
if(volume.equalsIgnoreCase("7"))
{
cb4.setSelectedIndex(6);

PATNA WOMEN’S COLLEGE Page 200


GPF MANAGMENT SYSTEM

}
if(volume.equalsIgnoreCase("8"))
{
cb4.setSelectedIndex(7);
}
if(volume.equalsIgnoreCase("9"))
{
cb4.setSelectedIndex(8);
}
tfname.setText(rs.getString(4));
tmname.setText(rs.getString(5));
tlname.setText(rs.getString(6));
String sex=rs.getString(7).toString().trim();
if(sex.equalsIgnoreCase("MALE"))
{
rb1.setSelected(true);
}
if(sex.equalsIgnoreCase("FEMALE"))
{
rb2.setSelected(true);
}
tDesignation.setText(rs.getString(8));

PATNA WOMEN’S COLLEGE Page 201


GPF MANAGMENT SYSTEM

tDOB.setText(rs.getString(9));
tdoj.setText(rs.getString(10));
String caste=rs.getString(11).toString().trim();
if(caste.equalsIgnoreCase("GENERAL"))
{
cb1.setSelectedIndex(0);
}
if(caste.equalsIgnoreCase("SC"))
{
cb1.setSelectedIndex(1);
}
if(caste.equalsIgnoreCase("ST"))
{
cb1.setSelectedIndex(2);
}
if(caste.equalsIgnoreCase("OBC"))
{
cb1.setSelectedIndex(2);
}
String religion=rs.getString(12).toString().trim();
if(religion.equalsIgnoreCase("HINDU"))
{

PATNA WOMEN’S COLLEGE Page 202


GPF MANAGMENT SYSTEM

cb2.setSelectedIndex(0);
}
if(religion.equalsIgnoreCase("MUSLIM"))
{
cb2.setSelectedIndex(1);
}
if(religion.equalsIgnoreCase("CHRISTIAN"))
{
cb2.setSelectedIndex(2);
}
if(religion.equalsIgnoreCase("SHIKH"))
{
cb2.setSelectedIndex(3);
}
tfathername.setText(rs.getString(13));
tmobileno.setText(rs.getString(14));
String ms=rs.getString(15).toString().trim();
if(ms.equalsIgnoreCase("SINGLE"))
{
cb3.setSelectedIndex(0);
}
if(ms.equalsIgnoreCase("MARRIED"))

PATNA WOMEN’S COLLEGE Page 203


GPF MANAGMENT SYSTEM

{
cb3.setSelectedIndex(1);
}
if(ms.equalsIgnoreCase("WIDOW"))
{
cb3.setSelectedIndex(2);
}
tspousename.setText(rs.getString(16));
tAddress.setText(rs.getString(17));
tAddress1.setText(rs.getString(18));
tbasic.setText(rs.getString(19));
tidmark.setText(rs.getString(20));
tnominee1.setText(rs.getString(21));
tnominee2.setText(rs.getString(22));
tnominee3.setText(rs.getString(23));
tnom1relation.setText(rs.getString(24));
tnom2relation.setText(rs.getString(25));
tnom3relation.setText(rs.getString(26));
tnom1age.setText(rs.getString(27));
tnom2age.setText(rs.getString(28));
tnom3age.setText(rs.getString(29));
tnom1pa.setText(rs.getString(30));

PATNA WOMEN’S COLLEGE Page 204


GPF MANAGMENT SYSTEM

tnom2pa.setText(rs.getString(31));
tnom3pa.setText(rs.getString(32));
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e);
}
}
if(ae.getActionCommand() == "reset")
{
tacno.setText(" ");
tidmark.setText(" ");
tDesignation.setText(" ");
tID.setText(" ");
tdoj.setText("");
tfname.setText(" ");
tfathername.setText(" ");
tspousename.setText(" ");
tID.setText(" ");
tAddress.setText("");
tAddress1.setText("");

PATNA WOMEN’S COLLEGE Page 205


GPF MANAGMENT SYSTEM

tlname.setText("");
tDOB.setText("");
tmobileno.setText("");
tnominee1.setText("");
tnominee2.setText("");
tnominee3.setText("");
tnom1age.setText("");
tnom2age.setText("");
tnom3age.setText("");
tnom1relation.setText("");
tnom2relation.setText("");
tnom3relation.setText("");
tnom1pa.setText("");
tnom2pa.setText("");
tnom3pa.setText("");
tbasic.setText("");
}
if(ae.getActionCommand() == "exit")
dispose();
}
public static void main(String[] args)
{

PATNA WOMEN’S COLLEGE Page 206


GPF MANAGMENT SYSTEM

show reg=new show();


}
}

PATNA WOMEN’S COLLEGE Page 207


GPF MANAGMENT SYSTEM

CODE FOR LOAN DETAIL

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class ldet extends JFrame implements ActionListener
{
JPanel panel;
JLabel Head;
JLabel lname;
JLabel lacno;
JLabel ldesignation;
JLabel lbalance;

PATNA WOMEN’S COLLEGE Page 208


GPF MANAGMENT SYSTEM

JLabel lloanamount;
JLabel refundamt;
JButton reset;
JButton exit;
JButton show;
JTextField tacno;
JTextField tbalance;
JTextField trefundamt;
JTextField tname;
JTextField tloanamount;
JTextField tdesignation;
GridBagLayout g;
GridBagConstraints gbc;
Connection con;
PreparedStatement stat;
public ldet()
{
g = new GridBagLayout();
gbc = new GridBagConstraints();
panel = (JPanel)getContentPane();
panel.setLayout(null);
ImageIcon im = new ImageIcon("bseb-logo.jpg");

PATNA WOMEN’S COLLEGE Page 209


GPF MANAGMENT SYSTEM

JLabel logo = new JLabel(im,JLabel.LEFT);


logo.setBounds(0,2,120,100);
panel.add(logo);
JLabel Head=new JLabel("LOAN DETAIL");
Head.setFont(new Font("Times",Font.BOLD,24));
Head.setBounds(300,0,900,30);
panel.add(Head);
lacno= new JLabel("AC/NO");
lacno.setFont(new Font("Times",Font.BOLD,15));
lacno.setBounds(100,35,90,100);
panel.add(lacno);
tacno = new JTextField(6);
tacno.setFont(new Font("Times",Font.BOLD,15));
tacno.setBounds(300,70,90,30);
panel.add(tacno);
lname= new JLabel(" NAME");
lname.setFont(new Font("Times",Font.BOLD,15));
lname.setBounds(100,35,50,200);
panel.add(lname);
tname = new JTextField(20);
tname.setFont(new Font("Times",Font.BOLD,15));
tname.setBounds(300,120,90,30);

PATNA WOMEN’S COLLEGE Page 210


GPF MANAGMENT SYSTEM

panel.add(tname);
ldesignation = new JLabel("DESIGNATION");
ldesignation.setFont(new Font("Times",Font.BOLD,15));
ldesignation.setBounds(100,35,150,300);
panel.add(ldesignation);
tdesignation = new JTextField(30);
tdesignation.setFont(new Font("Times",Font.BOLD,15));
tdesignation.setBounds(300,170,90,30);
panel.add(tdesignation);
lloanamount = new JLabel("LOAN AMOUNT");
lloanamount.setFont(new Font("Times",Font.BOLD,15));
lloanamount.setBounds(100,35,150,400);
panel.add(lloanamount);
tloanamount = new JTextField(30);
tloanamount.setFont(new Font("Times",Font.BOLD,15));
tloanamount.setBounds(300,220,90,30);
panel.add(tloanamount);
refundamt = new JLabel("REFUND AMOUNT");
refundamt.setFont(new Font("Times",Font.BOLD,15));
refundamt.setBounds(100,35,200,500);
panel.add(refundamt);
trefundamt = new JTextField(30);

PATNA WOMEN’S COLLEGE Page 211


GPF MANAGMENT SYSTEM

trefundamt.setFont(new Font("Times",Font.BOLD,15));
trefundamt.setBounds(300,270,90,30);
panel.add(trefundamt);
lbalance = new JLabel("BALANCE");
lbalance .setFont(new Font("Times",Font.BOLD,15));
lbalance .setBounds(100,35,200,600);
panel.add(lbalance );
tbalance = new JTextField(30);
tbalance .setFont(new Font("Times",Font.BOLD,15));
tbalance.setBounds(300,320,90,30);
panel.add(tbalance);
show = new JButton("SHOW");
show.setFont(new Font("Times",Font.BOLD,15));
show.setActionCommand("show");
show.setBounds(500,70,90,40);
panel.add(show);
reset = new JButton("RESET");
reset.setFont(new Font("Times",Font.BOLD,15));
reset.setActionCommand("reset");
reset.setBounds(500,120,90,40);
panel.add(reset);
exit = new JButton("EXIT");

PATNA WOMEN’S COLLEGE Page 212


GPF MANAGMENT SYSTEM

exit.setFont(new Font("Times",Font.BOLD,15));
exit.setActionCommand("exit");
exit.setBounds(500,170,90,40);
panel.add(exit);
exit.addActionListener(this);
reset.addActionListener(this);
show.addActionListener(this);
setTitle("Loan details");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(650,350);
setVisible(true);
panel.setBackground(Color.pink);
}public void actionPerformed(ActionEvent ae)
{
if(ae.getActionCommand() == "reset")
{
tacno.setText(" ");
tloanamount.setText(" ");
tname.setText("");
tdesignation.setText("");
trefundamt.setText("");
tbalance.setText("");

PATNA WOMEN’S COLLEGE Page 213


GPF MANAGMENT SYSTEM

}
if(ae.getActionCommand() == "exit")
dispose();
if(ae.getActionCommand() == "show")
{
if(tacno.getText().trim().length()==0)
{
JOptionPane.showMessageDialog(this,"acno cant be left
blank");
return;
}
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5",
"sa","kankarbagh");
stat=con.prepareStatement("select f_name , designation ,
l_amount , refund , balance from EMPINFO,LOAN,REFUND
where EMPINFO.ACNO=LOAN.ACNO and
LOAN.ACNO=REFUND.ACNO and REFUND.ACNO =?");
stat.setString(1,tacno.getText());
ResultSet rs=stat.executeQuery();
if(!rs.next())

PATNA WOMEN’S COLLEGE Page 214


GPF MANAGMENT SYSTEM

{
JOptionPane.showMessageDialog(this,"acno is not Valid");
}
else
{
tname.setText(rs.getString(1));
tdesignation.setText(rs.getString(2));
tloanamount.setText(rs.getString(3));
trefundamt.setText(rs.getString(4));
tbalance.setText(rs.getString(5));
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e);
}
}
}
public static void main(String[] args)
{
ldet reg=new ldet();
}

PATNA WOMEN’S COLLEGE Page 215


GPF MANAGMENT SYSTEM

CODE FOR GPF DETAIL

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class gpfdet extends JFrame implements
ActionListener
{
JPanel panel;
JLabel Head;
JLabel lacno;
JLabel ldesignation;
JLabel lname;

PATNA WOMEN’S COLLEGE Page 216


GPF MANAGMENT SYSTEM

JLabel lbalance;
JLabel lgrand;
JLabel cont;
JButton reset;
JButton exit;
JButton show;
JTextField tacno;
JTextField tbalance;
JTextField tcont;
JTextField tname;
JTextField total;
JTextField tdesignation;
JTextField tgrand;
GridBagLayout g;
GridBagConstraints gbc;
Connection con;
PreparedStatement stat;
public gpfdet()
{
g = new GridBagLayout();
gbc = new GridBagConstraints();
panel = (JPanel)getContentPane();

PATNA WOMEN’S COLLEGE Page 217


GPF MANAGMENT SYSTEM

panel.setLayout(null);
ImageIcon im = new ImageIcon("bseb-logo.jpg");
JLabel logo = new JLabel(im,JLabel.LEFT);
logo.setBounds(0,2,120,100);
panel.add(logo);
Head=new JLabel("GPF DETAIL");
Head.setFont(new Font("Times",Font.BOLD,24));
Head.setBounds(300,0,900,30);
panel.add(Head);
lacno= new JLabel("AC/NO");
lacno.setFont(new Font("Times",Font.BOLD,15));
lacno.setBounds(100,35,90,100);
panel.add(lacno);
tacno = new JTextField(6);
tacno.setFont(new Font("Times",Font.BOLD,15));
tacno.setBounds(300,70,90,30);
panel.add(tacno);
lname= new JLabel(" NAME");
lname.setFont(new Font("Times",Font.BOLD,15));
lname.setBounds(100,35,50,200);
panel.add(lname);
tname = new JTextField(20);

PATNA WOMEN’S COLLEGE Page 218


GPF MANAGMENT SYSTEM

tname.setFont(new Font("Times",Font.BOLD,15));
tname.setBounds(300,120,90,30);
panel.add(tname);
ldesignation = new JLabel("DESIGNATION");
ldesignation.setFont(new Font("Times",Font.BOLD,15));
ldesignation.setBounds(100,35,150,300);
panel.add(ldesignation);
tdesignation = new JTextField(30);
tdesignation.setFont(new Font("Times",Font.BOLD,15));
tdesignation.setBounds(300,170,90,30);
panel.add(tdesignation);
lbalance = new JLabel("BALANCE(B/F)");
lbalance.setFont(new Font("Times",Font.BOLD,15));
lbalance.setBounds(100,35,150,400);
panel.add(lbalance);
tbalance = new JTextField(30);
tbalance.setFont(new Font("Times",Font.BOLD,15));
tbalance.setBounds(300,220,90,30);
panel.add(tbalance);
cont = new JLabel("CONTRIBUTION AMOUNT");
cont.setFont(new Font("Times",Font.BOLD,15));
cont.setBounds(100,35,200,500);

PATNA WOMEN’S COLLEGE Page 219


GPF MANAGMENT SYSTEM

panel.add(cont);
tcont = new JTextField(30);
tcont.setFont(new Font("Times",Font.BOLD,15));
tcont.setBounds(300,270,90,30);
panel.add(tcont);
lgrand = new JLabel("GRAND TOTAL");
lgrand .setFont(new Font("Times",Font.BOLD,15));
lgrand .setBounds(100,35,200,600);
panel.add(lgrand );
tgrand = new JTextField(30);
tgrand .setFont(new Font("Times",Font.BOLD,15));
tgrand.setBounds(300,320,90,30);
panel.add(tgrand);
show = new JButton("SHOW");
show.setFont(new Font("Times",Font.BOLD,15));
show.setActionCommand("show");
show.setBounds(500,70,90,40);
panel.add(show);
reset = new JButton("RESET");
reset.setFont(new Font("Times",Font.BOLD,15));
reset.setActionCommand("reset");
reset.setBounds(500,120,90,40);

PATNA WOMEN’S COLLEGE Page 220


GPF MANAGMENT SYSTEM

panel.add(reset);
exit = new JButton("EXIT");
exit.setFont(new Font("Times",Font.BOLD,15));
exit.setActionCommand("exit");
exit.setBounds(500,170,90,40);
panel.add(exit);
exit.addActionListener(this);
reset.addActionListener(this);
show.addActionListener(this);
setTitle("Loan details");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(650,450);
setVisible(true);
panel.setBackground(Color.pink);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getActionCommand() == "reset")
{
tacno.setText(" ");
tgrand.setText(" ");
tname.setText("");

PATNA WOMEN’S COLLEGE Page 221


GPF MANAGMENT SYSTEM

tdesignation.setText("");
tcont.setText("");
tbalance.setText("");
}
if(ae.getActionCommand() == "exit")
dispose();
if(ae.getActionCommand() == "show")
{
if(tacno.getText().trim().length()==0)
{
JOptionPane.showMessageDialog(this,"acno cant be left
blank");
return;
}
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5",
"sa","kankarbagh");
stat=con.prepareStatement("select
f_name,designation,GPF_B_F,CONTRIBUTED from
EMPINFO,GPFSUMMARY,GPF where

PATNA WOMEN’S COLLEGE Page 222


GPF MANAGMENT SYSTEM

EMPINFO.ACNO=GPFSUMMARY.ACNO and
GPFSUMMARY.ACNO=GPF.ACNO and GPF.ACNO =?");
stat.setString(1,tacno.getText());
ResultSet rs=stat.executeQuery();
if(!rs.next())
{
JOptionPane.showMessageDialog(this,"acno is not Valid");
}
else
{
tname.setText(rs.getString(1));
tdesignation.setText(rs.getString(2));
tbalance.setText(rs.getString(3));
tcont.setText(rs.getString(4));
Float ba,cont,tot;
ba = Float.parseFloat(tbalance.getText());
cont =Float.parseFloat(tcont.getText());
tot = ba+cont;
tgrand.setText(String.valueOf(tot));
}
}
catch(Exception e)

PATNA WOMEN’S COLLEGE Page 223


GPF MANAGMENT SYSTEM

{
JOptionPane.showMessageDialog(this,e);
}
}
}
public static void main(String[] args)
{
gpfdet reg=new gpfdet();
}
}

PATNA WOMEN’S COLLEGE Page 224


GPF MANAGMENT SYSTEM

CODE FOR MONTHLY REPORT

import javax.swing.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.print.*;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.standard.*;
import javax.print.*;
import java.lang.Object;

PATNA WOMEN’S COLLEGE Page 225


GPF MANAGMENT SYSTEM

public class monthreport extends JFrame implements


ActionListener,Printable,MouseListener
{
Connection con;
Statement stmt;
ResultSet rs;
JPopupMenu File = new JPopupMenu("FILE");
JMenuItem Print = new JMenuItem("PRINT");
JMenuItem PageSetup = new JMenuItem("PAGE SETUP");
JMenuItem Exit = new JMenuItem("EXIT");
JLabel head = new JLabel("BIHAR STATE ELECTRICITY
BOARD",JLabel.CENTER);
JLabel head1 = new JLabel("GPF SUMMARY REPORT");
ImageIcon logo = new ImageIcon("bseb-logo.jpg");
JLabel l = new JLabel(logo,JLabel.LEFT);
PrintManager pm = new
PrintManager(this.getRootPane(),"REPORT PRINTING");
PrinterJob printerjob = PrinterJob.getPrinterJob();
PageFormat pageformat = printerjob.defaultPage();
PrintService printer = printerjob.getPrintService();
Container cn;
JPanel panel;
public monthreport()

PATNA WOMEN’S COLLEGE Page 226


GPF MANAGMENT SYSTEM

{
panel = new JPanel()
{protected void paintcomponent(Graphics g)
{
g.drawLine(10,170,1250,170);
}
};
cn=getContentPane();
panel.setOpaque(false);
panel.setPreferredSize(new Dimension(1,1));
cn.add(panel);
panel.setLayout(null);
panel.addMouseListener(this);
File.add(Print);
File.addSeparator();
File.add(PageSetup);
File.addSeparator();
File.add(Exit);
File.addSeparator();
Print.addActionListener(this);
PageSetup.addActionListener(this);
Exit.addActionListener(this);

PATNA WOMEN’S COLLEGE Page 227


GPF MANAGMENT SYSTEM

addcomp(250,0,200,100,l);
addcomp(350,0,500,30,head);
head.setFont(new Font("Algerian",Font.BOLD,24));
addcomp(520,100,400,30,head1);
head1.setFont(new Font("Times",Font.BOLD,15));
addcomp(900,20,100,30,new JLabel("MONTH"));
addcomp(1000,20,100,30,new JLabel("AUGUST"));
addcomp(900,40,100,30,new JLabel("VOLUME"));
addcomp(1000,40,100,30,new JLabel("1"));
addcomp(10,140,100,30,new JLabel("CODE"));
addcomp(100,140,100,30,new JLabel("NAME"));
addcomp(260,140,100,30,new JLabel("DESIGNATION"));
addcomp(440,140,100,30,new JLabel("BASIC"));
addcomp(580,140,100,30,new JLabel("ACCOUNT NO."));
addcomp(720,140,100,30,new JLabel("GPF(C)"));
addcomp(820,140,100,30,new JLabel("GPF-DA"));
addcomp(920,140,100,30,new JLabel("GPF(R)"));
addcomp(1020,140,100,30,new JLabel("TOTAL Rs"));
try
{
int r=170;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

PATNA WOMEN’S COLLEGE Page 228


GPF MANAGMENT SYSTEM

con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE5",
"sa","kankarbagh");
stmt = con.createStatement();
rs =stmt.executeQuery("select
CODE,F_name,Designation,basic,EMPINFO.ACNO,CONTRIBUT
ED,DA,REFUND,TOT from EMPINFO,GPF,REFUND WHERE
EMPINFO.ACNO = GPF.ACNO and GPF.ACNO = REFUND.ACNO
and REFUND.ACNO = GPF.ACNO");
while(rs.next())
{
addcomp(10,r,100,30,new JLabel(rs.getString("CODE")));
addcomp(100,r,100,30,new JLabel(rs.getString("F_name")));
addcomp(260,r,200,30,new
JLabel(rs.getString("Designation")));
addcomp(440,r,100,30,new JLabel(rs.getString("basic")));
addcomp(580,r,100,30,new JLabel(rs.getString("ACNO")));
addcomp(720,r,100,30,new
JLabel(rs.getString("CONTRIBUTED")));
addcomp(820,r,100,30,new JLabel(rs.getString("DA")));
addcomp(920,r,100,30,new JLabel(rs.getString("REFUND")));
addcomp(1020,r,100,30,new JLabel(rs.getString("TOT")));
r=r+25;
}
}
PATNA WOMEN’S COLLEGE Page 229
GPF MANAGMENT SYSTEM

catch(SQLException e)
{
JOptionPane.showMessageDialog(this,e.getMessage());
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e.getMessage());
}
setBounds(0,0,1250,740);
setTitle("monthly detail");
setResizable(false);
setVisible(true);
}
public void addcomp(int x,int y,int w,int h,Container cn)
{
cn.setBounds(x,y,w,h);
panel.add(cn);
}
public int print(Graphics g,PageFormat pageformat,int
pageindex)
{
if(pageindex>0)

PATNA WOMEN’S COLLEGE Page 230


GPF MANAGMENT SYSTEM

return NO_SUCH_PAGE;
Graphics2D g2D=(Graphics2D)g;
double scalex=pageformat.getImageableWidth()/getWidth();
double
scaley=pageformat.getImageableHeight()/getHeight();
double scale = Math.min(scalex,scaley);
g2D.translate(pageformat.getImageableX(),pageformat.getI
mageableY());
g2D.scale(scale,scale);
print(g2D);
return PAGE_EXISTS;
}
public void actionPerformed(ActionEvent ae)
{
String com=ae.getActionCommand();
if(com.equals("EXIT"))
dispose();
else if(com.equals("PAGE SETUP"))
{
pm.showPageSetup();
}
else if(com.equals("PRINT"))

PATNA WOMEN’S COLLEGE Page 231


GPF MANAGMENT SYSTEM

{
pm.doPrint();
}
}
public void mousePressed(MouseEvent e)
{
if(e.getButton()==MouseEvent.BUTTON3)
{
if(e.getModifiers()!=0)
{
File.show(this,e.getX(),e.getY());
}
}
}
public void mouseClicked(MouseEvent e){}
public void mouseReleased(MouseEvent e){}
public void mouseEntered(MouseEvent e){}
public void mouseExited(MouseEvent e){}
public static void main(String [] args)
{
new monthreport(); } }

PATNA WOMEN’S COLLEGE Page 232


GPF MANAGMENT SYSTEM

CODE FOR YEARLY STATEMENT

import javax.swing.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.print.*;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.standard.*;
import javax.print.*;
import java.lang.Object;
public class yearreport extends JFrame implements
ActionListener,Printable,MouseListener
PATNA WOMEN’S COLLEGE Page 233
GPF MANAGMENT SYSTEM

{
Connection con;
Statement stmt;
ResultSet rs;
JPopupMenu File = new JPopupMenu("FILE");
JMenuItem Print = new JMenuItem("PRINT");
JMenuItem PageSetup = new JMenuItem("PAGE SETUP");
JMenuItem Exit = new JMenuItem("EXIT");
JLabel head = new JLabel("BIHAR STATE ELECTRICITY
BOARD",JLabel.CENTER);
JLabel head1 = new JLabel("YEARLY STATEMENT");
ImageIcon logo = new ImageIcon("bseb-logo.jpg");
JLabel l = new JLabel(logo,JLabel.LEFT);
PrintManager pm = new
PrintManager(this.getRootPane(),"REPORT PRINTING");
PrinterJob printerjob = PrinterJob.getPrinterJob();
PageFormat pageformat = printerjob.defaultPage();
PrintService printer = printerjob.getPrintService();
Container cn;
JPanel panel;
public yearreport()
{

PATNA WOMEN’S COLLEGE Page 234


GPF MANAGMENT SYSTEM

panel = new JPanel()


{
protected void paintcomponent(Graphics g)
{
g.drawLine(10,170,1250,170);
}
};
cn=getContentPane();
panel.setOpaque(false);
panel.setPreferredSize(new Dimension(1,1));
cn.add(panel);
panel.setLayout(null);
panel.addMouseListener(this);
File.add(Print);
File.addSeparator();
File.add(PageSetup);
File.addSeparator();
File.add(Exit);
File.addSeparator();
Print.addActionListener(this);
PageSetup.addActionListener(this);
Exit.addActionListener(this);

PATNA WOMEN’S COLLEGE Page 235


GPF MANAGMENT SYSTEM

addcomp(250,0,200,100,l);
addcomp(350,0,500,30,head);
head.setFont(new Font("Algerian",Font.BOLD,24));
addcomp(520,100,400,30,head1);
head1.setFont(new Font("Times",Font.BOLD,15));
addcomp(10,140,100,30,new JLabel("AC/NO"));
addcomp(100,140,100,30,new JLabel("NAME"));
addcomp(250,140,100,30,new JLabel("DESIGNATION"));
addcomp(460,140,100,30,new JLabel("GPF(B/F)"));
addcomp(680,140,100,30,new JLabel("INTEREST"));
addcomp(880,140,100,30,new JLabel("GPF(C) Rs"));
addcomp(1080,140,100,30,new JLabel("GPF(C/F)"));
try
{
int r=170;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE","
sa","kankarbagh");
stmt = con.createStatement();
rs =stmt.executeQuery("select EMPINFO.ACNO,F_NAME
,DESIGNATION,GPF_B_F,INTEREST,G_C,G_TOTAL from
EMPINFO, GPFSUMMARY WHERE empinfo.ACNO =
gpfsummary.ACNO");
PATNA WOMEN’S COLLEGE Page 236
GPF MANAGMENT SYSTEM

while(rs.next())
{
addcomp(10,r,100,30,new
JLabel(String.valueOf(rs.getString(1))));
addcomp(100,r,100,30,new JLabel(rs.getString(2)));
addcomp(250,r,200,30,new JLabel(rs.getString(3)));
addcomp(460,r,100,30,new JLabel(rs.getString(4)));
addcomp(680,r,100,30,new JLabel(rs.getString(5)));
addcomp(880,r,100,30,new JLabel(rs.getString(6)));
addcomp(1080,r,100,30,new JLabel(rs.getString(7)));
r=r+25;
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e.getMessage());
}
setBounds(0,0,1250,740);
setTitle("GPF SUMMARY REPORT");
setResizable(false);
setVisible(true);
}

PATNA WOMEN’S COLLEGE Page 237


GPF MANAGMENT SYSTEM

public void addcomp(int x,int y,int w,int h,Container cn)


{
cn.setBounds(x,y,w,h);
panel.add(cn);
}
public int print(Graphics g,PageFormat pageformat,int
pageindex)
{
if(pageindex>0)
return NO_SUCH_PAGE;
Graphics2D g2D=(Graphics2D)g;
double scalex=pageformat.getImageableWidth()/getWidth();
double
scaley=pageformat.getImageableHeight()/getHeight();
double scale = Math.min(scalex,scaley);
g2D.translate(pageformat.getImageableX(),pageformat.getI
mageableY());
g2D.scale(scale,scale);
print(g2D);
return PAGE_EXISTS;
}
public void actionPerformed(ActionEvent ae)
{

PATNA WOMEN’S COLLEGE Page 238


GPF MANAGMENT SYSTEM

String com=ae.getActionCommand();
if(com.equals("EXIT"))
dispose();
else if(com.equals("PAGE SETUP"))
{
pm.showPageSetup();
}
else if(com.equals("PRINT"))
{
pm.doPrint();
}
}
public void mousePressed(MouseEvent e)
{
if(e.getButton()==MouseEvent.BUTTON3)
{
if(e.getModifiers()!=0)
{
File.show(this,e.getX(),e.getY());
}
}
}

PATNA WOMEN’S COLLEGE Page 239


GPF MANAGMENT SYSTEM

public void mouseClicked(MouseEvent e){}


public void mouseReleased(MouseEvent e){}
public void mouseEntered(MouseEvent e){}
public void mouseExited(MouseEvent e){}
public static void main(String [] args)
{
new yearreport();
}
}

PATNA WOMEN’S COLLEGE Page 240


GPF MANAGMENT SYSTEM

CODE FOR EMPLOYEE YEARLY STATEMENT

import javax.swing.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.print.*;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.standard.*;
import javax.print.*;
import java.lang.Object;
public class empreport extends JFrame implements
ActionListener,Printable,MouseListener
{
Connection con;
Statement stmt;
ResultSet rs;
JPopupMenu File = new JPopupMenu("FILE");
JMenuItem Print = new JMenuItem("PRINT");
JMenuItem PageSetup = new JMenuItem("PAGE SETUP");
JMenuItem Exit = new JMenuItem("EXIT");
JLabel head = new JLabel("BIHAR STATE ELECTRICITY
BOARD",JLabel.CENTER);

PATNA WOMEN’S COLLEGE Page 241


GPF MANAGMENT SYSTEM

JLabel head1 = new JLabel("GPF YEARLY


STATEMENT",JLabel.CENTER);
ImageIcon logo = new ImageIcon("bseb-logo.jpg");
JLabel l = new JLabel(logo,JLabel.LEFT);
PrintManager pm = new
PrintManager(this.getRootPane(),"REPORT PRINTING");
PrinterJob printerJob = PrinterJob.getPrinterJob();
PageFormat pageFormat = printerJob.defaultPage();
PrintService printer = printerJob.getPrintService();
Container cn;
JPanel panel;
public empreport()
{
cn=getContentPane();
panel = new JPanel()
{
protected void paintcomponent(Graphics g)
{
g.drawLine(10,140,720,140);
}
};
panel.setOpaque(false);

PATNA WOMEN’S COLLEGE Page 242


GPF MANAGMENT SYSTEM

panel.setPreferredSize(new Dimension(1,1));
cn.add(panel);
panel.setLayout(null);
panel.addMouseListener(this);
addcomp(0,0,200,100,l);
addcomp(0,20,800,30,head);
head.setFont(new Font("Algerian",Font.BOLD,24));
addcomp(0,50,800,30,head1);
head1.setFont(new Font("Times",Font.BOLD,15));
File.add(Print);
File.addSeparator();
File.add(PageSetup);
File.addSeparator();
File.add(Exit);
File.addSeparator();
Print.addActionListener(this);
PageSetup.addActionListener(this);
Exit.addActionListener(this);
addcomp(750,20,100,30,new JLabel("Financial Year"));
addcomp(900,20,100,30,new JLabel("2011-2012"));
addcomp(750,40,100,30,new JLabel("Interest"));
addcomp(900,40,100,30,new JLabel("8%"));

PATNA WOMEN’S COLLEGE Page 243


GPF MANAGMENT SYSTEM

addcomp(30,100,100,30,new JLabel("VOLUME"));
addcomp(230,140,100,30,new JLabel("AC/NO"));
addcomp(230,170,100,30,new JLabel("NAME"));
addcomp(230,200,100,30,new JLabel("DESIGNATION"));
addcomp(230,230,100,30,new JLabel("BALANCE(B/F)"));
addcomp(230,260,150,30,new
JLabel("GPF(CONTRIBUTION)"));
addcomp(230,290,100,30,new JLabel("LOAN REFUNDED"));
addcomp(230,320,150,30,new JLabel("INTEREST
ACCUMULATE"));
addcomp(230,350,100,30,new JLabel("TOTAL "));
addcomp(230,380,100,30,new JLabel("LOAN BALANCE"));
addcomp(230,410,100,30,new JLabel("GRAND TOTAL"));
String ac = JOptionPane.showInputDialog(this,"ENTER
AC/NO");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:MYDATASOURCE","
sa","kankarbagh");
stmt = con.createStatement();
rs =stmt.executeQuery("select
volume,empinfo.ACNO,F_NAME,DESIGNATION,gpf_B_F,CONTRI

PATNA WOMEN’S COLLEGE Page 244


GPF MANAGMENT SYSTEM

BUTED,REFUND,INTEREST,TOT,L_amount,G_TOTAL from
EMPINFO, GPF,refund,gpfsummary,loan WHERE
EMPINFO.ACNO=GPF.ACNO and
EMPINFO.ACNO=REFUND.ACNO and
EMPINFO.ACNO='"+ac+"'");
rs.next();
addcomp(130,100,100,30,new JLabel(rs.getString(1)));
addcomp(600,140,100,30,new JLabel(rs.getString(2)));
addcomp(600,170,100,30,new JLabel(rs.getString(3)));
addcomp(600,200,200,30,new JLabel(rs.getString(4)));
addcomp(600,230,100,30,new JLabel(rs.getString(5)));
addcomp(600,260,100,30,new JLabel(rs.getString(6)));
addcomp(600,290,100,30,new JLabel(rs.getString(7)));
addcomp(600,320,100,30,new JLabel(rs.getString(8)));
addcomp(600,350,100,30,new JLabel(rs.getString(9)));
addcomp(600,380,100,30,new JLabel(rs.getString(10)));
addcomp(600,410,100,30,new JLabel(rs.getString(11)));
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e.getMessage());
}
setBounds(40,40,1000,500);

PATNA WOMEN’S COLLEGE Page 245


GPF MANAGMENT SYSTEM

setTitle("YEARLY STATEMENT");
setResizable(false);
setVisible(true);
panel.setBackground(Color.WHITE);
}
public void addcomp(int x,int y,int w,int h,Container cn)
{
cn.setBounds(x,y,w,h);
panel.add(cn);
}
public int print(Graphics g,PageFormat pageFormat,int
pageIndex)
{
if(pageIndex>0)
return NO_SUCH_PAGE;
Graphics2D g2D=(Graphics2D)g;
double scalex =
pageFormat.getImageableWidth()/getWidth();
double
scaley=pageFormat.getImageableHeight()/getHeight();
double scale = Math.min(scalex,scaley);
g2D.translate(pageFormat.getImageableX(),pageFormat.getI
mageableY());

PATNA WOMEN’S COLLEGE Page 246


GPF MANAGMENT SYSTEM

g2D.scale(scale,scale);
print(g2D);
return PAGE_EXISTS;
}
public void actionPerformed(ActionEvent ae)
{
String com=ae.getActionCommand();
if(com.equals("EXIT"))
dispose();
else if(com.equals("PAGE SETUP"))
{
pm.showPageSetup();
}
else if(com.equals("PRINT"))
{
pm.doPrint();
}
}
public void mousePressed(MouseEvent e)
{
if(e.getButton()==MouseEvent.BUTTON3)
{

PATNA WOMEN’S COLLEGE Page 247


GPF MANAGMENT SYSTEM

if(e.getModifiers()!=0)
{
File.show(this,e.getX(),e.getY());
}
}
}
public void mouseClicked(MouseEvent e){}
public void mouseReleased(MouseEvent e){}
public void mouseEntered(MouseEvent e){}
public void mouseExited(MouseEvent e){}
public static void main(String [] args)
{
new empreport();
}
}

PATNA WOMEN’S COLLEGE Page 248


GPF MANAGMENT SYSTEM

SYSTEM TESTING
AND
IMPLEMENTATION
PATNA WOMEN’S COLLEGE Page 249
GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 250


GPF MANAGMENT SYSTEM

SYSTEM TESTING
Software testing is an investigation conducted to provide stake
holders with information about the quality of the allow the
business to appreciate and understand the risk at implementation
of the software . Test techniques include, but are limited to, the
process of executing a program or application with the intent of
finding software bucks. So, system testing is vital to the success of
the system . The first step in the testing is to prepare a plan that
tests all aspects of a system in a way that promotes its credibility
among potential user.
Test Plan:
The test plan is an important , but often overlooked, product of
software design. A test plane prescribes various kinds of activities
that will be performed to demonstrate that the software product
meets its requirements.
Integration and Testing:
After unit testing, the designers for the code developed by the
tester also carried out integration testing. Integration testing tests
the dependencies between different screens of the application in
the same module or
across module .
System Testing:
System testing makes a logical assumption that if all the parts of
the system are correct, the goal will be successfully achieved . A
small error can conceivably explode into much larger problem.
The best program is worthless if it does not meet user needs.

PATNA WOMEN’S COLLEGE Page 251


GPF MANAGMENT SYSTEM

Through system testing these problem can be reduced. System


testing is actually series of different tests whose primary purpose
is to fully exercise the computer- based system . although, each
test has been properly integrated and perform the allocated
functions .

IMPLEMENTATION

PATNA WOMEN’S COLLEGE Page 252


GPF MANAGMENT SYSTEM

Implementation is one of the important phases of the


software life cycle. It is the important work of the system
analyst. Its purpose is to make sure that the new designs
implemented to established standards.
Implementation of the newly developed GPF Management
System invoked three basic phases:
 System Conversion
 Application Installation
 User Training
System Conversion
Conversion is the process of changing from one system to
another . Here manual system converted into newly
developed computerized system. There are many common
method of conversion . But we use parallel-run conversion
method in implementation of GPF Management System
application.
Application Installation
After converting the system into GPF Management System ,
we found the software working with a good degree of
reliability . Also shown users are satisfied with the
software were given to the client for the final delivery.
User Training
Since BSEB is not fully computerized organization . All the
users are not computer literate. So user training started
with how to use the GPF Management System

PATNA WOMEN’S COLLEGE Page 253


GPF MANAGMENT SYSTEM

application . During the testing phase users were also


involved so they roughly understand the function of GPF
Management System.

PATNA WOMEN’S COLLEGE Page 254


GPF MANAGMENT SYSTEM

RUN TIME
WINDOWS

PATNA WOMEN’S COLLEGE Page 255


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 256


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 257


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 258


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 259


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 260


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 261


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 262


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 263


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 264


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 265


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 266


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 267


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 268


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 269


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 270


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 271


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 272


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 273


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 274


GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 275


GPF MANAGMENT SYSTEM

PROJECT MAINTENANCE

MAINTAINABILITY
The maintenance phase of the software life cycle is the
time period in which a software product performs useful
work. Generally , it takes 5 times more than development
PATNA WOMEN’S COLLEGE Page 276
GPF MANAGMENT SYSTEM

time . The maintenance activities involve making


enhancement to software products, adapting products to
new environments and correcting problems.
This phase includes various activities, these are given
below:-
 Providing new functional capabilities.
 Improving user displays & mode of interaction ,
upgrading external documents & internal
documentation or upgrading the performance
characteristics of a system.
 Adaptation of software to new environments may
involve moving the software to a different machine,
or for instance, modifying the software to
accommodate a new environments.
Maintainability , like all high-level quality
attributes, can be expressed in terms of attributes
that are built into the product. The primary product
attributes that contributes to software
maintainability are clarity, modularity, and good
internal documentation of the source, as well as
appropriate supporting documents.
FUTURE SCOPE OF THE PROJECT

From the project point of view , it has several future


scopes. The objectives of project are to achieve the
entire task related to employee of this company
through this software. It has several processes which
PATNA WOMEN’S COLLEGE Page 277
GPF MANAGMENT SYSTEM

are very complex and challenging to maintain


database in a proper way. The entire databases
related to customer are maintained through this
software. The project deals with employee details ,
gpf contribution , loan taken ,loan refunded and other
work related to employees. It has been totally
designed in real world manner. It is almost a
customized & live project . This software can easily be
upgraded for processing all the works of this
company . If there is requirement for any changes to
be made in this project in near future for storing
centralized database or distributed database further
enhancement can be easily done in this project.
Thus the project entitled “GPF management system”
has very bright and fruitful scope.

CONCLUSION
The answer to information technology is a theoretical and
an empirical, hands on discipline . The objective of this
project is to maintaining the employee GPF system . We get
practical experience of working on a large project , has
given us a chance to put into practice of the software
development concepts that we have only been studied in

PATNA WOMEN’S COLLEGE Page 278


GPF MANAGMENT SYSTEM

theories. We are trained to work effectively as part of team


, interacting with users, developing specification and
documents developing prototypes and improving our
writing and oral presentation skills. In this final year, we
have developed GPF Management System. The computer-
based GPF Management System is developed to manage
the employee details , gpf contribution detail , loan detail
,refund detail. During this project , we expect a chance to
sharpen our skills on technical, analysis or interpersonal
skills. This project is finished according to software
development life cycle approach and through this
approach were able to learn more on practically how to
work in a project whether individually or in a group.
On the early stage , we developed the problem project
scope and objective to determine requirements to make
the project successfully. There were a few types of
modeling we used such as, Data Flow Diagram-Context
Diagram and Level 0 Diagram , and to help.

PATNA WOMEN’S COLLEGE Page 279


GPF MANAGMENT SYSTEM

BIBLIOGRAPHY

BIBLIOGRAPHY

Books Reference

PATNA WOMEN’S COLLEGE Page 280


GPF MANAGMENT SYSTEM

Java The Complete Reference --Partrick Naughton& Herbert Schieldt


System Analysis And Design -- Elias Awad
JAVA PROGRAMMING --BALAGURUSAMY
MICROSOFT SQLSERVER 2005 -- MICROSOFT
RELETIONAL DATABASE – B.C.DESIA
MANAGEMENT SYSTEM

THANK
YOU
PATNA WOMEN’S COLLEGE Page 281
GPF MANAGMENT SYSTEM

PATNA WOMEN’S COLLEGE Page 282

Das könnte Ihnen auch gefallen