Вы находитесь на странице: 1из 217

BCA-054701683 CS-76 Report

Presents...

Insurance Smart Agent


CS-76
Shrikant Singh
BCA-054701683

Project
Report

RROBOSYS Insurance Smart Agent Page 1


CS-76 Report

INSURANCE SMART AGENT

by

Shrikant Singh ()
Under Guidance

of

Mr Rahul Bhatia
Submitted to the School of Computer and Information Sciences

in partial fulfilment of the requirements

for the degree of

Bachelors
of
Computer Applications

INDIRA GANDHI NATIONAL OPEN UNIVERSITY


Maidan Garhi
NEW DELHI – 110068

RROBOSYS Insurance Smart Agent Page 2


CS-76 Report

Acknowledgement
I have named it RRobosys INSURANCE SMART AGENT in the honour of my late father Sh.
Rajendra Singh. My mother has been greatest source of inspiration for me; she has motivated
me at every step of my life. I want to express my gratitude toward my guide, Mr. Rahul Bhatia
and my Study Centre Faculties Mr. Manoj & Mr. Saurabh Vasisth for their valuable guidance
in selection and case study of the present problem. I want to thank Mr. Mayank Agarwal,
System Analyst, Infosys for his technical assistance in this project.

I am thankful to my colleagues, who helped me in one or other way. Some of them are S.K.
Siddhu, Shalini Kashyap and Deepak Bhatt, LIC Agent, Meerut. I want to thank each and every
friend who helped me and please pardon me for not mentioning all those worthy names.

Thanking You,

Shrikant Singh
BCA-

RROBOSYS Insurance Smart Agent Page 3


CS-76 Report

Table of Contents
Acknowledgement ......................................................................................................................................... 3
APPROVED PROJECT PROPOSAL PROFORMA ................................................................................................. 6
PROJECT SYNOPSIS ............................................................................................................................................ 7

Title of the Project ......................................................................................................................................... 8


Introduction and Objective of the Project ..................................................................................................... 9
Project Category .......................................................................................................................................... 10
Tools/Platform, Hardware and Software Specification Requirements........................................................ 11
Analysis (DFD and ER Diagram) ................................................................................................................... 12
Complete Structure of the Project ............................................................................................................... 24
Limitation of the Project .............................................................................................................................. 35
Future Scope and Further Enhancement of the Project............................................................................... 35
Bibliography ................................................................................................................................................ 36
GUIDE’S BIODATA ........................................................................................................................................... 37
CERTIFICATE OF ORIGINALITY ..................................................................................................................... 38
PROJECT REPORT ............................................................................................................................................. 39

1. Introduction......................................................................................................................................... 40
2. Objectives ............................................................................................................................................ 41
3. Tools/Environment Used ..................................................................................................................... 42
4. Analysis Document .............................................................................................................................. 43
4.1 Project Scheduling ..................................................................................................................... 43
4.2 System Requirement Specification ............................................................................................ 44
4.3 Software Engineering Paradigm .............................................................................................. 49
4.4 Data Flow Diagrams .................................................................................................................. 50
4.5 ER Diagram ................................................................................................................................ 61
4.6 Data Dictionary.......................................................................................................................... 62
5. Design Document ................................................................................................................................ 67
5.1 Modules and their description ................................................................................................... 67
5.2 Data Structures .......................................................................................................................... 68
5.3 Process Logic Modules ............................................................................................................... 75
5.4 Testing Process........................................................................................................................... 78
5.5 List of Reports ............................................................................................................................ 78
6. Program Code ..................................................................................................................................... 80
7. Testing ............................................................................................................................................... 197
7.1 Test Strategies and Techniques ............................................................................................. 197
7.2 Test Plan Used ......................................................................................................................... 197

RROBOSYS Insurance Smart Agent Page 4


CS-76 Report

8. Input & Output Screen....................................................................................................................... 201


9. Implementation of Security of Software ........................................................................................... 213
9.1 Software and Database Security............................................................................................... 213
9.2 Creation of User Profile and access rights ............................................................................. 213
10. Limitations of the Project .............................................................................................................. 215
11. Future Application of the Project .................................................................................................. 216
12. Bibliography .................................................................................................................................. 217

RROBOSYS Insurance Smart Agent Page 5


CS-76 Report

APPROVED PROJECT PROPOSAL PROFORMA

RROBOSYS Insurance Smart Agent Page 6


CS-76 Report

PROJECT
SYNOPSIS

RROBOSYS Insurance Smart Agent Page 7


CS-76 Report

Title of the Project

Insurance
Smart Agent

RROBOSYS Insurance Smart Agent Page 8


CS-76 Report

Introduction and Objective of the Project

RROBOSYS Insurance Smart Agent (ISA) is customized software designed to meet the
requirement of the Insurance Agencies and Agents. The existing system of policy management
followed by several agencies or agents is quite cumbersome. They use flat file system such as
spreadsheet programs or manual paper work to store their information. The existing system is
not appropriate for quick retrieval of data and reliable for consistency for updating data as per
the demand of the policy holders. It too carries the risk of data redundancy.

Insurance Smart Agent focuses on the bottleneck of the existing system. It has a simple and easy
user friendly interface designed for people with minimum computer knowledge. It primary acts
as a good information center where agents can store the information related to the policy
holders, premium payment, detail of the policies. New policies launched by Insurance Companies
can be added and older can be modified. It will provide the rating of the policies of Insurance
Companies to help the customer to decide the best for them. Premium will be increased, if policy
holder is interested in more benefits like accidental riders, etc. It will generate the due premium
in a particular period. Agents can give attractive schemes for policy holders whose policy is
lapsed with the help of lapsed policy report. It will generate the premium payment receipt on
deposit of premium to the agent/agency.

Further, agency can monitor the productivity of each agent at regular interval to give incentives
for more efficient and productive agents. It will automate the calculation of commission of the
agents. A policy holder can surrender his policy. In case of death of policy holder, the policy will
terminate and sum assured will be given to the nominee or the legal heir.

Project Objective
There are several main objectives for this project:
• To replace the manual system followed by the agents and be more eco-friendly by reducing
paper wastage.
• To provide up-to-date information about policies of the policy holder.
• To provide up-to-date information of the policy holder.

RROBOSYS Insurance Smart Agent Page 9


CS-76 Report

• To provide facility of switching between the existing policies.


• To surrender any policy or to revive any lapsed policy.
• To handle query related to the maturity and tax benefit.
• To give a well-organized platform for managing all its agents and policy holders.
• To generate commission of the agents.
• To generate various report of due premium, lapsed policies, etc.
• To provide prior information to the policy holders to avoid late fee in delayed premium
payment.
• To show reminders of payment of premium or maturity.

Project Category

ISA- INSURANCE SMART AGENT is a RDBMS for managing the work of an Insurance Agencies /
Agents, which is to be developed using Net Beans, an IDE based on Java and MySQL as Backend.
INSURANCE SMART AGENT emphasis on storing information, quick retrieval and updating
information. User Interface has been designed with the help of Net Beans, which is very user
friendly and supports RAD. Java is selected as the language for development due to its object
oriented and open source nature, which makes it the most popular language in present
development scenario. Like Net Beans, MySQL also attracts lots of developer because of its
simple, friendly and open source nature. Both MySQL and Net Beans can be downloaded free of
cost from their respective websites.

RROBOSYS Insurance Smart Agent Page 10


CS-76 Report

Tools/Platform, Hardware and Software


Specification Requirements
4.1 Development Tools and Platform
To develop ISA, the following tools/platform is proposed to be used:
• Windows 7
• Net Beans 7.1
• MySQL 5.1.33

4.2 Hardware Requirements


ISA is proposed to be installed on a having the following minimum hardware requirements:
• Intel® Pentium 4 Processor having clock speed 1 GHz.
• 512 MB DDR-1 RAM.
• Hard Disk Drives having capacity of 40 GB.
• At least 2 GB free space for the installation of MySQL and JRE 6.0 / JDK 1.6.
• DVD Writer and Pen Drives for backup purposes.
• Optional: Printer – Inkjet or Laser jet.

4.3 Software Requirements


ISA will require atleast the following software platform:
•Windows XP Home Edition SP 2
• MySQL Database Management System
• JRE 6.0 / JDK 1.6

RROBOSYS Insurance Smart Agent Page 11


CS-76 Report

Analysis (DFD and ER Diagram)


5.1 Data Flow Diagrams

5.1.1 Context Level DFD

Administrator

Creates Agents and allots


Response
username and password

Agent Premium
Management Response Response Management

Monitor Agents and Manages Premium


computes Commission

ISA
Policy Management Customer Details

Response Response
Policy Customer
Management Management

RROBOSYS Insurance Smart Agent Page 12


CS-76 Report

5.1.2 Level 1 DFD


5.1.2.1 Administrator Module Level 1 DFD

1.4 1.3
Payment Manages Manages Plans
Payment Plans

details Plan details

Admin

Response Response

Insurer Agents
Information Information
1.1 1.2
Manages Manages
Insurer Agents
Response Response
details details

Gives Username
Insurer Details
& password
Insurers Agents

RROBOSYS Insurance Smart Agent Page 13


CS-76 Report

5.1.2.2Customer Module Level 1 DFD

Customer
Management

Response Response

Customer Head
Information
2.1 Heads Details
Customers
Manages
Head
customer
Response
Head details

Response
2.2
Manages
Proposed details
proposed Customers
details

RROBOSYS Insurance Smart Agent Page 14


CS-76 Report

5.1.2.3 Policy Management Module Level – 1 DFD

Policy Management

Proposal detail

Response

3.1 Response
Manages
Input details
Policy
Policy_prop
Proposal

Proposal detail

Response
3.2
Input details
Manages Policy
customers

Response

related details
policy

RROBOSYS Insurance Smart Agent Page 15


CS-76 Report

5.1.2.4 Premium Management Module Level – 1 DFD

Premium Management

Policy detail

Response

4.1
Response
Manages
Premium Premium details
Premiums

4.2 Response
Manages
Certificates / Period details Certificates
Statement

RROBOSYS Insurance Smart Agent Page 16


CS-76 Report

5.1.2.5 Agent Management Module Level – 1 DFD

Agent Management

Agent detail

Response

5.1
Response
checksCom
mission Period details
Commissions

5.2
Response
checkDeduction

Period details Deductions

5.3
Response
Check
payment Period details
Payment

RROBOSYS Insurance Smart Agent Page 17


CS-76 Report

5.1.3 Level 2 DFD


5.1.3.1 Administrator Management Module Level – 2 DFD

Plans
Insurers

1.1
Adds Insurer 1.4
login
1.6
Edit Plans Check
insurers details
credentials credentials
details

agents details
1.2
Registers Admin Admin
agents
Make changes updates
1.6 1.5
Change plans details Edit Profile
User & password
password
with details
1.3
Add Plans
agents

1.7 Plans
Compute
payment

commision

payment

1.7.2
1.7.3 Compute
deduction commission
Compute
deduction

RROBOSYS Insurance Smart Agent Page 18


CS-76 Report

5.1.3.2 Customer Management Module Level – 2 DFD

Customer_head

Head details Head details

2.1 2.3
Add Edit
customer customer
heads heads

response
response
2.5
Set Death
Customer Mgr. Status

response
Response
Customer_head
2.4
Edit customer
2.2
Add customer

Customer detail
2.5.1
Customer detail
Close
policy
Customers

2.5.2 Policy
Death Add Death

RROBOSYS Insurance Smart Agent Page 19


CS-76 Report

5.1.3.3 Policy Management Module Level – 2 DFD

3.1.3 3.1.4
Agents Get code
Plan select plan
P_id Term & premium

3.1.2
compare plan Customers
Policy_prop
Policy C_id update
3.1 3.6
Add proposal Cancel
3.7 proposal
View status
response
Policy_prop
policy details
Policy Mgr. Select
3.5
proposal 3.2.1
Revivepolicy Select policy response copy proposal
3.2
plans details Add policy
Policy_no
3.4 Policy detail
Surrender 3.3
Policy updates
Alter Policy Policy
Policy
Policy_no

3.4.1
3.5.1 calculate total
calculate due premium
premium updates

Premium

RROBOSYS Insurance Smart Agent Page 20


CS-76 Report

5.1.3.4 Premium Management Module Level – 2 DFD

Premium

4.1.2 premium
Calculate Policy Deduction
late fee

4.1.1 4.4.1
Collect Due Collect Advance
premium premium
4.3.2
Add deduction

4.2
premium details Premium
Pay
premium Premium Mgr.

Make changes updates


Update status 4.3.1
Policy_no Reject cheque

premium 4.5.1 C_id


Check status

4.6.1
4.2.2 Create certificate
Calculate
commission Policy

LP
D
4.5.2
Check last premium premium

Commision

4.6.2
Premium gen certificate

Certificate

RROBOSYS Insurance Smart Agent Page 21


CS-76 Report

5.1.3.5 Agent Management Module Level – 2 DFD

Agents

changes

5.4
Edit Profile 5.2
Calculate
deduction
Check
period details credentials

period details
5.1
Calculate
Agent Mgr. Deduction
commission
period details

5.5
changes No of policy

5.3
Commission Check payment

Policy_pro

Commission

RROBOSYS Insurance Smart Agent Page 22


CS-76 Report

Pay_id
Ag_id
5.2 ER Diagram
Payment
Legend
pays
Primary Key comm of
month
Foreign key

user Ag_id
password name

Admin register Agent


gives

Branch Password
In_id name In_id
name
of
Insurer Offers
adds

email Prop_id h-id


type In_id fullname

Policy_prop Ag_id Cus_Head


gives
gives Cus_id
Pl_id Death
In_id Pl_id status DOB

Plan
contains
results
Table_no of
name
Policy_No Cus_id
Prop_id name

Policy of Customer

Cus_id H_id
Prem DOB

Cer_id marks
Cus_id of

Certificate Pr_id D_id


Policy_No Cus_id

C_date
Prem Premium Premiu Death
m
status status
create SA

com
com
Dd_id Com_id
Pr_id Ag_id
compute
Deduction compute Pr_id
Commission

status of
Ag_id
RROBOSYS Insurance Smart Agent Page 23
CS-76 Report

Complete Structure of the Project


6.1 Modules and their description
ISA comprises of five modules. Brief description of each and every module is given below:

(i) Administrator Module: This module will be responsible for administration of the system.
Insurance Companies will be registered by the admin. Insurance plan and scheme will be added
using this module and provide facility to modify them later. It will create new agent and give
username and password to the agents to access the ISA and use the services of ISA. In case of
password forgotten, admin can change the agent’s password. Admin can also supervise the
work of the agents. Using this module, monthly commission and deduction will be calculated
and generate their monthly payment.

(ii) Customer/Policy Holder Management Module: This module will be responsible for
maintaining the customers or policy holders. Agents after logging in to the system can add new
Customer Head, i.e. the head of a family or the bread earner. Some Insurance schemes are for
securing future of the child; they are children but the life assured is provided to customer head.
After adding the Customer Head, detail of the customer / proposed person for insurance will be
added. It also provides the feature modification of any these detail at later stage. This module
will also mark the death of Life assured person in his death status. Guaranteed sum Assured will
be given to his after confirmation from the insurer.

(iii)Policy Management Module: This module will be responsible for managing and supervising
the policies. It will help agents to present the existing plans before the customers and give
comparative benefits of similar type of scheme. It will update the policy proposal status. In case
of bouncing of cheque, amount will be deduction for Agent’s payment. It will store the
information related to policy in case of approval of Policy proposal from both sides i.e. Insurer
and Insured. It will be used to surrender any policy and calculated the amount payable to policy
holder. This module is also used to revive any lapsed policy.

RROBOSYS Insurance Smart Agent Page 24


CS-76 Report

(iv) Premium Management Module: This module will handle the premium deposited by policy
holder. It will show the due premium of any policy holder and during any period. It will store the
detail of all premium deposited. It also gives the feature of advance premium deposit. It will
generate the outstanding premium, which are yet to be deposited to the Insurer. It will automate
the calculation of commission. It will be used to print premium certificate and statement. It also
generates list of cheques bounced.

(v) Agent Management Module: This module will be responsible for processing activities related
to agents. It can be used to process any kind query related to commission and deduction of the
agents. Further, it can be used to print the monthly payment of the agents. Agents can edit their
contact information.

6.2 Data Structures


The ISA database consists of 14 tables. Each and every table is setup with the proper Integrity
constraints to work properly. The structure of the database tables is given below:

(i) Admin: Stores the details of Administrator.


Field Name Field Type Constraints Description
user varchar(10) Not null Stores the username of the admin.
name varchar(50) stores the name of the admin
Branch varchar(10) Not null stores the branch of the admin.
Password varchar(10) stores the password.
Agency Name varchar(100) stores the name of the agency.

(ii) Insurer: Stores the details of the different insurance companies enrolled.
Field Name Field Type Constraints Description
in_id varchar(10) Primary key Stores the unique insurer id.
name varchar(100) Stores the name of the insurer
type varchar(20) Stores the type of the insurance
city varchar(15) Stores the city of the insurer
phone varchar(10) Stores the phone numbers of the insurer

RROBOSYS Insurance Smart Agent Page 25


CS-76 Report

email varchar(25) Stores the email id of the insurer


website varchar(25) Stores the website of the insurer

(iii) Plan: Stores the insurance plan information of the insurer.


Field Name Field Type Constraints Description
pl_id varchar(10) Primary key Stores the unique plan id
in_id varchar(10) Foreign key Stores the insurer id of particular plan
name varchar(100) Unique Store the fullname of plan
Table_no int Unique Stores the table no. of the plan
min_SA longint Not null Stores the minimum Sum Assurance the
plan
Min_term int Not null Stores the minimum term of the plan
Min_age int Not null Stores the minimum age of policy holder
Tax_benefit varchar(10) Stores the tax benefit of the plan
Premium_1l int Not null Stores the plan’s premium of 1 lakh of 35
year old for 10 years.
maturity_1l longint Not null Stores the plan’s maturity of 1 lakh of 35
year old for 10 years.
comm int Not null Stores the commission % of the agent
Ext_term int Stores the extended term of the plan
Surr_factor int Not null Stores the surrender factor of the plan
benefit blob Stores the benefits of the plan

Iv) Agent: Stores the details of the agents of the insurance company.
Field Name Field Type Constraints Description
ag_id varchar(10) Primary key Stores the unique agent code
in_id varchar(10) Foreign key Uses the insurer id for the agent.
Branch_id Varchar(10) Not null Stores the branch agent code
Fullname varchar(50) Stores fullname of the agent
Address varchar(100) Stores address of the agent
City varchar(50) Stores city of the agent

RROBOSYS Insurance Smart Agent Page 26


CS-76 Report

Phone varchar(10) Stores phone number of the agent


Email varchar(10) Stores email of the agent
Dob varchar(10) Stores the date of birth of agent
Acc_no varchar(10) Stores the account no
Bank varchar(10) Stores the bank name

v) Customer Head: Stores the details of the customer head.


Field Name Field Type Constraints Description
h_id varchar(10) Primary key Stores the unique customer head code
Fullname varchar(10) Not null Stores fullname of the customer head
F_name varchar(10) Not null Stores fullname of the customer head
Dob varchar(10) Not null Stores the date of birth of customer head
Address varchar(100) Not null Stores address of the customer head
City varchar(30) Not null Stores city of the customer head
Phone varchar(10) Not null Stores phone number of the customer head
Email varchar(50) Not null Stores email of the customer head
Dob date Not null Stores the date of birth of customer head
An_Income longint Not null Stores the annual income of customer head
Acc_no varchar(16) Stores the account no
Bank varchar(50) Stores the bank name
death boolean Not null Store death status of customer head.
Default 0

vi) Customer: Stores the details of the customer.


Field Name Field Type Constraints Description
h_id varchar(10) Primary key Stores the unique customer code
Cus_id varchar(10) Foreign key Stores the unique customer head code
Fullname varchar(10) Not null Stores fullname of the customer
F_name varchar(10) Not null Stores fullname of the customer
Dob varchar(10) Not null Stores the date of birth of customer
Address varchar(100) Not null Stores address of the customer.

RROBOSYS Insurance Smart Agent Page 27


CS-76 Report

City varchar(30) Not null Stores city of the customer.


Phone varchar(10) Not null Stores phone number of the customer.
Email varchar(50) Not null Stores email of the customer.
Dob date Not null Stores the date of birth of customer.
An_Income longint Stores the annual income of customer.
Acc_no varchar(16) Stores the account no
Bank varchar(50) Stores the bank name

(vii) Policy_Prop: Stores the information about policy proposal to the insurer.
Field Name Field Type Constraints Description
prop_id varchar(10) Primary key Stores the unique proposal id
in_id varchar(10) Foreign key Stores the insurer id
ag_id varchar(10) Foreign key Stores the agent id
pl_id varchar(10) Foreign key Stores the plan id
Cus_id varchar(10) Foreign key Stores the customer id
prop_date date Not null Stores the date of the proposal.
end_date date Stores the approval of the proposal.
SA Int Not null Stores the sum assured of the proposal.
Term Int Not null Stores the term of the proposal.
Mode varchar(15) Not null Stores the mode of payment of the proposal.
Add_ben blob Stores the additional riders of the proposal.
status varchar(10) Not null Stores the status of the proposal

(viii) Policy: Stores information about different enrolled policy to the customers.
Field Name Field Type Constraints Description
Policy_No Varchar(10) Primary key Stores the policy no. of policy
Prop_id Varchar(10) Foreign key Stores the proposal id
Prem int Not null Stores the premium of the policy
Term int Not null Stores the term of the policy
Cus_id Varchar(10) Stores the customer id of nominee.
Com_date Date Not null Stores the commencement date

RROBOSYS Insurance Smart Agent Page 28


CS-76 Report

Mat_date date Not null Stores the maturity date


lpd date Not null Store the last premium deposit date.
status Varchar(20) Not null Stores the status of policy.

(ix) Premium deposit: Stores information about premium of the policy.


Field Name Field Type Constraints Description
Pr_id Varchar(10) Primary key Stores the premium deposit id
Policy_no Varchar(10) Foreign key Stores the policy no.
Late_fee int Stores late fees of premium
Deposit_date date Not null Store the deposit date
receipt_date date Not null Store the receipt date
Receipt_no longint Store the receipt number
Premium int Not null Stores the premium amount deposited.
Cheque_no Int Store the cheque number
C_date Date Store the date of cheque
bank Varchar(100) Store the bank’s name.
status Varchar(20) Not null Stores the status of policy.

(x) Commission: Stores information about commission of the agents.


Field Name Field Type Constraints Description
com_id Varchar(10) Primary key Stores the commission id
ag_id Varchar(10) Foreign key Stores the agent id.
Pr_id Varchar(10) Foreign key Stores the premium deposit id
com int Not null Store the commission amount
status boolean Not null Status of payment
Pay_id Varchar(10) Foreign key Store the payment number

(xi) Deduction: Stores information about deduction of the agents.


Field Name Field Type Constraints Description
dd_id Varchar(10) Primary key Stores the deduction id

RROBOSYS Insurance Smart Agent Page 29


CS-76 Report

ag_id Varchar(10) Foreign key Stores the agent id.


Pr_id Varchar(10) Foreign key Stores the premium deposit id
ded int Not null Store the deduction amount
status boolean Not null Status of deduction
Pay_id Varchar(10) Foreign key Store the payment number

(xii) Payment: Stores information about monthly payment of the agents.


Field Name Field Type Constraints Description
Pay_id Varchar(10) Primary key Stores the payment id
ag_id Varchar(10) Foreign key Stores the agent id
comm int Not null Stores total commission
ded int Not null Store total deduction
month Varchar(15) Not null Store the month
Pay_date date Store the payment date

(xiii) Certificate: Stores information about monthly payment of the agents.


Field Name Field Type Constraints Description
cer_id Varchar(10) Primary key Stores the certificate id
cus_id Varchar(10) Foreign key Stores the customer id
Per_start date Not null Stores start of period
Per_end date Not null Stores end of period
prem int Not null Stores total premium
C_date date Store the certificate date

(xiv) Death: Stores information about monthly payment of the agents.


Field Name Field Type Constraints Description
d_id Varchar(10) Primary key Stores the death id
cus_no Varchar(10) Foreign key Stores the customer id
prem int Not null Stores total premium
SA int Not null Store total deduction

RROBOSYS Insurance Smart Agent Page 30


CS-76 Report

status Varchar(15) Not null Store the status of claim


death_date date Not null Store the death date
Pay_date date Not null Store the payment date

RROBOSYS Insurance Smart Agent Page 31


CS-76 Report

6.3 Process Logic Modules


Administrator Module
Step 1 : Administrator log in to the system using common interface.
Step 2 : Administrator presented with the following menus:

Create Insurer and insurance schemes


Here insurer details will be filled by the administrator which is going to be registered in ISA.
Along with creating an insurer, administrator can registered various schemes and policies given
by insurer and modify time and again.

Create agents
Here agent’s details will be filled by the administrator which is going to be registered in ISA.
Username and Password will be given to the insurer so that the insurer can use the services of
ISA. Along with creating an insurer administrator can supervise their work and number of
policies achieved in any period.
Change Password
Through this menu administrator can change the password of the agent, in case of agent has
forgotten its password.
Computation of monthly payment of agents. Agents monthly wages will generated based on
their premium received.
View Reports
• Number of active Agents
• Monthly payment of agents.
• Monthly collection of premium.
With view reports administrator can view the reports against the agent’s resource usages and
status of the agent, number of agents, number of plans the insurer having, etc.

Customer Management Module


 Now the agent will log in to the ISA with the username and password given.
 After logging in to the agent’s account, different menu will be displayed out of which
customer management module has following sub menus:

RROBOSYS Insurance Smart Agent Page 32


CS-76 Report

• Add Customer Head: Before selling any plan, agent will enter the detail of head of the Life
Assured person.
• Add customer: After creating customer head, agent will enter the detail of proposed person.
• Edit Customer: Change their personal detail later
• Set Death Status: Mark any customer as dead and proceed for payment of Insurance Amount.

Policy Management Module


 Now the agent will log in to the ISA with the username and password given.
 After logging in to the agent’s account, different menu will be displayed out of which policy
management module has following sub menus:
1. Add Policy Proposal: Agents can enter the requirement of the customer and show him the
available policy as per his requirement. He can enter the details of the interested plan like SA,
term, additional benefits, tax benefits etc.
2. Update status of Policy: Policy proposal’s status can be updated for its approval or denial.
3. Add policy: After approval of proposal, agent enters the details of policy bond agreed upon
both parties.
4. Surrender Policy: Agent can surrender the policy on request of policy holder and inform him
the surrendered amount after deducting its charges.
5. Revive Policy: Agent can revive a lapsed policy on the demand of policy holder and payment
of revival amount.
6. Generate Report: Several reports can be generated like Policy done in a period, List of policies
surrendered, list of lapsed policies and current policies.

Premium Management Module


 Now the agent will log in to the ISA with the username and password given.
 After logging in to the agent’s account, different menu will be displayed out of which
premium management module has following sub menus:
1. Check due status of premium: Check status of any policy due premium.
2. Deposit due premium: Agent can deposit a premium given by the customer in cash or cheque.
3. Advance premium: Advance premium payment facilities is also provided for customers.
3. Update status of premium: On successful payment of premium, agent will enter the receipt
detail of premium payment given by insurer.
RROBOSYS Insurance Smart Agent Page 33
CS-76 Report

4. Generate Reports: Several important such as List of due premium, List of premium collected
by the agent, List of Cheque bounced premium etc. will be generated.

Agent Management Module


 Now the agent will log in to the ISA with the username and password given.
 After logging in to the agent’s account, different menu will be displayed out of which
premium management module has following sub menus:
1. Check commission in a period: Agents can check his productivity by checking commission in
a particular period.
2. Check deduction in a period. Agents can check his deduction in commission in a particular
period.
3. Edit profile: Agents can update their contact information.
4. Generate Reports: They can generate their monthly payment, commission and deduction.

6.4 Testing Process


Error Handling
Error Handling has been an important aspect of system development. Since java provide a better
error handling mechanism, I have selected as the language of Development. White Box and
black testing will be wherever required.

Validation Checks
Validation Checks has been implemented with the help of Java and MySQL with the help of
database constraints.

6.5 List of Reports Likely to be generated


Following will be the list of reports to be generated from the ISA.
1. List of active policies of insurer
2. List of agents of an insurer.
3. List of ongoing policies
4. List of proposal made by an agent.
5. List of Surrendered policies
6. List of Death Case.
7. List of Due premium in a period

RROBOSYS Insurance Smart Agent Page 34


CS-76 Report

8. Premium Certificate
9. Premium Receipt.
10. List of collected premium during a period.

Limitation of the Project


There is always a limitation of time and resources for any development. It is termed as
software crisis. I have tried my best in developing this solution for above problem. But still
aspect are noteworthy, which I will try to resolve by gaining more knowledge.

1. I could not automate the calculation of premium of a policy. As LCI, one of the
major insurer have given premium in the form tabular information based on age,
term and sum assured. There was no such formula to calculate premium. Premium
have to be entered manually after calculation from tabular data.
2. There could be some inconsistency based on premium deposition, if customer pays
premium himself at some other counter or does not give any information to the
agent. To resolve it, we should get to Insurer data of premium deposit.

Future Scope and Further Enhancement of the


Project

Following modules can be added to enhance the features of the ISA.


• Intranet Technology could be extended to Internet without any modification to support multi
branch facility.
• Payment module – This module can be added to ISA for maintaining the payment from the
plans and payment to the agents.
• SMS Module - This module will be added to the ISA for giving reminder using SMS to policy
holder regarding premium payment or any urgent issue.

RROBOSYS Insurance Smart Agent Page 35


CS-76 Report

Bibliography
Some important sources for the development of Insurance System proposal are as follows:

1. IRDA Website (www.irda.gov.in )


2. LIC Website ( www.licindia.in )
3. Analysis of Visual Magic Pro, an existing Insurance Software.
4. IGNOU Study Material: System Design and Algorithm (CS-05)
5. IGNOU Study Material: Introduction to DBMS (CS-06)

RROBOSYS Insurance Smart Agent Page 36


CS-76 Report

GUIDE’S BIODATA

RROBOSYS Insurance Smart Agent Page 37


CS-76 Report

CERTIFICATE OF ORIGINALITY

RROBOSYS Insurance Smart Agent Page 38


CS-76 Report

PROJECT
REPORT

RROBOSYS Insurance Smart Agent Page 39


CS-76 Report

1. Introduction
Insurance Smart Agent (ISA) is customized software designed to meet the requirement of the

Insurance Agencies and Agents. The existing system of policy management followed by several

agencies or agents is quite cumbersome. They use flat file system such as spreadsheet programs

or manual paper work to store their information. The existing system is not appropriate for quick

retrieval of data and reliable for consistency for updating data as per the demand of the policy

holders. It too carries the risk of data redundancy.

Insurance Smart Agent focuses on the bottleneck of the existing system. It has a simple and easy

user friendly interface designed for people with minimum computer knowledge. It primary acts

as a good information center where agents can store the information related to the policy

holders, premium payment, detail of the policies. New policies launched by Insurance Companies

can be added and older can be modified. It will provide the rating of the policies of Insurance

Companies to help the customer to decide the best for them. Premium will be increased, if policy

holder is interested in more benefits like accidental riders, etc. It will generate the due premium

in a particular period. Agents can give attractive schemes for policy holders whose policy is

lapsed with the help of lapsed policy report. It will generate the premium payment receipt on

deposit of premium to the agent/agency.

Further, agency can monitor the productivity of each agent at regular interval to give incentives

for more efficient and productive agents. It will automate the calculation of commission of the

agents. A policy holder can surrender his policy. In case of death of policy holder, the policy will

terminate and sum assured will be given to the nominee or the legal heir.

RROBOSYS Insurance Smart Agent Page 40


CS-76 Report

2. Objectives
There are several main objectives for this project:

• To replace the manual system followed by the agents and be more eco-friendly by reducing

paper wastage.

• To give a well-organized platform for managing all its agents and policy holders.

• To add new customers and policies.

• To maintain detail of nominee of policy.

• To provide up-to-date information about policies of the policy holder.

• To provide up-to-date information of the policy holder.

• To compare policies to give the best to the customer.

• To surrender any policy or to revive any lapsed policy.

• To handle query related to the maturity and tax benefit.

• To generate commission of the agents.

• To generate various report of due premium, lapsed policies, etc.

• To provide prior information to the policy holders to avoid late fee in delayed premium

payment.

• To show reminders of payment of premium or maturity.

• To print Premium Certificate and Premium paid Slip.

• To collect policy holder’s feedback.

RROBOSYS Insurance Smart Agent Page 41


CS-76 Report

3. Tools/Environment Used
3.1 Development Tools and Platform

To develop ISA, the following tools/platform is proposed to be used:

• Windows 7

• Net Beans 7.1

• MySQL 5.1.33

3.2 Hardware & Software Requirements

ISA is proposed to be installed on a having the following minimum hardware requirements:

• Intel® Pentium 4 Processor having clock speed 1 GHz.

• 512 MB DDR-1 RAM.

• Hard Disk Drives having capacity of 40 GB.

• At least 2 GB free space for the installation of MySQL and JRE 6.0 / JDK 1.6.

• DVD Writer and Pen Drives for backup purposes.

• Optional: Printer – Inkjet or Laser jet.

Software Requirements

ISA will require at least the following software platform:

•Windows XP Home Edition SP 2

• MySQL Database Management System

• JRE 6.0 / JDK 1.6

RROBOSYS Insurance Smart Agent Page 42


CS-76 Report

4. Analysis Document
4.1 Project Scheduling

Gantt chart

PERT Chart

0 10 10 10 15 25

Preliminary System Analysis


Investigation

0 0 10 10 0 25

25 11 36 36 30 66

System Design Coding

25 0 36 36 0 66

66 10 76 76 10 86

Testing Implementation and


Maintenance

66 0 76 76 0 86

RROBOSYS Insurance Smart Agent Page 43


BCA-054701683 CS-76 Report

4.2 System Requirement Specification

1. Introduction

The goal of this phase is to understand the exact requirements of the system and to document

them properly. This activity is usually done to document all functions, performance and

interfacing requirements for the software designing and management.

1.1 Purpose

• To provide up-to-date information about policies of the policy holder.

• To provide up-to-date information of the policy holder.

• To provide facility of switching between the existing policies.

• To surrender any policy or to revive any lapsed policy.

• To handle query related to the maturity and tax benefit.

• To give a well-organized platform for managing all its agents and policy holders.

• To generate commission of the agents.

• To generate various report of due premium, lapsed policies, etc.

• To provide prior information to the policy holders to avoid late fee in delayed premium payment.

• To show reminders of payment of premium or maturity.

1.2 Document Conventions

Document have written in Calibri Font with 12 font size and double line spacing. Most of the

matter have been numbered to make it more structured. Heading have been highlighted by

bolding and underlining.

1.3 Intended Audience

RROBOSYS Insurance Smart Agent Page 44


BCA-054701683 CS-76 Report

This SRS has been target for the developers, team member involved in any activity of the SDLC

and those who are interested for adopting this new system by replacing their existing system with

it. Some of them are even not aware of

1.4 Project Scope

To replace the manual system followed by the agents and be more eco-friendly by reducing paper

wastage.

• To provide up-to-date information about policies of the policy holder.

• To provide up-to-date information of the policy holder.

• To provide facility of switching between the existing policies.

• To surrender any policy or to revive any lapsed policy.

• To handle query related to the maturity and tax benefit.

• To give a well-organized platform for managing all its agents and policy holders.

• To generate commission of the agents.

• To generate various report of due premium, lapsed policies, etc.

• To provide prior information to the policy holders to avoid late fee in delayed premium payment.

• To show reminders of payment of premium or maturity.

2. Overall Description

2.1 Product Perspective

This product is designed to replace the existing manual system followed by most of the agents to

track the policies status and premium deposit etc. It is an independent self-contained medium

software development package. This product is developed in Java language. It uses g 7.1 to design

its User Interface (Front End). MySql provides the back end for the RDBMS.

2.2 Product Features

RROBOSYS Insurance Smart Agent Page 45


BCA-054701683 CS-76 Report

• To provide up-to-date information about policies of the policy holder.

• To provide up-to-date information of the policy holder.

• To provide facility of switching between the existing policies.

• To surrender any policy or to revive any lapsed policy.

• To handle query related to the maturity and tax benefit.

• To give a well-organized platform for managing all its agents and policy holders.

• To generate commission of the agents.

• To generate various report of due premium, lapsed policies, etc.

• To provide prior information to the policy holders to avoid late fee in delayed premium payment.

2.3 User Classes and Characteristics

There are basically two types of users involved with the operation of this product.

 Administrator

 Agents

We cannot expect from them high level of expertise in computer and particularly with RDBMS.

They are novice, who have been using manual procedure to maintain this system or may be using

flat file system like word or excel to store the transactions. Owing to the less degree of computer

exposure and knowledge, it has designed to be very simple and user friendly. Keyboard shortcut

have been provided for frequent users. Stress have been given to major less skilled group of users.

3. System Features

3.1 Functional Requirements

ISA replaces the existing system for the newer modules, which helps in maintaining the integrity

and consistency between the modules. Thus keeping in mind a careful study of the requirements

of the end user revealed the following specific functional requirements:

RROBOSYS Insurance Smart Agent Page 46


BCA-054701683 CS-76 Report

Administrator – Administrator will be able to login to the system and decides whether to view

reports, add new insurer, add new plans, add new agents, generate the commission report,

premium report, policy detail report.

Agents – Agents can also view and update the limited area of their details. They can view the plan

and add customers, proposal, policy and premium. They can view due premium, lapsed policies

and other reports.

3.2 Non – Functional Requirements

i.) Security: This project is implemented keeping in mind the security issues regarding accessibility

of information or some restricted area. And thus requires credential to access system using

interface.

ii) Reliability: Data access permissions are granted only to the authorized person and database is

password protected. Hence no chance of any mishandling of data can be done by the end users.

Thus output of this system will be reliable.

iii) Maintainability: There is no issue regarding maintenance of the system. It can be easily

implemented. It just required well-trained technical person to handle this project.

iv) Portability: This is a Java based project, hence it support multiplatform. As java support WORA.

Thus it can be easily ported anywhere.

v) Extensibility: This project is based on prototype model keeping in mind the user requirement

can change as the size of an enterprise grows up. Thus it is developed in such a manner, that new

modules can be easily added to this project.

4.0 Requirements

Development Tools and Platform


To develop ISA, the following tools/platform is proposed to be used:
• Windows 7

RROBOSYS Insurance Smart Agent Page 47


BCA-054701683 CS-76 Report

• Net Beans 7.1


• MySQL 5.1.33

Hardware Requirements

ISA is proposed to be installed on a having the following minimum hardware requirements:

• Intel® Pentium 4 Processor having clock speed 1 GHz.

• 512 MB DDR-1 RAM.

• Hard Disk Drives having capacity of 40 GB.

• At least 2 GB free space for the installation of MySQL and JRE 6.0 / JDK 1.6.

• DVD Writer and Pen Drives for backup purposes.

• Optional: Printer – Inkjet or Laser jet.

Software Requirements

ISA will require atleast the following software platform:

•Windows XP Home Edition SP 2

• MySQL Database Management System

• JRE 6.0 / JDK 1.6

RROBOSYS Insurance Smart Agent Page 48


BCA-054701683 CS-76 Report

4.3 Software Engineering Paradigm


For this project, the prototype model is suitable, where the business requirement has been

gathered earlier only, based on which designing is to be done. The reason for the selection is due

to its nature that supports multiple life cycles enriching the quality of service. Hence it would give

maximum satisfaction to the clients using it and their feedback will be collected at regular

interval, helping in better improvement of the software. I think that protocol is one of the

software modelling technique from business point of view which always binds the customer with

service provider, as they are always hoping for better release of the software and acts a good

temptation for being in contact of developer and hence increases the possibility of getting more

development chances.

Preliminary Investigation

System Analysis

System Design

Website Coding

Testing

Maintenance

Deliver the Prototype

Collect Feedback

RROBOSYS Insurance Smart Agent Page 49


BCA-054701683 CS-76 Report

4.4 Data Flow Diagrams

4.2.1 Context Level DFD

Administrator
Creates Agents and allots
Response
username and password

Agent Premium
Management Response Response Management

Monitor Agents and Manages Premium


computes Commission

ISA
Policy Management Customer Details

Response Response
Policy Customer
Management Management

RROBOSYS Insurance Smart Agent Page 50


BCA-054701683 CS-76 Report

4.2.2 Level 1 DFD


Administrator Module Level 1 DFD

1.4 1.3
Commission Checks Manages Plan
Commission Plans

details Plan details

Admin

Response Response

Insurer Agents
Information Information
1.1 1.2
Manages Manages
Insurer Agents
Response Response
details details

Insurer Details Gives Username


& password
Insurer Agent

RROBOSYS Insurance Smart Agent Page 51


BCA-054701683 CS-76 Report

Customer Module Level 1 DFD

Customer
Management

Response Response

Customer Head
Information
2.1 Heads Details
Customers
Manages
Head
customer
Response
Head details

Response
2.2
Manages
Proposed details
proposed Customers
details

RROBOSYS Insurance Smart Agent Page 52


BCA-054701683 CS-76 Report

Policy Management Module Level – 1 DFD

Policy Management

Proposal detail

Response

3.1 Response
Manages
Input details
Policy
Proposal
Proposal

Proposal detail

Response
3.2
Input details
Manages Policy
customer

Response

related details
policy

RROBOSYS Insurance Smart Agent Page 53


BCA-054701683 CS-76 Report

Premium Management Module Level – 1 DFD

Premium Management

Policy detail

Response

4.1
Response
Manages
Premium Premium details
Premium

4.2 Response
Manages
Certificates / Period details Certificate
Statement

RROBOSYS Insurance Smart Agent Page 54


BCA-054701683 CS-76 Report

Agent Management Module Level – 1 DFD

Agent Management

Agent detail

Response

5.1
Response
Add Agent
Period details
Agent

5.2
Response
Checks
commission Commission
Period details

RROBOSYS Insurance Smart Agent Page 55


BCA-054701683 CS-76 Report

4.2.3 Level 2 DFD


Administrator Management Module Level – 2 DFD

Plans Insurers

1.1
Adds Insurer 1.4
login
1.6
Edit Plans Check
insurers details
credentials credentials
details

agents details
1.2
Registers Admin Admin
agents

1.6
Change plans details
User & password
password
with details
1.3
Add Plans
agents

1.7 Plans
Checks
commission

commision

RROBOSYS Insurance Smart Agent Page 56


BCA-054701683 CS-76 Report

Customer Management Module Level – 2 DFD

2.5
Set Death
Customer Mgr. Status

response
Response

2.4
Edit customer
2.2
Add customer

Customer detail

Customer detail

Customers

2.5.1
Close
policy

2.5.2 Policy
Death Add Death

RROBOSYS Insurance Smart Agent Page 57


BCA-054701683 CS-76 Report

Policy Management Module Level – 2 DFD


Term & premium
3.1.3 3.1.4
select plan Agents Get code
Plan
P_id

Customers
3.1.2 3.1.1
compare plan Add proposal
Policy_prop
Policy C_id
3.1
Add proposal
3.7
View status
response
Policy_prop
policy details
Policy Mgr. Select
3.5
proposal 3.2.1
Revivepolicy
Select policy response copy proposal
3.2
plans details Add policy
Policy_no
3.4 Policy detail
Surrender 3.3
Policy updates
Alter Policy Policy
Policy
Policy_no

3.4.1
3.5.1 calculate total
calculate due premium
premium 3.4.3 /3.5.3/3.2.2
calculate
commission

Premium
Commission

3.4.2/3.5.2
Update Policy
Policy

RROBOSYS Insurance Smart Agent Page 58


BCA-054701683 CS-76 Report

Premium Management Module Level – 2 DFD

Premium
4.1.2
Calculate premium Policy
late fee
4.1.1 4.4.1
Collect Due Collect Advance
premium premium

4.2
premium details
Pay
premium Premium Mgr.

Update status
Policy_no

premium 4.5.1 C_id


Check status

4.6.1
4.2.2 Create certificate
Calculate
commission Policy

LP
D
4.5.2
Check last premium premium

Commision

4.6.2
Premium gen certificate

Certificate

RROBOSYS Insurance Smart Agent Page 59


BCA-054701683 CS-76 Report

Agent Management Module Level – 2 DFD

Agents
changes

5.4
Edit Profile 5.2
Calculate
deduction
Check
period details credentials

period details
5.1
Calculate
Agent Mgr. Deduction
commission period details

5.5
changes No of policy

5.3
Commission
Check
commission
Policy_pro

Commission

RROBOSYS Insurance Smart Agent Page 60


BCA-054701683 CS-76 Report

4.5 ER Diagram
Legend
Primary Key

Foreign key

user Ag_id
password name

1 Admin 1 N
gives register Agent N
N
N Branch Password
In_id name In_id
name
N N
1 of
Insurer Offers
adds

N
email Prop_id
type In_id
1
N Ag_id
gives Policy_prop
gives
Cus_id
Pl_id N
In_id Pl_id status

1 1
Plan 1
results N
Table_no of
name
Policy_No 1 Cus_id
Prop_id name

Policy Customer

1
Comm_date H_id
Prem DOB
1
Cer_id marks
Cus_id of
1
Certificate N Pr_id D_id
Policy_No Cus_id
N
C_date
Prem Premium Premiu Death
N m
N
status status
create SA

1 com
com
Com_id
Ag_id
compute
Commission Pr_id
1
N of

RROBOSYS Insurance Smart Agent Page 61


BCA-054701683 CS-76 Report

4.6 Data Dictionary

(i) Admin: Stores the details of Administrator.

Field Name Field Type Constraints Description


user varchar(10) Not null Stores the username of the admin.
name varchar(50) stores the name of the admin
Branch varchar(10) Not null stores the branch of the admin.
Password varchar(10) stores the password.
AgencyName varchar(100) stores the name of the agency.

(ii) Insurer: Stores the details of the different insurance companies enrolled.
Field Name Field Type Constraints Description
in_id varchar(10) Primary key Stores the unique insurer id.
name varchar(100) Stores the name of the insurer
type varchar(20) Stores the type of the insurance
city varchar(15) Stores the city of the insurer
phone varchar(10) Stores the phone numbers of the insurer

email varchar(25) Stores the email id of the insurer


website varchar(25) Stores the website of the insurer

(iii) Plan: Stores the insurance plan information of the insurer.


Field Name Field Type Constraints Description
pl_id varchar(10) Primary key Stores the unique plan id
in_id varchar(10) Foreign key Stores the insurer id of particular plan
name varchar(100) Unique Store the fullname of plan
Table_no int Unique Stores the table no. of the plan
Type Varchar(50) Not null Stores the type of the plan
min_SA longint Not null Stores the minimum Sum Assurance
the plan
Min_term int Not null Stores the minimum term of the plan
Min_age int Not null Stores the minimum age of policy
holder

RROBOSYS Insurance Smart Agent Page 62


BCA-054701683 CS-76 Report

Tax_benefit varchar(10) Stores the tax benefit of the plan


maturity_1 longint Not null Stores the plan’s maturity of 1 lakh of
35 year old for 10 years.
comm int Not null Stores the commission % of the agent
Ext_term int Stores the extended term of the plan
Surr_factor int Not null Stores the surrender factor of the plan
benefit blob Stores the benefits of the plan

Iv) Agent: Stores the details of the agents of the insurance company.
Field Name Field Type Constraints Description
ag_id int Primary key Stores the unique agent code
user varchar(15) Unique Stores the unique agent username
Password Varchar(30) Not Null Stores the password of the agent
in_id varchar(10) Foreign key Uses the insurer id for the agent.
Name varchar(50) Stores fullname of the agent
Address varchar(100) Stores address of the agent
City varchar(50) Stores city of the agent
Phone varchar(10) Stores phone number of the agent
Email varchar(10) Stores email of the agent
Dob varchar(10) Stores the date of birth of agent
Acc_no varchar(10) Stores the account no
Bank varchar(10) Stores the bank name

vi) Customer: Stores the details of the customer.


Field Name Field Type Constraints Description
h_id varchar(10) Primary key Stores the unique customer code
Cus_id varchar(10) Foreign key Stores the unique customer head code
Fullname varchar(10) Not null Stores fullname of the customer
F_name varchar(10) Not null Stores fullname of the customer
Dob varchar(10) Not null Stores the date of birth of customer
Address varchar(100) Not null Stores address of the customer.

RROBOSYS Insurance Smart Agent Page 63


BCA-054701683 CS-76 Report

City varchar(30) Not null Stores city of the customer.


Phone varchar(10) Not null Stores phone number of the customer.
Email varchar(50) Not null Stores email of the customer.
Dob date Not null Stores the date of birth of customer.
An_Income longint Stores the annual income of customer.
Acc_no varchar(16) Stores the account no
Bank varchar(50) Stores the bank name

(vii) Policy_Prop: Stores the information about policy proposal to the insurer.
Field Name Field Type Constraints Description
prop_id varchar(10) Primary key Stores the unique proposal id
ag_id varchar(10) Foreign key Stores the agent id
pl_id varchar(10) Foreign key Stores the plan id
Cus_id int Foreign key Stores the customer id
Nominee int Foreign key Stores the nominee id
prop_date date Not null Stores the date of the proposal.
SA Int Not null Stores the sum assured of the proposal.
Maturity Int Not null Stores the maturity value of plan.
Term Int Not null Stores the term of the proposal.
Mode varchar(15) Not null Stores the mode of payment of the proposal.
Add_ben blob Stores the additional riders of the proposal.
status varchar(10) Not null Stores the status of the proposal

(viii) Policy: Stores information about different enrolled policy to the customers.
Field Name Field Type Constraints Description
Policy_No Varchar(10) Primary key Stores the policy no. of policy
Prop_id Varchar(10) Foreign key Stores the proposal id
Prem int Not null Stores the premium of the policy
Com_date Date Not null Stores the commencement date
Mat_date date Not null Stores the maturity date
lpd date Not null Store the last premium deposit date.

RROBOSYS Insurance Smart Agent Page 64


BCA-054701683 CS-76 Report

status Varchar(20) Not null Stores the status of policy.

(ix) Premium: Stores information about premium of the policy.


Field Name Field Type Constraints Description
Pr_id Varchar(10) Primary key Stores the premium deposit id
Policy_no Varchar(10) Foreign key Stores the policy no.
Late_fee int Stores late fees of premium
Deposit_date date Not null Store the deposit date
receipt_date date Not null Store the receipt date
Receipt_no longint Store the receipt number

(x) Commission: Stores information about commission of the agents.


Field Name Field Type Constraints Description
com_id Varchar(10) Primary key Stores the commission id
ag_id Varchar(10) Foreign key Stores the agent id.
Pr_id Varchar(10) Foreign key Stores the premium deposit id
comm int Not null Store the commission amount
ded int Not null Store the deduction amount

(xi) Certificate: Stores information about monthly payment of the agents.


Field Name Field Type Constraints Description
cer_id Varchar(10) Primary key Stores the certificate id
cus_id Varchar(10) Foreign key Stores the customer id
Year date Not null Stores year of certificate
prem int Not null Stores total premium
C_date date Store the certificate date

(xii) Death: Stores information about death record of customers.


Field Name Field Type Constraints Description
d_id Varchar(10) Primary key Stores the death id
cus_no Varchar(10) Foreign key Stores the customer id

RROBOSYS Insurance Smart Agent Page 65


BCA-054701683 CS-76 Report

death_date date Not null Store the death date

RROBOSYS Insurance Smart Agent Page 66


BCA-054701683 CS-76 Report

5. Design Document
5.1 Modules and their description

ISA comprises of five modules. Brief description of each and every module is given below:

(i) Administrator Module: This module will be responsible for administration of the system.

Insurance Companies will be registered by the admin. Insurance plan and scheme will be added

using this module and provide facility to modify them later. It will create new agent and give

username and password to the agents to access the ISA and use the services of ISA. In case of

password forgotten, admin can change the agent’s password. Admin can also supervise the

work of the agents. Using this module, monthly commission and deduction will be calculated

and generate their monthly payment.

(ii) Customer/Policy Holder Management Module: This module will be responsible for

maintaining the customers or policy holders. Agents after logging in to the system can add new

Customer Head, i.e. the head of a family or the bread earner. Some Insurance schemes are for

securing future of the child; they are children but the life assured is provided to customer head.

After adding the Customer Head, detail of the customer / proposed person for insurance will be

added. It also provides the feature modification of any these detail at later stage. This module

will also mark the death of Life assured person in his death status. Guaranteed sum Assured will

be given to his after confirmation from the insurer.

(iii)Policy Management Module: This module will be responsible for managing and supervising

the policies. It will help agents to present the existing plans before the customers and give

comparative benefits of similar type of scheme. It will update the policy proposal status. In case

of bouncing of cheque, amount will be deduction for Agent’s payment. It will store the

RROBOSYS Insurance Smart Agent Page 67


BCA-054701683 CS-76 Report

information related to policy in case of approval of Policy proposal from both sides i.e. Insurer

and Insured. It will be used to surrender any policy and calculated the amount payable to policy

holder. This module is also used to revive any lapsed policy.

(iv) Premium Management Module: This module will handle the premium deposited by policy

holder. It will show the due premium of any policy holder and during any period. It will store the

detail of all premium deposited. It also gives the feature of advance premium deposit. It will

generate the outstanding premium, which are yet to be deposited to the Insurer. It will

automate the calculation of commission. It will be used to print premium certificate and

statement. It also generates list of cheques bounced.

(v) Agent Management Module: This module will be responsible for processing activities related

to agents. It can be used to process any kind query related to commission and deduction of the

agents. Further, it can be used to print the monthly payment of the agents. Agents can edit their

contact information.

5.2 Data Structures

The ISA database consists of 14 tables. Each and every table is setup with the proper Integrity

constraints to work properly. The structure of the database tables is given below

(i) Admin: Stores the details of Administrator.

Field Name Field Type Constraints Description


user varchar(10) Not null Stores the username of the admin.
name varchar(50) stores the name of the admin
Branch varchar(10) Not null stores the branch of the admin.

RROBOSYS Insurance Smart Agent Page 68


BCA-054701683 CS-76 Report

Password varchar(10) stores the password.


AgencyName varchar(100) stores the name of the agency.

(ii) Insurer: Stores the details of the different insurance companies enrolled.
Field Name Field Type Constraints Description
in_id varchar(10) Primary key Stores the unique insurer id.
name varchar(100) Stores the name of the insurer
type varchar(20) Stores the type of the insurance
city varchar(15) Stores the city of the insurer
phone varchar(10) Stores the phone numbers of the insurer

email varchar(25) Stores the email id of the insurer


website varchar(25) Stores the website of the insurer

(iii) Plan: Stores the insurance plan information of the insurer.


Field Name Field Type Constraints Description
pl_id varchar(10) Primary key Stores the unique plan id
in_id varchar(10) Foreign key Stores the insurer id of particular plan
name varchar(100) Unique Store the fullname of plan
Table_no int Unique Stores the table no. of the plan
Type Varchar(50) Not null Stores the type of the plan
min_SA longint Not null Stores the minimum Sum Assurance
the plan
Min_term int Not null Stores the minimum term of the plan
Min_age int Not null Stores the minimum age of policy
holder
Tax_benefit varchar(10) Stores the tax benefit of the plan
maturity_1 longint Not null Stores the plan’s maturity of 1 lakh of
35 year old for 10 years.
comm int Not null Stores the commission % of the agent
Ext_term int Stores the extended term of the plan
Surr_factor int Not null Stores the surrender factor of the plan

RROBOSYS Insurance Smart Agent Page 69


BCA-054701683 CS-76 Report

benefit blob Stores the benefits of the plan

Iv) Agent: Stores the details of the agents of the insurance company.
Field Name Field Type Constraints Description
ag_id int Primary key Stores the unique agent code
user varchar(15) Unique Stores the unique agent username
Password Varchar(30) Not Null Stores the password of the agent
in_id varchar(10) Foreign key Uses the insurer id for the agent.
Name varchar(50) Stores fullname of the agent
Address varchar(100) Stores address of the agent
City varchar(50) Stores city of the agent
Phone varchar(10) Stores phone number of the agent
Email varchar(10) Stores email of the agent
Dob varchar(10) Stores the date of birth of agent
Acc_no varchar(10) Stores the account no
Bank varchar(10) Stores the bank name

vi) Customer: Stores the details of the customer.


Field Name Field Type Constraints Description
h_id varchar(10) Primary key Stores the unique customer code
Cus_id varchar(10) Foreign key Stores the unique customer head code
Fullname varchar(10) Not null Stores fullname of the customer
F_name varchar(10) Not null Stores fullname of the customer
Dob varchar(10) Not null Stores the date of birth of customer
Address varchar(100) Not null Stores address of the customer.
City varchar(30) Not null Stores city of the customer.
Phone varchar(10) Not null Stores phone number of the customer.
Email varchar(50) Not null Stores email of the customer.
Dob date Not null Stores the date of birth of customer.
An_Income longint Stores the annual income of customer.
Acc_no varchar(16) Stores the account no

RROBOSYS Insurance Smart Agent Page 70


BCA-054701683 CS-76 Report

Bank varchar(50) Stores the bank name

(vii) Policy_Prop: Stores the information about policy proposal to the insurer.
Field Name Field Type Constraints Description
prop_id varchar(10) Primary key Stores the unique proposal id
ag_id varchar(10) Foreign key Stores the agent id
pl_id varchar(10) Foreign key Stores the plan id
Cus_id int Foreign key Stores the customer id
Nominee int Foreign key Stores the nominee id
prop_date date Not null Stores the date of the proposal.
SA Int Not null Stores the sum assured of the proposal.
Maturity Int Not null Stores the maturity value of plan.
Term Int Not null Stores the term of the proposal.
Mode varchar(15) Not null Stores the mode of payment of the proposal.
Add_ben blob Stores the additional riders of the proposal.
status varchar(10) Not null Stores the status of the proposal

(viii) Policy: Stores information about different enrolled policy to the customers.
Field Name Field Type Constraints Description
Policy_No Varchar(10) Primary key Stores the policy no. of policy
Prop_id Varchar(10) Foreign key Stores the proposal id
Prem int Not null Stores the premium of the policy
Com_date Date Not null Stores the commencement date
Mat_date date Not null Stores the maturity date
lpd date Not null Store the last premium deposit date.
status Varchar(20) Not null Stores the status of policy.

(ix) Premium: Stores information about premium of the policy.


Field Name Field Type Constraints Description
Pr_id Varchar(10) Primary key Stores the premium deposit id
Policy_no Varchar(10) Foreign key Stores the policy no.

RROBOSYS Insurance Smart Agent Page 71


BCA-054701683 CS-76 Report

Late_fee int Stores late fees of premium


Deposit_date date Not null Store the deposit date
receipt_date date Not null Store the receipt date
Receipt_no longint Store the receipt number

(x) Commission: Stores information about commission of the agents.


Field Name Field Type Constraints Description
com_id Varchar(10) Primary key Stores the commission id
ag_id Varchar(10) Foreign key Stores the agent id.
Pr_id Varchar(10) Foreign key Stores the premium deposit id
comm int Not null Store the commission amount
ded int Not null Store the deduction amount

(xi) Certificate: Stores information about monthly payment of the agents.


Field Name Field Type Constraints Description
cer_id Varchar(10) Primary key Stores the certificate id
cus_id Varchar(10) Foreign key Stores the customer id
Year date Not null Stores year of certificate
prem int Not null Stores total premium
C_date date Store the certificate date

(xii) Death: Stores information about death record of customers.


Field Name Field Type Constraints Description
d_id Varchar(10) Primary key Stores the death id
cus_no Varchar(10) Foreign key Stores the customer id
death_date date Not null Store the death date

-- Constraints for table `agent`

RROBOSYS Insurance Smart Agent Page 72


BCA-054701683 CS-76 Report

ALTER TABLE `agent`

ADD CONSTRAINT `agent_ibfk_1` FOREIGN KEY (`in_id`) REFERENCES `insurer` (`in_id`) ON

DELETE CASCADE ON UPDATE CASCADE;

-- Constraints for table `certificate`

ALTER TABLE `certificate`

ADD CONSTRAINT `certificate_ibfk_1` FOREIGN KEY (`cus_id`) REFERENCES `customer`

(`cus_id`);

-- Constraints for table `commission`

ALTER TABLE `commission`

ADD CONSTRAINT `commission_ibfk_2` FOREIGN KEY (`pr_id`) REFERENCES `premium`

(`pr_id`),

ADD CONSTRAINT `commission_ibfk_1` FOREIGN KEY (`ag_id`) REFERENCES `agent`

(`ag_id`);

-- Constraints for table `customer`

ALTER TABLE `customer`

ADD CONSTRAINT `customer_ibfk_1` FOREIGN KEY (`ag_id`) REFERENCES `agent` (`ag_id`)

ON DELETE CASCADE;

-- Constraints for table `death`

ALTER TABLE `death`

ADD CONSTRAINT `death_ibfk_1` FOREIGN KEY (`cus_id`) REFERENCES `customer`

(`cus_id`);

RROBOSYS Insurance Smart Agent Page 73


BCA-054701683 CS-76 Report

-- Constraints for table `plan`

ALTER TABLE `plan`

ADD CONSTRAINT `plan_ibfk_1` FOREIGN KEY (`in_id`) REFERENCES `insurer` (`in_id`) ON

DELETE CASCADE;

-- Constraints for table `policy`

ALTER TABLE `policy`

ADD CONSTRAINT `policy_ibfk_1` FOREIGN KEY (`prop_id`) REFERENCES `proposal`

(`ag_id`);

-- Constraints for table `premium`

ALTER TABLE `premium`

ADD CONSTRAINT `premium_ibfk_1` FOREIGN KEY (`policy_no`) REFERENCES `policy`

(`policy_no`);

-- Constraints for table `proposal`

ALTER TABLE `proposal`

ADD CONSTRAINT `proposal_ibfk_3` FOREIGN KEY (`cus_id`) REFERENCES `customer`

(`cus_id`),

ADD CONSTRAINT `proposal_ibfk_1` FOREIGN KEY (`ag_id`) REFERENCES `agent` (`ag_id`),

ADD CONSTRAINT `proposal_ibfk_2` FOREIGN KEY (`pl_id`) REFERENCES `plan` (`pl_id`);

RROBOSYS Insurance Smart Agent Page 74


BCA-054701683 CS-76 Report

5.3 Process Logic Modules

Administrator Module

Step 1 : Administrator log in to the system using common interface.

Step 2 : Administrator presented with the following menus:

Create Insurer and insurance schemes

Here insurer details will be filled by the administrator which is going to be registered in ISA.

Along with creating a insurer, administrator can registered various schemes and policies given

by insurer and modify time and again.

Create agents

Here agent’s details will be filled by the administrator which is going to be registered in ISA.

Username and Password will be given to the insurer so that the insurer can use the services of

ISA. Along with creating a insurer administrator can supervise their work and number of policies

achieved in any period.

Change Password

Through this menu administrator can change the password of the agent, in case of agent has

forgotten its password.

Computation of commission of agents. Agents commission will automatically generated based

on their premium received.

View Reports

• Number of active Agents

• Commission of agents.

• Monthly collection of premium.

RROBOSYS Insurance Smart Agent Page 75


BCA-054701683 CS-76 Report

With view reports administrator can view the reports against status of the policies, number of

agents, number of plans the insurer having, etc.

Customer Management Module

 Now the agent will log in to the ISA with the username and password given.

 After logging in to the agent’s account, different menu will be displayed out of which customer

management module has following sub menus:

• Add Customer Head: Before selling any plan, agent will enter the detail of head of the Life

Assured person.

• Add customer: After creating customer head, agent will enter the detail of Proposed person.

• Edit Customer: Change their personal detail later

• Set Death Status: Mark any customer as dead and proceed for payment of Insurance Amount.

Policy Management Module

 Now the agent will log in to the ISA with the username and password given.

 After logging in to the agent’s account, different menu will be displayed out of which policy

management module has following sub menus:

1. Add Policy Proposal: Agents can enter the requirement of the customer and show him the

available policy as per his requirement. He can enter the details of the interested plan like SA,

term, additional benefits, tax benefits etc.

2. Update status of Policy: Policy proposal’s status can be updated for its approval or denial.

3. Add policy: After approval of proposal, agent enters the details of policy bond agreed upon

both parties.

RROBOSYS Insurance Smart Agent Page 76


BCA-054701683 CS-76 Report

4. Surrender Policy: Agent can surrender the policy on request of policy holder and inform him

the surrendered amount after deducting its charges.

5. Revive Policy: Agent can revive a lapsed policy on the demand of policy holder and payment

of revival amount.

6. Generate Report: Several reports can be generated like Policy done in a period, List of policies

surrendered, list of lapsed policies and current policies.

Premium Management Module

 Now the agent will log in to the ISA with the username and password given.

 After logging in to the agent’s account, different menu will be displayed out of which premium

management module has following sub menus:

1. Check due status of premium: Check status of any policy due premium.

2. Deposit due premium: Agent can deposit a premium given by the customer in cash.

3. Advance premium: Advance premium payment facilities is also provided for customers.

3. Update status of premium: On successful payment of premium, agent will enter the receipt

detail of premium payment given by insurer.

4. Generate Reports: Several important such as List of due premium, List of premium collected

by the agent, etc. will be generated.

Agent Management Module

 Now the agent will log in to the ISA with the username and password given.

 After logging in to the agent’s account, different menu will be displayed out of which premium

management module has following sub menus:

RROBOSYS Insurance Smart Agent Page 77


BCA-054701683 CS-76 Report

1. Check commission: Agents can check his productivity by checking commission and in a

particular period.

2. Edit profile: Agents can update their contact information.

3. Generate Reports: They can generate their monthly payment, commission and deduction.

5.4 Testing Process

Error Handling

Error Handling has been an important aspect of system develISAent. Since java provide a better

error handling mechanism, I have selected as the language of DevelISAent. White Box and black

testing will be wherever required.

Validation Checks

Validation Checks has been implemented with the help of Java and MySQL with the help of

database constraints.

5.5 List of Reports

Following will be the list of reports to be generated from the ISA.

1. List of active policies of insurer

2. List of agents of an insurer.

3. List of ongoing policies

4. List of proposal made by an agent.

5. List of Surrendered policies

6. List of Death Case.

RROBOSYS Insurance Smart Agent Page 78


BCA-054701683 CS-76 Report

7. List of Due premium in a period

8. Premium Certificate

9. Premium Receipt.

10. List of collected premium during a period.

RROBOSYS Insurance Smart Agent Page 79


BCA-054701683 CS-76 Report

6. Program Code
Architecture of ISA Project

ISA Form components

RROBOSYS Insurance Smart Agent Page 80


BCA-054701683 CS-76 Report

FORM ISA (MDI)

/* This MDI contain DesktopPane, which have 7 distinct internal frames having similar common
components along with Login form

1. Insurer Manager with methods like addRecBtnActionPerformed(),


searchBtnActionPerformed(), etc.
2. Plan Manager with methods like addRecBtnAction1Performed(),
searchBtn1ActionPerformed(), etc.
3. Agent Manager with methods like addRecBtnAction2Performed(),
searchBtnAction2Performed(), etc.
4. Customer Manager with methods like addRecBtnAction3Performed(),
searchBtn3ActionPerformed(), etc.
5. Policy Manager with methods like addRecBtnAction4Performed(),
searchBtn4ActionPerformed(), etc.
6. Premium Manager with methods like addRecBtnAction5Performed(),
searchBtn5ActionPerformed(), etc.
7. Commission Manager with methods like addRecBtnAction6Performed(),
searchBtn6ActionPerformed(), etc.

Very simple & meaning naming convention is used instead of unwanted comments. IDE auto
generated coding for Components and properties have not been added to avoid uneccesary
making project more bulky.

*/

import java.awt.Color;

import java.beans.PropertyVetoException;

import java.io.File;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.ResultSet;

import java.sql.Statement;

import java.util.logging.Level;

import java.util.logging.Logger;

import javax.swing.JOptionPane;

import javax.swing.table.DefaultTableModel;

* @author Shrikant R. Singh

RROBOSYS Insurance Smart Agent Page 81


BCA-054701683 CS-76 Report

public class ISA extends javax.swing.JFrame {

public int code=0;

public int in_code=0;

/**

* Creates new form ISA

*/

public ISA() {

initComponents();

@SuppressWarnings("unchecked")

//designing of form and property is auto generated by IDE

private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {

System.exit(0);

private void resetBtnActionPerformed(java.awt.event.ActionEvent evt) {

userTf.setText("");

passPwd.setText("");

private void loginBtnActionPerformed(java.awt.event.ActionEvent evt) {

if(adminRb.isSelected()){

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from Admin;");

rs.first();

RROBOSYS Insurance Smart Agent Page 82


BCA-054701683 CS-76 Report

String user=rs.getString(1);

String pass=rs.getString(2);

String name=rs.getString(3);

String agency=rs.getString(4);

String branch=rs.getString(5);

String pwd=new String(passPwd.getPassword());

if(pwd.equals(pass) && user.equals(userTf.getText())){

JOptionPane.showMessageDialog(null,"Successfully loged In");

loginIf.setVisible(false);

insurerBtn.setEnabled(true);

planBtn.setEnabled(true);

customerBtn.setEnabled(true);

policyBtn.setEnabled(true);

premiumBtn.setEnabled(true);

agentBtn.setEnabled(true);

commBtn.setEnabled(true);

resetBtn.doClick();

loginMit.setText("Logout");

userLb.setText("User:"+name);

else{

JOptionPane.showMessageDialog(null,"Permission Denied");

passPwd.setText("");

stmt.close();

con.close();

rs.close();

RROBOSYS Insurance Smart Agent Page 83


BCA-054701683 CS-76 Report

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

else{

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from Agent;");

boolean check=true;

String name = null;

verify:

while(rs.next()){

String user=rs.getString(2);

String pass=rs.getString(3);

String pwd=new String(passPwd.getPassword());

if(pwd.equals(pass) && user.equals(userTf.getText())){

in_code=rs.getInt(4);

code=rs.getInt(1);

name=rs.getString(5);

check=false;

loginIf.setVisible(false);

insurerBtn.setEnabled(false);

planBtn.setEnabled(true);

customerBtn.setEnabled(true);

RROBOSYS Insurance Smart Agent Page 84


BCA-054701683 CS-76 Report

policyBtn.setEnabled(true);

premiumBtn.setEnabled(true);

agentBtn.setEnabled(false);

commBtn.setEnabled(true);

resetBtn.doClick();

loginMit.setText("Logout");

userLb.setText("User:"+name);

break verify;

if(check){

JOptionPane.showMessageDialog(null,"Permission Denied");

passPwd.setText("");

stmt.close();

con.close();

rs.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void insurerBtnActionPerformed(java.awt.event.ActionEvent evt) {

try {

insurerIf.setSelected(true);

insurerIf.setVisible(true);

RROBOSYS Insurance Smart Agent Page 85


BCA-054701683 CS-76 Report

} catch (PropertyVetoException ex) {

Logger.getLogger(ISA.class.getName()).log(Level.SEVERE, null, ex);

private void loginMitActionPerformed(java.awt.event.ActionEvent evt) {

try {

loginIf.setSelected(true);

insurerBtn.setEnabled(false);

planBtn.setEnabled(false);

customerBtn.setEnabled(false);

policyBtn.setEnabled(false);

premiumBtn.setEnabled(false);

agentBtn.setEnabled(false);

commBtn.setEnabled(false);

loginMit.setText("LogIn");

loginIf.setVisible(true);

insurerIf.setVisible(false);

planIf.setVisible(false);

agentIf.setVisible(false);

customerIf.setVisible(false);

policyIf.setVisible(false);

premiumIf.setVisible(false);

commIf.setVisible(false);

userLb.setText("User: Guest");

} catch (PropertyVetoException ex) {

Logger.getLogger(ISA.class.getName()).log(Level.SEVERE, null, ex);

RROBOSYS Insurance Smart Agent Page 86


BCA-054701683 CS-76 Report

private void showBtnActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)insurerTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from Insurer;");

while(rs.next()){

int in_id=rs.getInt(1);

String name=rs.getString(2);

String type=rs.getString(3);

String phone=rs.getString(4);

String city=rs.getString(5);

String email=rs.getString(6);

String website=rs.getString(7);

tab.addRow(new Object[]{in_id, name, type, phone, city, email, website});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

RROBOSYS Insurance Smart Agent Page 87


BCA-054701683 CS-76 Report

private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

new InsurerAddUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

private void editBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

new InsurerModifyUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

private void searchBtnActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)insurerTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

String value=searchTf.getText();

String column=(String) selectCb.getSelectedItem();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

RROBOSYS Insurance Smart Agent Page 88


BCA-054701683 CS-76 Report

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from Insurer where "+column+" like


'%"+value+"%';");

while(rs.next()){

int in_id=rs.getInt(1);

String name=rs.getString(2);

String type=rs.getString(3);

String phone=rs.getString(4);

String city=rs.getString(5);

String email=rs.getString(6);

String website=rs.getString(7);

tab.addRow(new Object[]{in_id, name, type, phone, city, email, website});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void searchTfFocusGained(java.awt.event.FocusEvent evt) {

searchTf.setForeground(Color.black);

searchTf.selectAll();

private void showBtn1ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)planTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

RROBOSYS Insurance Smart Agent Page 89


BCA-054701683 CS-76 Report

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String filter="";

if (code!=0){

filter ="where in_id ="+in_code;

ResultSet rs=stmt.executeQuery("select * from plan "+filter+";");

while(rs.next()){

int pl_id=rs.getInt(1);

int insurer=rs.getInt(2);

String name=rs.getString(3);

String table=rs.getString(4);

String type=rs.getString(5);

int SA=rs.getInt(6);

int term=rs.getInt(7);

int age=rs.getInt(8);

String tax=rs.getString(9);

int maturity=rs.getInt(10);

int comm=rs.getInt(11);

int ext=rs.getInt(12);

int surr=rs.getInt(13);

String benefit=rs.getString(14);

tab.addRow(new Object[]{pl_id, insurer, name, table,type, SA, term, age, tax, maturity,
comm, ext,surr, benefit});

rs.close();

RROBOSYS Insurance Smart Agent Page 90


BCA-054701683 CS-76 Report

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtn1ActionPerformed(java.awt.event.ActionEvent evt) {

try{

new PlanAddUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

private void editBtn1ActionPerformed(java.awt.event.ActionEvent evt) {

try{

new PlanModifyUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

private void searchBtn1ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)planTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

String value=searchTf1.getText();

RROBOSYS Insurance Smart Agent Page 91


BCA-054701683 CS-76 Report

String column=(String) selectCb1.getSelectedItem();

String filter="";

if (code!=0){

filter ="and in_id ="+in_code;

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from Plan where "+column+" like '%"+value+"%'


"+filter+";");

while(rs.next()){

int pl_id=rs.getInt(1);

int insurer=rs.getInt(2);

String name=rs.getString(3);

String table=rs.getString(4);

String type=rs.getString(5);

int SA=rs.getInt(6);

int term=rs.getInt(7);

int age=rs.getInt(8);

String tax=rs.getString(9);

int maturity=rs.getInt(10);

int comm=rs.getInt(11);

int ext=rs.getInt(12);

int surr=rs.getInt(13);

String benefit=rs.getString(14);

tab.addRow(new Object[]{pl_id, insurer, name, table,type, SA, term, age, tax, maturity,
comm, ext,surr, benefit});

RROBOSYS Insurance Smart Agent Page 92


BCA-054701683 CS-76 Report

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void planIfInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {

if (code==0){

addBtn1.setEnabled(true);

editBtn1.setEnabled(true);

else{

addBtn1.setEnabled(false);

editBtn1.setEnabled(false);

private void showBtn2ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)agentTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

RROBOSYS Insurance Smart Agent Page 93


BCA-054701683 CS-76 Report

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from Agent;");

while(rs.next()){

int ag_id=rs.getInt(1);

int in_id=rs.getInt(4);

String user=rs.getString(2);

String pass=rs.getString(3);

String name=rs.getString(5);

String address=rs.getString(6);

String phone=rs.getString(8);

String city=rs.getString(7);

String email=rs.getString(9);

String dob=rs.getString(10);

int acc_no=rs.getInt(11);

String bank=rs.getString(12);

tab.addRow(new Object[]{ag_id, user, pass, in_id, name, address, city, phone, email,
dob, acc_no, bank});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtn2ActionPerformed(java.awt.event.ActionEvent evt) {

try{

new AgentAddUI() .setVisible(true);

RROBOSYS Insurance Smart Agent Page 94


BCA-054701683 CS-76 Report

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

private void editBtn2ActionPerformed(java.awt.event.ActionEvent evt) {

try{

new AgentModifyUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

private void searchBtn2ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)agentTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

String value=searchTf2.getText();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from Agent where name like '%"+value+"%';");

while(rs.next()){

int ag_id=rs.getInt(1);

int in_id=rs.getInt(4);

String user=rs.getString(2);

RROBOSYS Insurance Smart Agent Page 95


BCA-054701683 CS-76 Report

String pass=rs.getString(3);

String name=rs.getString(5);

String address=rs.getString(6);

String phone=rs.getString(8);

String city=rs.getString(7);

String email=rs.getString(9);

String dob=rs.getString(10);

int acc_no=rs.getInt(11);

String bank=rs.getString(12);

tab.addRow(new Object[]{ag_id, user, pass, in_id, name, address, city, phone, email,
dob, acc_no, bank});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void showBtn3ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)customerTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

RROBOSYS Insurance Smart Agent Page 96


BCA-054701683 CS-76 Report

ResultSet rs=stmt.executeQuery("select * from customer ;");

while(rs.next()){

int cus_id=rs.getInt(1);

String f_name=rs.getString(3);

int income=rs.getInt(9);

String name=rs.getString(2);

String address=rs.getString(5);

String phone=rs.getString(7);

String city=rs.getString(6);

String email=rs.getString(8);

String dob=rs.getString(4);

int acc_no=rs.getInt(10);

String bank=rs.getString(11);

String death=rs.getString(12);

int ag_id=rs.getInt(13);

tab.addRow(new Object[]{cus_id, name, f_name,dob,address, city, phone, email,


income, acc_no, bank, death});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtn3ActionPerformed(java.awt.event.ActionEvent evt) {

RROBOSYS Insurance Smart Agent Page 97


BCA-054701683 CS-76 Report

try{

new CustomerAddUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

private void editBtn3ActionPerformed(java.awt.event.ActionEvent evt) {

try{

new CustomerModifyUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

private void searchBtn3ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)customerTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

String value=searchTf3.getText();

String column=(String) selectCb3.getSelectedItem();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from customer where "+column+" like


'%"+value+"%';");

while(rs.next()){

RROBOSYS Insurance Smart Agent Page 98


BCA-054701683 CS-76 Report

int cus_id=rs.getInt(1);

String f_name=rs.getString(3);

int income=rs.getInt(9);

String name=rs.getString(2);

String address=rs.getString(5);

String phone=rs.getString(7);

String city=rs.getString(6);

String email=rs.getString(8);

String dob=rs.getString(4);

int acc_no=rs.getInt(10);

String bank=rs.getString(11);

String death=rs.getString(12);

int ag_id=rs.getInt(13);

tab.addRow(new Object[]{cus_id, name, f_name,dob,address, city, phone, email,


income, acc_no, bank, death});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void showBtn4ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)proposalTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

DefaultTableModel tab1=(DefaultTableModel)maturityTbl.getModel();

RROBOSYS Insurance Smart Agent Page 99


BCA-054701683 CS-76 Report

tab1.getDataVector().removeAllElements();

tab1.fireTableDataChanged();

DefaultTableModel tab2=(DefaultTableModel)policyTbl.getModel();

tab2.getDataVector().removeAllElements();

tab2.fireTableDataChanged();

String filter="";

if (code!=0){

filter ="and agent.ag_id ="+code;

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String sql1="select prop_id, agent.name, plan.name, customer.name, nominee, "+

"prop_date, SA, proposal.maturity, term, mode, rider, proposal.status from agent,


plan, customer, proposal "+

"where proposal.ag_id=agent.ag_id and proposal.pl_id=plan.pl_id and


proposal.cus_id=customer.cus_id "+filter+";";

ResultSet rs=stmt.executeQuery(sql1);

while(rs.next()){

int prop_id=rs.getInt(1);

String ag_name=rs.getString(2);

String pl_name=rs.getString(3);

String cus_name=rs.getString(4);

String nom_name=rs.getString(5);

String prop_date=rs.getString(6);

int SA=rs.getInt(7);

int maturity=rs.getInt(8);

RROBOSYS Insurance Smart Agent Page 100


BCA-054701683 CS-76 Report

int term=rs.getInt(9);

String mode=rs.getString(10);

String rider=rs.getString(11);

String status=rs.getString(12);

tab.addRow(new Object[]{prop_id, cus_name, pl_name, ag_name, nom_name,


prop_date,

SA, maturity, term, mode, rider,status});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

// For displaying Maturing Policies

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String sql1="select policy_no, customer.name, plan.name, "+

"SA, proposal.maturity, mat_date, lpd from agent, plan, customer, proposal, policy "+

"where proposal.ag_id=agent.ag_id and proposal.pl_id=plan.pl_id and policy.prop_id =


proposal.prop_id"

+ " and proposal.cus_id=customer.cus_id and


period_diff(date_format(mat_date,'%Y%m'),date_format(now(),'%Y%m'))<=6 "

RROBOSYS Insurance Smart Agent Page 101


BCA-054701683 CS-76 Report

+filter+";";

ResultSet rs=stmt.executeQuery(sql1);

while(rs.next()){

int policy=rs.getInt(1);

String pl_name=rs.getString(3);

String cus_name=rs.getString(2);

String mat_date=rs.getString(6);

int SA=rs.getInt(4);

int maturity=rs.getInt(5);

String lpd=rs.getString(7);

tab1.addRow(new Object[]{policy, cus_name, pl_name, SA, maturity, mat_date, lpd});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

// for displaying Existing policies

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String sql1="select policy_no, customer.name, plan.name, SA, proposal.maturity, "+

RROBOSYS Insurance Smart Agent Page 102


BCA-054701683 CS-76 Report

"term, mode, premium, nominee, rider, mat_date, lpd, policy.status,"

+ " customer.phone from agent, plan, customer, proposal, policy "+

"where proposal.ag_id=agent.ag_id and proposal.pl_id=plan.pl_id and "

+ "proposal.cus_id=customer.cus_id and policy.prop_id=proposal.prop_id "+filter+";";

ResultSet rs=stmt.executeQuery(sql1);

while(rs.next()){

int policy=rs.getInt(1);

String pl_name=rs.getString(3);

String cus_name=rs.getString(2);

int SA=rs.getInt(4);

int maturity=rs.getInt(5);

int term=rs.getInt(6);

String mode=rs.getString(7);

int premium=rs.getInt(8);

String nom_name=rs.getString(9);

String rider=rs.getString(10);

String mat_date=rs.getString(11);

String lpd=rs.getString(12);

String status=rs.getString(13);

String phone=rs.getString(14);

tab2.addRow(new Object[]{policy, cus_name, pl_name, SA, maturity, term, mode,


premium,

nom_name, rider, mat_date,lpd,status,phone});

rs.close();

stmt.close();

con.close();

RROBOSYS Insurance Smart Agent Page 103


BCA-054701683 CS-76 Report

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtn4ActionPerformed(java.awt.event.ActionEvent evt) {

try{

new PolicyAddUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

private void editBtn4ActionPerformed(java.awt.event.ActionEvent evt) {

try{

new PolicyModifyUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

private void addBtn4ActionPerformed(java.awt.event.ActionEvent evt) {

try{

new PolicyAddUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

RROBOSYS Insurance Smart Agent Page 104


BCA-054701683 CS-76 Report

private void editBtn4ActionPerformed(java.awt.event.ActionEvent evt) {

try{

new PolicyModifyUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

private void searchBtn4ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab2=(DefaultTableModel)policyTbl.getModel();

tab2.getDataVector().removeAllElements();

tab2.fireTableDataChanged();

String value=searchTf4.getText();

String column=(String) selectCb4.getSelectedItem();

String filter="";

if (code!=0){

filter ="and agent.ag_id ="+code;

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String sql1="select policy_no, customer.name, plan.name, SA, proposal.maturity, "+

"term, mode, premium, nominee, rider, mat_date, lpd, policy.status,"

+ " customer.phone from agent, plan, customer, proposal, policy "+

RROBOSYS Insurance Smart Agent Page 105


BCA-054701683 CS-76 Report

"where proposal.ag_id=agent.ag_id and proposal.pl_id=plan.pl_id and "

+ "proposal.cus_id=customer.cus_id and policy.prop_id=proposal.prop_id "+filter+

" and "+column+" like '%"+value+"%' ;";

ResultSet rs=stmt.executeQuery(sql1);

while(rs.next()){

int policy=rs.getInt(1);

String pl_name=rs.getString(3);

String cus_name=rs.getString(2);

int SA=rs.getInt(4);

int maturity=rs.getInt(5);

int term=rs.getInt(6);

String mode=rs.getString(7);

int premium=rs.getInt(8);

String nom_name=rs.getString(9);

String rider=rs.getString(10);

String mat_date=rs.getString(11);

String lpd=rs.getString(12);

String status=rs.getString(13);

String phone=rs.getString(14);

tab2.addRow(new Object[]{policy, cus_name, pl_name, SA, maturity, term, mode,


premium,

nom_name, rider, mat_date,lpd,status,phone});

rs.close();

stmt.close();

con.close();

RROBOSYS Insurance Smart Agent Page 106


BCA-054701683 CS-76 Report

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void policyIfInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {

// TODO add your handling code here:

private void showBtn5ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)premiumDueTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

DefaultTableModel tab1=(DefaultTableModel)premiumTbl.getModel();

tab1.getDataVector().removeAllElements();

tab1.fireTableDataChanged();

DefaultTableModel tab2=(DefaultTableModel)certificateTbl.getModel();

tab2.getDataVector().removeAllElements();

tab2.fireTableDataChanged();

String filter="";

if (code!=0){

filter ="and agent.ag_id ="+code;

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

RROBOSYS Insurance Smart Agent Page 107


BCA-054701683 CS-76 Report

String sql1="select premium.pr_id, premium.policy_no, customer.name, plan.name,


customer.phone, "+

"premium, lpd, to_days(lpd), to_days(now()),mode from agent, plan, customer,


proposal, policy, premium "+

"where proposal.ag_id=agent.ag_id and proposal.pl_id=plan.pl_id and


premium.policy_no=policy.policy_no "

+ "and proposal.cus_id=customer.cus_id and policy.prop_id=proposal.prop_id and


policy.status='active'"

+ " and lpd!=mat_date and


period_diff(date_format(lpd,'%Y%m'),date_format(now(),'%Y%m'))<=3 "+filter+";";

ResultSet rs=stmt.executeQuery(sql1);

while(rs.next()){

int pr=rs.getInt(1);

int policy=rs.getInt(2);

String cus_name=rs.getString(3);

String pl_name=rs.getString(4);

String phone=rs.getString(5);

int premium=rs.getInt(6);

String due=rs.getString(7);

int lpd=rs.getInt(8);

int now=rs.getInt(9);

String mode=rs.getString(10);

int factor=1;

if(mode.equalsIgnoreCase("Half Yearly")){

factor = (now-lpd)/(365/2);

else if(mode.equalsIgnoreCase("Quaterly")){

factor = (now-lpd)/(365/4);

else{

RROBOSYS Insurance Smart Agent Page 108


BCA-054701683 CS-76 Report

factor = (now-lpd)/365;

String Prem = ""+premium*factor+" ( "+factor+" times )";

tab.addRow(new Object[]{policy,cus_name, pl_name, phone, Prem,due});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

//To display Premium Deposited

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String sql1="select pr_id, premium.policy_no, customer.name, customer.f_name,


plan.name, "+

"premium, late, rec_no, rec_date from agent, plan, customer, proposal, policy,
premium "+

"where proposal.ag_id=agent.ag_id and proposal.pl_id=plan.pl_id and


premium.policy_no=policy.policy_no "

+ "and proposal.cus_id=customer.cus_id and policy.prop_id=proposal.prop_id


"+filter+";";

ResultSet rs=stmt.executeQuery(sql1);

while(rs.next()){

RROBOSYS Insurance Smart Agent Page 109


BCA-054701683 CS-76 Report

int pr_id=rs.getInt(1);

int policy=rs.getInt(2);

String cus_name=rs.getString(3);

String f_name=rs.getString(4);

String pl_name=rs.getString(5);

int premium=rs.getInt(6);

String late=rs.getString(7);

int rec_no=rs.getInt(8);

String rec_date=rs.getString(9);

tab1.addRow(new Object[]{pr_id, policy,cus_name, f_name, pl_name, premium, late,


rec_no, rec_date});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

//To display Certificates Issued

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String sql1="select cer_id, customer.name, customer.f_name, year , total, cer_date from


certificate,"

RROBOSYS Insurance Smart Agent Page 110


BCA-054701683 CS-76 Report

+ " customer where certificate.cus_id=customer.cus_id ;";

ResultSet rs=stmt.executeQuery(sql1);

while(rs.next()){

int c_id=rs.getInt(1);

String cus_name=rs.getString(2);

String f_name=rs.getString(3);

String year=rs.getString(4);

int premium=rs.getInt(5);

String c_date=rs.getString(6);

tab2.addRow(new Object[]{c_id, c_date, cus_name, f_name, year, premium});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtn5ActionPerformed(java.awt.event.ActionEvent evt) {

try{

new PremiumAddUI() .setVisible(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Form already Open");

RROBOSYS Insurance Smart Agent Page 111


BCA-054701683 CS-76 Report

private void searchBtn5ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)premiumDueTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

String value=searchTf5.getText();

String column=(String) selectCb5.getSelectedItem();

String filter="";

if (code!=0){

filter ="and agent.ag_id ="+code;

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String sql1="select pr_id, premium.policy_no, customer.name, plan.name,


customer.phone, "+

"premium, lpd, to_days(lpd), to_days(now()),mode from agent, plan, customer,


proposal, policy, premium "+

"where proposal.ag_id=agent.ag_id and proposal.pl_id=plan.pl_id and


premium.policy_no=policy.policy_no "

+ "and proposal.cus_id=customer.cus_id and policy.prop_id=proposal.prop_id and


policy.status='active'"

+ " and lpd!=mat_date and


period_diff(date_format(lpd,'%Y%m'),date_format(now(),'%Y%m'))<=3 "+filter+

" and "+column+" like '%"+value+"%' ;";

ResultSet rs=stmt.executeQuery(sql1);

while(rs.next()){

RROBOSYS Insurance Smart Agent Page 112


BCA-054701683 CS-76 Report

int pr_id=rs.getInt(1);

int policy=rs.getInt(2);

String cus_name=rs.getString(3);

String pl_name=rs.getString(4);

String phone=rs.getString(5);

int premium=rs.getInt(6);

String due=rs.getString(7);

int lpd=rs.getInt(8);

int now=rs.getInt(9);

String mode=rs.getString(10);

int factor=1;

if(mode.equalsIgnoreCase("Half Yearly")){

factor = (now-lpd)/(365/2);

else if(mode.equalsIgnoreCase("Quaterly")){

factor = (now-lpd)/(365/4);

else{

factor = (now-lpd)/365;

String Prem = ""+premium*factor+" ( "+factor+" times )";

tab.addRow(new Object[]{pr_id, policy,cus_name, pl_name, phone, Prem,due});

rs.close();

stmt.close();

con.close();

RROBOSYS Insurance Smart Agent Page 113


BCA-054701683 CS-76 Report

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void premiumIfInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {

// TODO add your handling code here:

private void planBtnActionPerformed(java.awt.event.ActionEvent evt) {

try {

planIf.setSelected(true);

planIf.setVisible(true);

} catch (PropertyVetoException ex) {

Logger.getLogger(ISA.class.getName()).log(Level.SEVERE, null, ex);

private void agentBtnActionPerformed(java.awt.event.ActionEvent evt) {

try {

agentIf.setSelected(true);

agentIf.setVisible(true);

} catch (PropertyVetoException ex) {

Logger.getLogger(ISA.class.getName()).log(Level.SEVERE, null, ex);

RROBOSYS Insurance Smart Agent Page 114


BCA-054701683 CS-76 Report

private void customerBtnActionPerformed(java.awt.event.ActionEvent evt) {

try {

customerIf.setSelected(true);

customerIf.setVisible(true);

} catch (PropertyVetoException ex) {

Logger.getLogger(ISA.class.getName()).log(Level.SEVERE, null, ex);

private void policyBtnActionPerformed(java.awt.event.ActionEvent evt) {

try {

policyIf.setSelected(true);

policyIf.setVisible(true);

} catch (PropertyVetoException ex) {

Logger.getLogger(ISA.class.getName()).log(Level.SEVERE, null, ex);

private void premiumBtnActionPerformed(java.awt.event.ActionEvent evt) {

try {

premiumIf.setSelected(true);

premiumIf.setVisible(true);

} catch (PropertyVetoException ex) {

Logger.getLogger(ISA.class.getName()).log(Level.SEVERE, null, ex);

private void commBtnActionPerformed(java.awt.event.ActionEvent evt) {

RROBOSYS Insurance Smart Agent Page 115


BCA-054701683 CS-76 Report

try {

commIf.setSelected(true);

commIf.setVisible(true);

} catch (PropertyVetoException ex) {

Logger.getLogger(ISA.class.getName()).log(Level.SEVERE, null, ex);

private void showBtn6ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)commTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

String filter="";

if (code!=0){

filter ="and agent.ag_id ="+code;

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select comm_id, commission.pr_id, Premium.Policy_no,


comm, ded from agent,"

+ " commission, premium, policy, proposal where commission.pr_id=premium.pr_id


and "

+ "premium.policy_no=policy.policy_no and policy.prop_id=proposal.prop_id and


proposal.ag_id=agent.ag_id "+filter +";");

int Comm = 0, Ded = 0;

while(rs.next()){

RROBOSYS Insurance Smart Agent Page 116


BCA-054701683 CS-76 Report

int comm_id=rs.getInt(1);

String pr_id=rs.getString(2);

String policy=rs.getString(3);

int comm=rs.getInt(4);

int ded=rs.getInt(5);

tab.addRow(new Object[]{comm_id,pr_id, policy, comm, ded});

Comm = Comm+comm;Ded = Ded+ded;

tab.addRow(new Object[]{"","", "Total", Comm, Ded});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void searchBtn6ActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)commTbl.getModel();

tab.getDataVector().removeAllElements();

tab.fireTableDataChanged();

String value=searchTf.getText();

String column=(String) selectCb.getSelectedItem();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

RROBOSYS Insurance Smart Agent Page 117


BCA-054701683 CS-76 Report

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from Insurer where "+column+"='"+value+"';");

while(rs.next()){

int in_id=rs.getInt(1);

String name=rs.getString(2);

String type=rs.getString(3);

String phone=rs.getString(4);

String city=rs.getString(5);

String email=rs.getString(6);

String website=rs.getString(7);

tab.addRow(new Object[]{in_id, name, type, phone, city, email, website});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void commIfInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {

// TODO add your handling code here:

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

RROBOSYS Insurance Smart Agent Page 118


BCA-054701683 CS-76 Report

PrintUtilities.printComponent(insurerTbl);

private void printBtn1ActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(policyTbl);

private void printBtn3ActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(customerTbl);

private void printBtn2ActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(agentTbl);

private void printBtn4ActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(policyTbl);

private void printBtn5ActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(premiumDueTbl);

private void printBtn6ActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(commTbl);

RROBOSYS Insurance Smart Agent Page 119


BCA-054701683 CS-76 Report

private void proposalBtnActionPerformed(java.awt.event.ActionEvent evt) {

new ProposalAddUI().setVisible(true);

private void certificateBtnActionPerformed(java.awt.event.ActionEvent evt) {

new CertificateUI().setVisible(true);

private void maturedBtnActionPerformed(java.awt.event.ActionEvent evt) {

new ViewMaturedUI().setVisible(true);

private void aboutMenuItemActionPerformed(java.awt.event.ActionEvent evt) {

aboutDb.setVisible(true);

private void deleteActionPerformed(java.awt.event.ActionEvent evt) {

int conf=JOptionPane.showConfirmDialog(this, "Are you sure to delete Database and


Restore default?");

if(conf==JOptionPane.YES_OPTION){

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/test","root","");

Statement stmt=con.createStatement();

int rs1 = stmt.executeUpdate("Drop Database if exists SmartAgent;");

int rs2 = stmt.executeUpdate("Create Database if not exists SmartAgent;");

int rs3 = stmt.executeUpdate("use SmartAgent;");

RROBOSYS Insurance Smart Agent Page 120


BCA-054701683 CS-76 Report

importDb.setVisible(true);

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void planIfInternalFrameActivated(javax.swing.event.InternalFrameEvent evt) {

if (code==0){

addBtn1.setEnabled(true);

editBtn1.setEnabled(true);

else{

addBtn1.setEnabled(false);

editBtn1.setEnabled(false);

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new ISA().setVisible(true);

});

public class InsurerAddUI extends javax.swing.JFrame {

RROBOSYS Insurance Smart Agent Page 121


BCA-054701683 CS-76 Report

public InsurerAddUI() {

initComponents();

private void addRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

int id = Integer.parseInt(in_idTf.getText());

String name = nameTf.getText();

String type = (String) typeCb.getSelectedItem();

String city =cityTf.getText();

long phone = Long.parseLong(phoneTf.getText());

String email = emailTf.getText();

String website = websiteTf.getText();

String query="Insert into Insurer values("+id+",'"+name+"','"+type+"','"

+city+"',"+phone+",'"+email+"','"+website+"');";

int rs=stmt.executeUpdate(query);

stmt.close();

con.close();

resetBtn.doClick();id++;

in_idTf.setText(""+id);

catch(Exception e){

JOptionPane.showMessageDialog(this,"Fill more details");

RROBOSYS Insurance Smart Agent Page 122


BCA-054701683 CS-76 Report

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

private void resetBtnActionPerformed(java.awt.event.ActionEvent evt) {

nameTf.setText("");

cityTf.setText("");

phoneTf.setText("");

emailTf.setText("");

websiteTf.setText("");

private void formWindowOpened(java.awt.event.WindowEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from Insurer;");

rs.last();

int in_id=rs.getInt(1)+1;

rs.close();

stmt.close();

con.close();

RROBOSYS Insurance Smart Agent Page 123


BCA-054701683 CS-76 Report

in_idTf.setText(""+in_id);

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {

addRecBtn.doClick();

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new InsurerAddUI().setVisible(true);

});

public class InsurerModifyUI extends javax.swing.JFrame {

/**
* Creates new form InsurerAddUI
*/
public InsurerModifyUI() {
initComponents();
}
private void modifyRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

RROBOSYS Insurance Smart Agent Page 124


BCA-054701683 CS-76 Report

try{
Class.forName("java.sql.Driver");
Connection con=(Connection) DriverManager.getConnection
("jdbc:mysql://localhost/isa","root","");
Statement stmt1=con.createStatement();
int in_id = Integer.parseInt(in_idTf.getText());
String type = (String) typeCb.getSelectedItem();
String city =cityTf.getText();
long phone = Long.parseLong(phoneTf.getText());
String email = emailTf.getText();
String website = websiteTf.getText();
String query="Update Insurer set type='"+type+"', city ='"+city+"', phone ="
+phone+", email ='"+email+"', website ='"+website+"' where in_id="+in_id+";";
int rs=stmt1.executeUpdate(query);
stmt1.close();
con.close();
JOptionPane.showMessageDialog(this,"Record Updated sucessfully");
cityTf.setText("");
phoneTf.setText("");
emailTf.setText("");
websiteTf.setText("");
nameCb.setEnabled(true);
}
catch(Exception e){
JOptionPane.showMessageDialog(this,"Error in Connectivity");
}
}

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

private void deleteBtnActionPerformed(java.awt.event.ActionEvent evt) {


int conf=JOptionPane.showConfirmDialog(this, "Are you sure to delete Record?");
if(conf==JOptionPane.YES_OPTION){

RROBOSYS Insurance Smart Agent Page 125


BCA-054701683 CS-76 Report

try{
Class.forName("java.sql.Driver");
Connection con=(Connection) DriverManager.getConnection
("jdbc:mysql://localhost/isa","root","");
Statement stmt=con.createStatement();
int in_id = Integer.parseInt(in_idTf.getText());
int rs=stmt.executeUpdate("delete from insurer where in_id="+in_id+";");
in_idTf.setText("");
cityTf.setText("");
phoneTf.setText("");
emailTf.setText("");
websiteTf.setText("");
stmt.close();
con.close();
}
catch(Exception e){
JOptionPane.showMessageDialog(this,e.getMessage());
}
}
}

private void formWindowOpened(java.awt.event.WindowEvent evt) {


DefaultComboBoxModel combo1=(DefaultComboBoxModel)nameCb.getModel();
try{
Class.forName("java.sql.Driver");
Connection con=(Connection) DriverManager.getConnection
("jdbc:mysql://localhost/isa","root","");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select name from Insurer;");
while(rs.next()){
String name=rs.getString(1);
combo1.addElement(name);

}
rs.close();
stmt.close();
con.close();
}
catch(Exception e){
JOptionPane.showMessageDialog(this,e.getMessage());
}

RROBOSYS Insurance Smart Agent Page 126


BCA-054701683 CS-76 Report

private void delBtnActionPerformed(java.awt.event.ActionEvent evt) {


deleteBtn.doClick();
}

private void viewBtnActionPerformed(java.awt.event.ActionEvent evt) {


try{
Class.forName("java.sql.Driver");
Connection con=(Connection) DriverManager.getConnection
("jdbc:mysql://localhost/isa","root","");
Statement stmt=con.createStatement();
String name = (String) nameCb.getSelectedItem();
nameCb.setEnabled(false);
String query="Select * from insurer where name='"+name+"';";
ResultSet rs=stmt.executeQuery(query);
rs.first();
String in_id=rs.getString(1);
String type=rs.getString(3);
String city=rs.getString(4);
String phone=rs.getString(5);
String email=rs.getString(6);
String website=rs.getString(7);
in_idTf.setText(in_id);
typeCb.setSelectedItem(type);
phoneTf.setText(phone);
cityTf.setText(city);
emailTf.setText(email);
websiteTf.setText(website);

stmt.close();
con.close();
}
catch(Exception e){
JOptionPane.showMessageDialog(this,e.getMessage());
}
modifyRecBtn.setEnabled(true);
deleteBtn.setEnabled(true);

RROBOSYS Insurance Smart Agent Page 127


BCA-054701683 CS-76 Report

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {


PrintUtilities.printComponent(this);
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {


new InsurerModifyUI().setVisible(true);
}
});
}

AGENTADDUI.JAVA

public class AgentAddUI extends javax.swing.JFrame {

public AgentAddUI() {

initComponents();

private void addRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

int ag_id = Integer.parseInt(ag_idTf.getText());

String user = userTf.getText();

String pass = passTf.getText();

String name = nameTf.getText();

String insurer = (String) insurerCb.getSelectedItem();

String city =cityTf.getText();

String email =emailTf.getText();

long phone = Long.parseLong(phoneTf.getText());

String address = addressTf.getText();

RROBOSYS Insurance Smart Agent Page 128


BCA-054701683 CS-76 Report

String dob = dobTf.getText();

String account = accountTf.getText();

String bank = bankTf.getText();

ResultSet rs1=stmt.executeQuery("Select in_id from insurer where name='"+insurer+"';");

rs1.first();

int in_id = rs1.getInt(1);

String query="Insert into agent values("+ag_id+",'"+user+"','"+pass+"',"+in_id+",'"

+name+"','"+address+"','"+city+"',"+phone+",'"+email+"','"+dob+"',"+account+",'"+bank+"');";

int rs=stmt.executeUpdate(query);

stmt.close();

con.close();

resetBtn.doClick();ag_id++;

ag_idTf.setText(""+ag_id);

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

RROBOSYS Insurance Smart Agent Page 129


BCA-054701683 CS-76 Report

private void resetBtnActionPerformed(java.awt.event.ActionEvent evt) {

userTf.setText("");

passTf.setText("");

nameTf.setText("");

addressTf.setText("");

cityTf.setText("");

phoneTf.setText("");

emailTf.setText("");

dobTf.setText("");

accountTf.setText("");

bankTf.setText("");

private void formWindowOpened(java.awt.event.WindowEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select ag_id from agent;");

rs.last();

int ag_id=rs.getInt(1)+1;

ResultSet rs1=stmt.executeQuery("select name from insurer;");

while(rs1.next()){

String insurer=rs1.getString(1);

insurerCb.addItem(insurer);

rs.close();

RROBOSYS Insurance Smart Agent Page 130


BCA-054701683 CS-76 Report

stmt.close();

con.close();

ag_idTf.setText(""+ag_id);

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {

addRecBtn.doClick();

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new AgentAddUI().setVisible(true);

});

AGENTMODIFYUI.JAVA

public class AgentModifyUI extends javax.swing.JFrame {

public AgentModifyUI() {

initComponents();

RROBOSYS Insurance Smart Agent Page 131


BCA-054701683 CS-76 Report

private void modifyRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt1=con.createStatement();

String ag_id= (String) ag_idCb.getSelectedItem();

String pass = passTf.getText();

String city =cityTf.getText();

String email =emailTf.getText();

long phone = Long.parseLong(phoneTf.getText());

String address = addressTf.getText();

String dob = dobTf.getText();

String account = accountTf.getText();

String bank = bankTf.getText();

String query="Update agent set pass='"+pass+"', city ='"+city+"', phone ="

+phone+", acc_no ="+account+", dob ='"+dob+"', email ='"+email+"', bank ='"+bank+"',


address ='"

+address+"' where ag_id="+ag_id+";";

int rs=stmt1.executeUpdate(query);

stmt1.close();

con.close();

JOptionPane.showMessageDialog(this,"Record Updated sucessfully");

ag_idCb.setSelectedIndex(0);

userTf.setText("");

passTf.setText("");

nameTf.setText("");

addressTf.setText("");

RROBOSYS Insurance Smart Agent Page 132


BCA-054701683 CS-76 Report

cityTf.setText("");

phoneTf.setText("");

insurerTf.setText("");

emailTf.setText("");

dobTf.setText("");

accountTf.setText("");

bankTf.setText("");

ag_idCb.setEnabled(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

private void deleteBtnActionPerformed(java.awt.event.ActionEvent evt) {

int conf=JOptionPane.showConfirmDialog(this, "Are you sure to delete Record?");

if(conf==JOptionPane.YES_OPTION){

try{

RROBOSYS Insurance Smart Agent Page 133


BCA-054701683 CS-76 Report

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String agent= (String) ag_idCb.getSelectedItem();

int ag_id = Integer.parseInt(agent);

int rs=stmt.executeUpdate("delete from agent where ag_id="+ag_id+";");

ag_idCb.setSelectedIndex(0);

userTf.setText("");

passTf.setText("");

nameTf.setText("");

insurerTf.setText("");

addressTf.setText("");

cityTf.setText("");

phoneTf.setText("");

emailTf.setText("");

dobTf.setText("");

accountTf.setText("");

bankTf.setText("");

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void formWindowOpened(java.awt.event.WindowEvent evt) {

RROBOSYS Insurance Smart Agent Page 134


BCA-054701683 CS-76 Report

DefaultComboBoxModel combo1=(DefaultComboBoxModel)ag_idCb.getModel();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select ag_id from agent;");

while(rs.next()){

String name=rs.getString(1);

combo1.addElement(name);

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void delBtnActionPerformed(java.awt.event.ActionEvent evt) {

deleteBtn.doClick();

private void viewBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

RROBOSYS Insurance Smart Agent Page 135


BCA-054701683 CS-76 Report

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String ag_id= (String) ag_idCb.getSelectedItem();

ResultSet rs=stmt.executeQuery("select * from agent where ag_id='"+ag_id+"';");

rs.first();

String user=rs.getString(2);

userTf.setText(user);

String pass=rs.getString(3);

passTf.setText(pass);

int in_id=rs.getInt(4);

String name=rs.getString(5);

nameTf.setText(name);

String address=rs.getString(6);

addressTf.setText(address);

String city=rs.getString(7);

cityTf.setText(city);

String phone=rs.getString(8);

phoneTf.setText(phone);

String email=rs.getString(9);

emailTf.setText(email);

String dob=rs.getString(10);

dobTf.setText(dob);

String account=rs.getString(11);

accountTf.setText(account);

String bank=rs.getString(12);

bankTf.setText(bank);

rs.close();

RROBOSYS Insurance Smart Agent Page 136


BCA-054701683 CS-76 Report

ResultSet rs1=stmt.executeQuery("select name from insurer where in_id="+in_id+";");

rs1.first();

String insurer=rs1.getString(1);

insurerTf.setText(insurer);

rs1.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

modifyRecBtn.setEnabled(true);

deleteBtn.setEnabled(true);

ag_idCb.setEnabled(false);

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new AgentModifyUI().setVisible(true);

});

RROBOSYS Insurance Smart Agent Page 137


BCA-054701683 CS-76 Report

CERTIFICATEUI.JAVA

public class CertificateUI extends javax.swing.JFrame {

public CertificateUI() {

initComponents();

private void addRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab=(DefaultTableModel)detailTb.getModel();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String cus = (String) customerCb.getSelectedItem();

customerLbl.setText(cus);

String query="Select policy.policy_no, plan.name, premium,pr_id from premium, policy,


proposal,customer,plan "

+ " where proposal.cus_id=customer.cus_id and premium.policy_no=policy.policy_no


and "

+ "proposal.pl_id=plan.pl_id and customer.name ='"+cus+"';";

ResultSet rs=stmt.executeQuery(query);

int total=0;

while(rs.next()){

String policy = rs.getString(1);

String plan = rs.getString(2);

String pr_id = rs.getString(4);

int premium = rs.getInt(3);

total = total +premium;

RROBOSYS Insurance Smart Agent Page 138


BCA-054701683 CS-76 Report

tab.addRow(new Object[]{pr_id,policy,plan,premium});

totalLbl.setText(""+total);

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

private void formWindowOpened(java.awt.event.WindowEvent evt) {

DefaultComboBoxModel combo1=(DefaultComboBoxModel)customerCb.getModel();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select name from customer;");

while(rs.next()){

String cus = rs.getString(1);

customerCb.addItem(cus);

RROBOSYS Insurance Smart Agent Page 139


BCA-054701683 CS-76 Report

ResultSet rs1=stmt.executeQuery("select cer_id from certificate;");

rs1.last();

int cer_id=rs1.getInt(1)+1;

rs.close();

stmt.close();

con.close();

cerTf.setText(""+cer_id);

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

CUSTOMERADD.JAVA

public class CustomerAddUI extends javax.swing.JFrame {

public CustomerAddUI() {

initComponents();

private void formWindowOpened(java.awt.event.WindowEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

RROBOSYS Insurance Smart Agent Page 140


BCA-054701683 CS-76 Report

ResultSet rs=stmt.executeQuery("select cus_id from customer;");

rs.last();

int cus_id=rs.getInt(1)+1;

rs.close();

stmt.close();

con.close();

cus_idTf.setText(""+cus_id);

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {

addRecBtn.doClick();

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

private void resetBtnActionPerformed(java.awt.event.ActionEvent evt) {

nameTf.setText("");

addressTf.setText("");

fatherTf.setText("");

cityTf.setText("");

phoneTf.setText("");

emailTf.setText("");

RROBOSYS Insurance Smart Agent Page 141


BCA-054701683 CS-76 Report

dobTf.setText("");

incomeTf.setText("");

accountTf.setText("");

bankTf.setText("");

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void addRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

int cus_id = Integer.parseInt(cus_idTf.getText());

String father = fatherTf.getText();

String name = nameTf.getText();

String city =cityTf.getText();

String email =emailTf.getText();

long phone = Long.parseLong(phoneTf.getText());

String address = addressTf.getText();

String dob = dobTf.getText();

String account = accountTf.getText();

String income = incomeTf.getText();

String bank = bankTf.getText();

int ag_code=ISA.code;

RROBOSYS Insurance Smart Agent Page 142


BCA-054701683 CS-76 Report

if(ISA.code==0){

ag_code=1;

String query="Insert into customer


values("+cus_id+",'"+name+"','"+father+"','"+dob+"','"+address+"','"

+city+"',"+phone+",'"+email+"',"+income+","+account+",'"+bank+"','Alive',"+ag_code+");";

int rs=stmt.executeUpdate(query);

stmt.close();

con.close();

resetBtn.doClick();cus_id++;

cus_idTf.setText(""+cus_id);

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new CustomerAddUI().setVisible(true);

});

CUSTOMERMODIFYI.JAVA

public class CustomerModifyUI extends javax.swing.JFrame {

RROBOSYS Insurance Smart Agent Page 143


BCA-054701683 CS-76 Report

public CustomerModifyUI() {

initComponents();

private void modifyRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt1=con.createStatement();

int cus_id = Integer.parseInt(cus_idTf.getText());

String father = fatherTf.getText();

String city =cityTf.getText();

String email =emailTf.getText();

long phone = Long.parseLong(phoneTf.getText());

String address = addressTf.getText();

String dob = dobTf.getText();

String income = incomeTf.getText();

String account = accountTf.getText();

String bank = bankTf.getText();

String query="Update customer set f_name='"+father+"', city ='"+city+"', phone ="

+phone+", email ='"+email+"', address ='"+address+"', dob ='"+dob+"', account


="+account+

", income ="+income+", bank ='"+bank+"' where cus_id="+cus_id+";";

int rs=stmt1.executeUpdate(query);

stmt1.close();

con.close();

JOptionPane.showMessageDialog(this,"Record Updated sucessfully");

fatherTf.setText("");

RROBOSYS Insurance Smart Agent Page 144


BCA-054701683 CS-76 Report

addressTf.setText("");

cityTf.setText("");

dobTf.setText("");

phoneTf.setText("");

emailTf.setText("");

incomeTf.setText("");

accountTf.setText("");

bankTf.setText("");

deathTf.setText("");

nameCb.setEnabled(true);

viewBtn.setEnabled(true);

modifyRecBtn.setEnabled(false);

deleteBtn.setEnabled(false);

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

RROBOSYS Insurance Smart Agent Page 145


BCA-054701683 CS-76 Report

private void deleteBtnActionPerformed(java.awt.event.ActionEvent evt) {

int conf=JOptionPane.showConfirmDialog(this, "Are you sure to delete Record?");

if(conf==JOptionPane.YES_OPTION){

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

int cus_id = Integer.parseInt(cus_idTf.getText());

int rs=stmt.executeUpdate("delete from customer where cus_id="+cus_id+";");

cus_idTf.setText("");

fatherTf.setText("");

addressTf.setText("");

cityTf.setText("");

dobTf.setText("");

phoneTf.setText("");

emailTf.setText("");

incomeTf.setText("");

accountTf.setText("");

bankTf.setText("");

deathTf.setText("");

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

RROBOSYS Insurance Smart Agent Page 146


BCA-054701683 CS-76 Report

private void formWindowOpened(java.awt.event.WindowEvent evt) {

DefaultComboBoxModel combo1=(DefaultComboBoxModel)nameCb.getModel();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select name from Customer;");

while(rs.next()){

String name=rs.getString(1);

combo1.addElement(name);

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void delBtnActionPerformed(java.awt.event.ActionEvent evt) {

deleteBtn.doClick();

RROBOSYS Insurance Smart Agent Page 147


BCA-054701683 CS-76 Report

private void viewBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String name = (String) nameCb.getSelectedItem();

nameCb.setEnabled(false);

String query="Select * from customer where name='"+name+"';";

ResultSet rs=stmt.executeQuery(query);

rs.first();

String cus_id=rs.getString(1);

String father=rs.getString(3);

String dob=rs.getString(4);

String address=rs.getString(5);

String city=rs.getString(6);

String phone=rs.getString(7);

String email=rs.getString(8);

String income=rs.getString(9);

String account=rs.getString(10);

String bank=rs.getString(11);

String death=rs.getString(12);

cus_idTf.setText(cus_id);

fatherTf.setText(father);

addressTf.setText(address);

cityTf.setText(city);

dobTf.setText(dob);

RROBOSYS Insurance Smart Agent Page 148


BCA-054701683 CS-76 Report

phoneTf.setText(phone);

emailTf.setText(email);

incomeTf.setText(income);

accountTf.setText(account);

bankTf.setText(bank);

deathTf.setText(death);

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

modifyRecBtn.setEnabled(true);

deleteBtn.setEnabled(true);

deadBtn.setEnabled(true);

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new CustomerModifyUI().setVisible(true);

});

RROBOSYS Insurance Smart Agent Page 149


BCA-054701683 CS-76 Report

//

INSURERADDUI.JAVA

public class InsurerAddUI extends javax.swing.JFrame {

public InsurerAddUI() {

initComponents();

private void addRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

int id = Integer.parseInt(in_idTf.getText());

String name = nameTf.getText();

String type = (String) typeCb.getSelectedItem();

String city =cityTf.getText();

long phone = Long.parseLong(phoneTf.getText());

String email = emailTf.getText();

String website = websiteTf.getText();

String query="Insert into Insurer values("+id+",'"+name+"','"+type+"','"

+city+"',"+phone+",'"+email+"','"+website+"');";

int rs=stmt.executeUpdate(query);

stmt.close();

con.close();

resetBtn.doClick();id++;

in_idTf.setText(""+id);

RROBOSYS Insurance Smart Agent Page 150


BCA-054701683 CS-76 Report

catch(Exception e){

JOptionPane.showMessageDialog(this,"Fill more details");

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

private void resetBtnActionPerformed(java.awt.event.ActionEvent evt) {

nameTf.setText("");

cityTf.setText("");

phoneTf.setText("");

emailTf.setText("");

websiteTf.setText("");

private void formWindowOpened(java.awt.event.WindowEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from Insurer;");

RROBOSYS Insurance Smart Agent Page 151


BCA-054701683 CS-76 Report

rs.last();

int in_id=rs.getInt(1)+1;

rs.close();

stmt.close();

con.close();

in_idTf.setText(""+in_id);

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {

addRecBtn.doClick();

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new InsurerAddUI().setVisible(true);

});

INSURERMODIFYUI.JAVA

RROBOSYS Insurance Smart Agent Page 152


BCA-054701683 CS-76 Report

public class InsurerModifyUI extends javax.swing.JFrame {

public InsurerModifyUI() {

initComponents();

private void modifyRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt1=con.createStatement();

int in_id = Integer.parseInt(in_idTf.getText());

String type = (String) typeCb.getSelectedItem();

String city =cityTf.getText();

long phone = Long.parseLong(phoneTf.getText());

String email = emailTf.getText();

String website = websiteTf.getText();

String query="Update Insurer set type='"+type+"', city ='"+city+"', phone ="

+phone+", email ='"+email+"', website ='"+website+"' where in_id="+in_id+";";

int rs=stmt1.executeUpdate(query);

stmt1.close();

con.close();

JOptionPane.showMessageDialog(this,"Record Updated sucessfully");

cityTf.setText("");

phoneTf.setText("");

emailTf.setText("");

websiteTf.setText("");

nameCb.setEnabled(true);

RROBOSYS Insurance Smart Agent Page 153


BCA-054701683 CS-76 Report

catch(Exception e){

JOptionPane.showMessageDialog(this,"Error in Connectivity");

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

private void deleteBtnActionPerformed(java.awt.event.ActionEvent evt) {

int conf=JOptionPane.showConfirmDialog(this, "Are you sure to delete Record?");

if(conf==JOptionPane.YES_OPTION){

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

int in_id = Integer.parseInt(in_idTf.getText());

int rs=stmt.executeUpdate("delete from insurer where in_id="+in_id+";");

in_idTf.setText("");

cityTf.setText("");

phoneTf.setText("");

RROBOSYS Insurance Smart Agent Page 154


BCA-054701683 CS-76 Report

emailTf.setText("");

websiteTf.setText("");

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void formWindowOpened(java.awt.event.WindowEvent evt) {

DefaultComboBoxModel combo1=(DefaultComboBoxModel)nameCb.getModel();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select name from Insurer;");

while(rs.next()){

String name=rs.getString(1);

combo1.addElement(name);

rs.close();

stmt.close();

con.close();

RROBOSYS Insurance Smart Agent Page 155


BCA-054701683 CS-76 Report

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void delBtnActionPerformed(java.awt.event.ActionEvent evt) {

deleteBtn.doClick();

private void viewBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String name = (String) nameCb.getSelectedItem();

nameCb.setEnabled(false);

String query="Select * from insurer where name='"+name+"';";

ResultSet rs=stmt.executeQuery(query);

rs.first();

String in_id=rs.getString(1);

String type=rs.getString(3);

String city=rs.getString(4);

String phone=rs.getString(5);

String email=rs.getString(6);

String website=rs.getString(7);

in_idTf.setText(in_id);

typeCb.setSelectedItem(type);

RROBOSYS Insurance Smart Agent Page 156


BCA-054701683 CS-76 Report

phoneTf.setText(phone);

cityTf.setText(city);

emailTf.setText(email);

websiteTf.setText(website);

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

modifyRecBtn.setEnabled(true);

deleteBtn.setEnabled(true);

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new InsurerModifyUI().setVisible(true);

});

PLANADDUI.JAVA

public class PlanAddUI extends javax.swing.JFrame {

RROBOSYS Insurance Smart Agent Page 157


BCA-054701683 CS-76 Report

public PlanAddUI() {

initComponents();

private void addRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

int pl_id=Integer.parseInt(pl_idTf.getText());

String insurer=(String) insurerCb.getSelectedItem();

ResultSet rs = stmt.executeQuery("Select in_id from insurer where name='"+insurer+"';");

rs.first();

int in_id = rs.getInt(1);

rs.close();

String name=nameTf.getText();

String table=tableTf.getText();

String type=(String) typeCb.getSelectedItem();

long SA=Long.parseLong(minSATf.getText());

int term=Integer.parseInt(minTermTf.getText());

int age=Integer.parseInt(minAgeTf.getText());

String tax=taxTf.getText();

long maturity=Long.parseLong(maturityTf.getText());

int comm=Integer.parseInt(commTf.getText());

int ext=Integer.parseInt(extTermTf.getText());

int surr=Integer.parseInt(surrenderTf.getText());

String benefit=benefitTf.getText();

while(age > 18 || term > 40){

RROBOSYS Insurance Smart Agent Page 158


BCA-054701683 CS-76 Report

JOptionPane.showMessageDialog(null,"Fill age and term of plan correctly");

minTermTf.setText("");

minAgeTf.setText("");

String query="Insert into plan


values("+pl_id+","+in_id+",'"+name+"','"+table+"','"+type+"',"

+SA+","+term+","+age+",'"+tax+"',"+maturity+","+comm+","+ext+","+surr+",'"+benefit+"');";

int rs1=stmt.executeUpdate(query);

pl_id++;

pl_idTf.setText(""+pl_id);

con.close();

resetBtn.doClick();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

private void resetBtnActionPerformed(java.awt.event.ActionEvent evt) {

RROBOSYS Insurance Smart Agent Page 159


BCA-054701683 CS-76 Report

nameTf.setText("");

tableTf.setText("");

maturityTf.setText("");

commTf.setText("");

extTermTf.setText("");

surrenderTf.setText("");

benefitTf.setText("");

minSATf.setText("");

minTermTf.setText("");

minAgeTf.setText("");

taxTf.setText("");

private void formWindowOpened(java.awt.event.WindowEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select pl_id from Plan;");

rs.last();

int pl_id=rs.getInt(1)+1;

pl_idTf.setText(""+pl_id);

DefaultComboBoxModel combo1=(DefaultComboBoxModel)insurerCb.getModel();

ResultSet rs1=stmt.executeQuery("select name from insurer;");

while(rs1.next()){

String name=rs1.getString(1);

combo1.addElement(name);

RROBOSYS Insurance Smart Agent Page 160


BCA-054701683 CS-76 Report

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {

addRecBtn.doClick();

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new PlanAddUI().setVisible(true);

});

PLANMODIFYUI.JAVA

public class PlanModifyUI extends javax.swing.JFrame {

RROBOSYS Insurance Smart Agent Page 161


BCA-054701683 CS-76 Report

public PlanModifyUI() {

initComponents();

private void modifyRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

int pl_id=Integer.parseInt(pl_idTf.getText());

String name=(String) nameCb.getSelectedItem();

String insurer=insurerTf.getText();

ResultSet rs = stmt.executeQuery("Select in_id from insurer where


name='"+insurer+"';");

rs.first();

int in_id = rs.getInt(1);

rs.close();

String table=tableTf.getText();

String type=(String) typeCb.getSelectedItem();

long SA=Long.parseLong(minSATf.getText());

int term=Integer.parseInt(minTermTf.getText());

int age=Integer.parseInt(minAgeTf.getText());

String tax=taxTf.getText();

long maturity=Long.parseLong(maturityTf.getText());

int comm=Integer.parseInt(commTf.getText());

int ext=Integer.parseInt(extTermTf.getText());

int surr=Integer.parseInt(surrenderTf.getText());

String benefit=benefitTf.getText();

String query="Update plan set table_no='"+table+"',type='"+type+"', min_SA="

RROBOSYS Insurance Smart Agent Page 162


BCA-054701683 CS-76 Report

+SA+",min_term="+term+",min_age="+age+",tax='"+tax+"',maturity="+maturity+",comm="+co
mm+

",ext_term="+ext+",surr_factor="+surr+",benefit='"+benefit+"'where pl_id="+pl_id+";";

int rs1=stmt.executeUpdate(query);

stmt.close();

con.close();

JOptionPane.showMessageDialog(this,"Record Updated sucessfully");

nameCb.setEnabled(true);

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

private void deleteBtnActionPerformed(java.awt.event.ActionEvent evt) {

int conf=JOptionPane.showConfirmDialog(this, "Are you sure to delete Record?");

if(conf==JOptionPane.YES_OPTION){

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

RROBOSYS Insurance Smart Agent Page 163


BCA-054701683 CS-76 Report

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

int pl_id = Integer.parseInt(pl_idTf.getText());

int rs=stmt.executeUpdate("delete from plan where pl_id="+pl_id+";");

pl_idTf.setText("");

insurerTf.setText("");

tableTf.setText("");

maturityTf.setText("");

commTf.setText("");

extTermTf.setText("");

surrenderTf.setText("");

benefitTf.setText("");

minSATf.setText("");

minTermTf.setText("");

minAgeTf.setText("");

taxTf.setText("");

viewBtn.setEnabled(false);

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void formWindowOpened(java.awt.event.WindowEvent evt) {

DefaultComboBoxModel combo1=(DefaultComboBoxModel)nameCb.getModel();

RROBOSYS Insurance Smart Agent Page 164


BCA-054701683 CS-76 Report

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select name from plan;");

while(rs.next()){

String name=rs.getString(1);

combo1.addElement(name);

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void delBtnActionPerformed(java.awt.event.ActionEvent evt) {

deleteBtn.doClick();

private void viewBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

RROBOSYS Insurance Smart Agent Page 165


BCA-054701683 CS-76 Report

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String plan= (String) nameCb.getSelectedItem();

ResultSet rs=stmt.executeQuery("select * from plan where name='"+plan+"';");

rs.first();

int pl_id=rs.getInt(1);

pl_idTf.setText(""+pl_id);

String table=rs.getString(4);

tableTf.setText(table);

String type=rs.getString(5);

typeCb.setSelectedItem(type);

int SA=rs.getInt(6);

minSATf.setText(""+SA);

int term=rs.getInt(7);

minTermTf.setText(""+term);

int age=rs.getInt(8);

minAgeTf.setText(""+age);

String tax=rs.getString(9);

taxTf.setText(tax);

int maturity=rs.getInt(10);

maturityTf.setText(""+maturity);

int comm=rs.getInt(11);

commTf.setText(""+comm);

int ext=rs.getInt(12);

extTermTf.setText(""+ext);

int surr=rs.getInt(13);

surrenderTf.setText(""+surr);

String benefit=rs.getString(14);

RROBOSYS Insurance Smart Agent Page 166


BCA-054701683 CS-76 Report

benefitTf.setText(benefit);

int in_id=rs.getInt(2);

rs.close();

ResultSet rs1=stmt.executeQuery("select name from insurer where in_id="+in_id+";");

rs1.first();

String insurer=rs1.getString(1);

insurerTf.setText(insurer);

rs1.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

modifyRecBtn.setEnabled(true);

deleteBtn.setEnabled(true);

nameCb.setEnabled(false);

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new PlanModifyUI().setVisible(true);

}); }

RROBOSYS Insurance Smart Agent Page 167


BCA-054701683 CS-76 Report

POLICYADDUI.JAVA

public class PolicyAddUI extends javax.swing.JFrame {

public PolicyAddUI() {

initComponents();

private void addRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String policy = policy_noTf.getText();

String term = termTf.getText();

String prop_id = (String) propCb.getSelectedItem();

int premium = Integer.parseInt(premiumTf.getText());

String com_date =com_dateTf.getText();

String query="Insert into Policy values("+policy+","+prop_id+","+premium+",'"

+com_date+"',date_add('"+com_date+"', interval "+term+"


YEAR),'"+com_date+"','Active');";

int rs=stmt.executeUpdate(query);

ResultSet rs1=stmt.executeQuery("Select pr_id from premium;");

rs1.last();

int pr_id = rs1.getInt(1)+1;

int rs2=stmt.executeUpdate("Insert into Premium


values("+pr_id+","+policy+",null,'"+com_date+"','"+com_date+"',null);");

ResultSet rs3=stmt.executeQuery("Select comm from policy,proposal, plan where


policy.prop_id=proposal.prop_id "

+ "and proposal.pl_id=plan.pl_id and policy.policy_no="+policy+";");

rs3.first();

RROBOSYS Insurance Smart Agent Page 168


BCA-054701683 CS-76 Report

int comm = rs3.getInt(1);

ResultSet rs5=stmt.executeQuery("Select comm_id from commission;");

rs5.last();

int comm_id = rs5.getInt(1)+1;

float commission = comm*premium/100;

int rs4=stmt.executeUpdate("Insert into commission


values("+comm_id+","+pr_id+","+commission+",null);");

stmt.close();

con.close();

resetBtn.doClick();

JOptionPane.showMessageDialog(null, "Policy Added Succesfful");

dispose();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

private void resetBtnActionPerformed(java.awt.event.ActionEvent evt) {

com_dateTf.setText("");

premiumTf.setText("");

RROBOSYS Insurance Smart Agent Page 169


BCA-054701683 CS-76 Report

private void formWindowOpened(java.awt.event.WindowEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select prop_id from proposal where


proposal.status='Processing';");

while(rs.next()){

String prop_id=rs.getString(1);

propCb.addItem(prop_id);

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {

addRecBtn.doClick();

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

RROBOSYS Insurance Smart Agent Page 170


BCA-054701683 CS-76 Report

PrintUtilities.printComponent(this);

private void viewBtnActionPerformed(java.awt.event.ActionEvent evt) {

try {

Class.forName("java.sql.Driver");

Connection con = (Connection)


DriverManager.getConnection("jdbc:mysql://localhost/isa", "root", "");

Statement stmt = con.createStatement();

String prop_id= (String) propCb.getSelectedItem();

propCb.setEnabled(false);

String query = "Select customer.name,


customer.f_name,plan.name,SA,proposal.maturity"

+ ", proposal.term, mode,rider from proposal, customer, plan where


proposal.pl_id=plan.pl_id and "

+ "proposal.cus_id=customer.cus_id and prop_id="+prop_id+";";

ResultSet rs = stmt.executeQuery(query);

rs.first();

String cus = rs.getString(1);

String fname = rs.getString(2);

String plan = rs.getString(3);

String SA = rs.getString(4);

String maturity = rs.getString(5);

String term = rs.getString(6);

String mode = rs.getString(7);

String rider = rs.getString(8);

nameTf.setText(cus);

fnameTf.setText(fname);

planTf.setText(plan);

RROBOSYS Insurance Smart Agent Page 171


BCA-054701683 CS-76 Report

modeTf.setText(mode);

termTf.setText(term);

SATf.setText(SA);

maturityTf.setText(maturity);

riderTf.setText(rider);

stmt.close();

con.close();

} catch (Exception e) {

JOptionPane.showMessageDialog(this, e.getMessage());

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new PolicyAddUI().setVisible(true);

});

POLICYMODIFYUI.JAVA

public class PolicyModifyUI extends javax.swing.JFrame {

String surr="";

public PolicyModifyUI() {

initComponents();

private void formWindowOpened(java.awt.event.WindowEvent evt) {

DefaultComboBoxModel combo1=(DefaultComboBoxModel)policyCb.getModel();

DefaultComboBoxModel combo2=(DefaultComboBoxModel)planCb.getModel();

try{

RROBOSYS Insurance Smart Agent Page 172


BCA-054701683 CS-76 Report

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select policy_no from Policy;");

while(rs.next()){

String name=rs.getString(1);

combo1.addElement(name);

ResultSet rs1=stmt.executeQuery("select name from Plan;");

while(rs1.next()){

String name=rs1.getString(1);

combo2.addElement(name);

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

private void com_dateTfActionPerformed(java.awt.event.ActionEvent evt) {

RROBOSYS Insurance Smart Agent Page 173


BCA-054701683 CS-76 Report

// TODO add your handling code here:

private void viewBtnActionPerformed(java.awt.event.ActionEvent evt) {

try {

Class.forName("java.sql.Driver");

Connection con = (Connection)


DriverManager.getConnection("jdbc:mysql://localhost/isa", "root", "");

Statement stmt = con.createStatement();

String policy_no= (String) policyCb.getSelectedItem();

surr=policy_no;

policyCb.setEnabled(false);

String query = "Select customer.name,


customer.f_name,plan.name,SA,proposal.maturity"

+ ", proposal.term, mode,rider,premium,com_date,mat_date,lpd,policy.status from


proposal, "

+ "customer, plan, policy where proposal.pl_id=plan.pl_id and "

+ "proposal.cus_id=customer.cus_id and policy.status!='Surrendered' and


policy_no="+policy_no+";";

ResultSet rs = stmt.executeQuery(query);

rs.first();

String cus = rs.getString(1);

String fname = rs.getString(2);

String plan = rs.getString(3);

String SA = rs.getString(4);

String maturity = rs.getString(5);

String term = rs.getString(6);

String mode = rs.getString(7);

String rider = rs.getString(8);

String premium = rs.getString(9);

RROBOSYS Insurance Smart Agent Page 174


BCA-054701683 CS-76 Report

String com_date = rs.getString(10);

String mat_date = rs.getString(11);

String lpd = rs.getString(12);

String status = rs.getString(13);

planCb.setSelectedItem(plan);

nameTf.setText(cus);

fnameTf.setText(fname);

modeTf.setText(mode);

termTf.setText(term);

SATf.setText(SA);

maturityTf.setText(maturity);

riderTf.setText(rider);

premiumTf.setText(premium);

com_dateTf.setText(com_date);

mat_dateTf.setText(mat_date);

lpddateTf.setText(lpd);

statusTf.setText(status);

if(status.equalsIgnoreCase("Lapsed")){

reviveBtn.setEnabled(true);

stmt.close();

con.close();

catch (Exception e) {

JOptionPane.showMessageDialog(this, e.getMessage());

surrenderBtn.setEnabled(true);

switchBtn.setEnabled(true);

RROBOSYS Insurance Smart Agent Page 175


BCA-054701683 CS-76 Report

planCb.setEnabled(true);

private void switchBtnActionPerformed(java.awt.event.ActionEvent evt) {

int conf=JOptionPane.showConfirmDialog(this, "Are you sure to switch the plan?");

if(conf==JOptionPane.YES_OPTION){

try{

Class.forName("java.sql.Driver");

Connection con = (Connection)


DriverManager.getConnection("jdbc:mysql://localhost/isa", "root", "");

Statement stmt = con.createStatement();

String plan = (String) planCb.getSelectedItem();

ResultSet rs1=stmt.executeQuery("Select pl_id from plan where name='"+plan+"';");

rs1.first();

int pl_id=rs1.getInt(1);

ResultSet rs2=stmt.executeQuery("Select prop_id from policy where


policy_no="+surr+";");

rs2.first();

int prop_id=rs2.getInt(1);

int rs=stmt.executeUpdate("Update proposal set pl_id="+pl_id+" where


prop_id="+prop_id+";");

JOptionPane.showMessageDialog(null, "Plan Switching Succesfful");

dispose();

catch (Exception e) {

JOptionPane.showMessageDialog(this, e.getMessage());

RROBOSYS Insurance Smart Agent Page 176


BCA-054701683 CS-76 Report

private void planCbActionPerformed(java.awt.event.ActionEvent evt) {

switchBtn.setEnabled(true);

private void surrenderBtnActionPerformed(java.awt.event.ActionEvent evt) {

int conf=JOptionPane.showConfirmDialog(this, "Are you sure to surrender the policy?");

if(conf==JOptionPane.YES_OPTION){

try{

Class.forName("java.sql.Driver");

Connection con = (Connection)


DriverManager.getConnection("jdbc:mysql://localhost/isa", "root", "");

Statement stmt = con.createStatement();

int rs=stmt.executeUpdate("Update policy set status='Surrendered' where


policy_no="+surr+";");

JOptionPane.showMessageDialog(null, "Policy Surrendered Succesfful");

dispose();

catch (Exception e) {

JOptionPane.showMessageDialog(this, e.getMessage());

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

private void reviveBtnActionPerformed(java.awt.event.ActionEvent evt) {

RROBOSYS Insurance Smart Agent Page 177


BCA-054701683 CS-76 Report

try{

Class.forName("java.sql.Driver");

Connection con = (Connection)


DriverManager.getConnection("jdbc:mysql://localhost/isa", "root", "");

Statement stmt = con.createStatement();

ResultSet rs=stmt.executeQuery("Select to_days(lpd),to_days(curdate()),mode from


policy, proposal "

+ " where policy.prop_id=proposal.prop_id and policy_no="+surr+";");

rs.first();

int lpd = rs.getInt(1);

int now = rs.getInt(2),year=(lpd-now)/365,factor=1;

String mode = rs.getString(3);

if(mode.equalsIgnoreCase("Half Yearly")){

factor = 2;

else if(mode.equalsIgnoreCase("Quaterly")){

factor = 4;

else{

factor = 1;

int totalPremium = year*factor;

for(int i=1;i<=totalPremium;i++){

ResultSet rs1=stmt.executeQuery("Select pr_id from premium;");

rs1.last();

int pr_id = rs1.getInt(1)+1;

int rs2=stmt.executeUpdate("Insert into Premium


values("+pr_id+","+surr+",50,curdate(),curdate(),null);");

ResultSet rs3=stmt.executeQuery("Select comm, policy.premium from policy,proposal, plan


where policy.prop_id=proposal.prop_id "

RROBOSYS Insurance Smart Agent Page 178


BCA-054701683 CS-76 Report

+ "and proposal.pl_id=plan.pl_id and policy.policy_no="+surr+";");

rs3.first();

int comm = rs3.getInt(1);

int premium = rs3.getInt(2);

ResultSet rs5=stmt.executeQuery("Select comm_id from commission;");

rs5.last();

int comm_id = rs5.getInt(1)+1;

float commission = comm*premium/100;

int rs4=stmt.executeUpdate("Insert into commission


values("+comm_id+","+pr_id+","+commission+",null);");

int rs6=stmt.executeUpdate("update policy set status='Active' where policy_no


="+surr+";");

JOptionPane.showMessageDialog(null, "Policy Revived Succesfful");

catch (Exception e) {

JOptionPane.showMessageDialog(this, e.getMessage());

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new PolicyModifyUI().setVisible(true);

});

PREMIUMADDUI.JAVA

RROBOSYS Insurance Smart Agent Page 179


BCA-054701683 CS-76 Report

public class PremiumAddUI extends javax.swing.JFrame {

public PremiumAddUI() {

initComponents();

private void addRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con = (Connection)


DriverManager.getConnection("jdbc:mysql://localhost/isa", "root", "");

Statement stmt = con.createStatement();

String policy=(String) policy_noCb.getSelectedItem();

String rec_date=rec_dateTf.getText();

String pr_id=pr_idTf.getText();

int rs2=stmt.executeUpdate("Insert into Premium


values("+pr_id+","+policy+",null,curdate(),'"+rec_date+"',null);");

ResultSet rs3=stmt.executeQuery("Select comm, policy.premium from policy,proposal, plan


where policy.prop_id=proposal.prop_id "

+ "and proposal.pl_id=plan.pl_id and policy.policy_no="+policy+";");

rs3.first();

int comm = rs3.getInt(1);

int premium = rs3.getInt(2);

ResultSet rs5=stmt.executeQuery("Select comm_id from commission;");

rs5.last();

int comm_id = rs5.getInt(1)+1;

float commission = comm*premium/100;

int rs4=stmt.executeUpdate("Insert into commission


values("+comm_id+","+pr_id+","+commission+",null);");

int rs6=stmt.executeUpdate("Update policy set lpd = curdate() where


policy_no="+policy+";");

policy_noCb.setEnabled(true);

RROBOSYS Insurance Smart Agent Page 180


BCA-054701683 CS-76 Report

JOptionPane.showMessageDialog(null, "Premium Deposited Succesfully");

catch (Exception e) {

JOptionPane.showMessageDialog(this, e.getMessage());

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

private void resetBtnActionPerformed(java.awt.event.ActionEvent evt) {

nameTf.setText("");

planTf.setText("");

premiumTf.setText("");

lateTf.setText("");

private void formWindowOpened(java.awt.event.WindowEvent evt) {

DefaultComboBoxModel combo2=(DefaultComboBoxModel)policy_noCb.getModel();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

RROBOSYS Insurance Smart Agent Page 181


BCA-054701683 CS-76 Report

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs1=stmt.executeQuery("Select pr_id from premium;");

rs1.last();

int pr_id = rs1.getInt(1)+1;

pr_idTf.setText(""+pr_id);

ResultSet rs=stmt.executeQuery("Select policy_no from policy;");

while(rs.next()){

String policy=rs.getString(1);

combo2.addElement(policy);

rs1.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {

addRecBtn.doClick();

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

RROBOSYS Insurance Smart Agent Page 182


BCA-054701683 CS-76 Report

private void viewBtnActionPerformed(java.awt.event.ActionEvent evt) {

try {

Class.forName("java.sql.Driver");

Connection con = (Connection)


DriverManager.getConnection("jdbc:mysql://localhost/isa", "root", "");

Statement stmt = con.createStatement();

String policy = (String) policy_noCb.getSelectedItem();

policy_noCb.setEnabled(false);

String query = "Select customer.name, plan.name,premium,curdate() from proposal, "

+ "customer, plan, policy where proposal.pl_id=plan.pl_id and "

+ "proposal.cus_id=customer.cus_id and policy.status='Active' and


policy.policy_no="+policy+";";

ResultSet rs = stmt.executeQuery(query);

rs.first();

String name = rs.getString(1);

String plan = rs.getString(2);

String premium = rs.getString(3);

String date = rs.getString(4);

nameTf.setText(name);

premiumTf.setText(premium);

planTf.setText(plan);

rec_dateTf.setText(date);

stmt.close();

con.close();

catch (Exception e) {

JOptionPane.showMessageDialog(this, e.getMessage());

RROBOSYS Insurance Smart Agent Page 183


BCA-054701683 CS-76 Report

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new PremiumAddUI().setVisible(true);

});

PRINTUTILITIESUI.JAVA

import java.awt.*;

import javax.swing.*;

import java.awt.print.*;

import javax.swing.JOptionPane;

/**

* @author Shrikant R. Singh

*/

public class PrintUtilities implements Printable{

private Component componentToBePrinted;

public static void printComponent(Component c) {

new PrintUtilities(c).print();

public PrintUtilities(Component componentToBePrinted) {

this.componentToBePrinted = componentToBePrinted;

public void print() {

RROBOSYS Insurance Smart Agent Page 184


BCA-054701683 CS-76 Report

PrinterJob printJob = PrinterJob.getPrinterJob();

printJob.setPrintable(this);

if (printJob.printDialog())

try {

printJob.print();

} catch(PrinterException pe) {

JOptionPane.showMessageDialog(null,"Error in Printing");

public int print(Graphics g, PageFormat pageFormat, int pageIndex) {

if (pageIndex > 0) {

return(NO_SUCH_PAGE);

} else {

Graphics2D g2d = (Graphics2D)g;

g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());

disableDoubleBuffering(componentToBePrinted);

componentToBePrinted.paint(g2d);

enableDoubleBuffering(componentToBePrinted);

return(PAGE_EXISTS);

/** The speed and quality of printing suffers dramatically if

* any of the containers have double buffering turned on.

* So this turns if off globally.

* @see enableDoubleBuffering

*/

RROBOSYS Insurance Smart Agent Page 185


BCA-054701683 CS-76 Report

public static void disableDoubleBuffering(Component c) {

RepaintManager currentManager = RepaintManager.currentManager(c);

currentManager.setDoubleBufferingEnabled(false);

/** Re-enables double buffering globally. */

public static void enableDoubleBuffering(Component c) {

RepaintManager currentManager = RepaintManager.currentManager(c);

currentManager.setDoubleBufferingEnabled(true);

PROPOSALADDUI.JAVA

public class ProposalAddUI extends javax.swing.JFrame {

public ProposalAddUI() {

initComponents();

private void addRecBtnActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

int ag_id=ISA.code;

if(ISA.code==0){

ag_id=1;

int prop_id = Integer.parseInt(prop_idTf.getText());

RROBOSYS Insurance Smart Agent Page 186


BCA-054701683 CS-76 Report

String plan = (String) planCb.getSelectedItem();

String cus = (String) customerCb.getSelectedItem();

String nominee = (String) nomineeCb.getSelectedItem();

String mode = (String) modeCb.getSelectedItem();

String rider =riderTf.getText();

long maturity = Long.parseLong(maturityTf.getText());

long SA = Long.parseLong(SATf.getText());

int term = Integer.parseInt(termTf.getText());

ResultSet rs1=stmt.executeQuery("Select min_term, min_SA, pl_id from plan where name


='"+plan+"';");

rs1.first();

int min_term=rs1.getInt(1);

int min_SA=rs1.getInt(2);

int pl_id=rs1.getInt(3);

while(SA<min_SA || term <min_term){

SATf.setText(""+min_SA);

termTf.setText(""+min_term);

JOptionPane.showMessageDialog(null,"Enter SA >= "+min_SA+" and Term >= "+min_term);

ResultSet rs2=stmt.executeQuery("Select cus_id from customer where name ='"+cus+"';");

rs2.first();

int cus_id=rs2.getInt(1);

ResultSet rs3=stmt.executeQuery("Select cus_id from customer where name


='"+nominee+"';");

rs3.first();

int nom_id=rs3.getInt(1);

int conf=JOptionPane.showConfirmDialog(this, "Are you sure to add proposal?");

if(conf==JOptionPane.YES_OPTION){

String query="Insert into proposal values("+prop_id+","+ag_id+","+pl_id+","+cus_id+","

RROBOSYS Insurance Smart Agent Page 187


BCA-054701683 CS-76 Report

+nom_id+",curdate(),"+SA+","+maturity+","+term+",'"+mode+"','"+rider+"','Processing');";

int rs=stmt.executeUpdate(query);

prop_id++;

prop_idTf.setText(""+prop_id);

stmt.close();

con.close();

resetBtn.doClick();

catch(Exception e){

JOptionPane.showMessageDialog(this,"Fill more details");

private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {

dispose();

private void formWindowClosed(java.awt.event.WindowEvent evt) {

private void resetBtnActionPerformed(java.awt.event.ActionEvent evt) {

fnameTf.setText("");

n_fnameTf.setText("");

dobTf.setText("");

n_dobTf.setText("");

RROBOSYS Insurance Smart Agent Page 188


BCA-054701683 CS-76 Report

termTf.setText("");

riderTf.setText("");

SATf.setText("");

maturityTf.setText("");

private void formWindowOpened(java.awt.event.WindowEvent evt) {

DefaultComboBoxModel combo1=(DefaultComboBoxModel)customerCb.getModel();

DefaultComboBoxModel combo2=(DefaultComboBoxModel)planCb.getModel();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select pr_id from premium;");

rs.last();

int prop_id=rs.getInt(1)+1;

prop_idTf.setText(""+prop_id);

rs.close();

ResultSet rs2=stmt.executeQuery("select name from plan;");

while(rs2.next()){

String p = rs2.getString(1);

combo2.addElement(p);

rs2.close();

ResultSet rs1=stmt.executeQuery("select name from customer;");

while(rs1.next()){

String c = rs1.getString(1);

RROBOSYS Insurance Smart Agent Page 189


BCA-054701683 CS-76 Report

combo1.addElement(c);

rs1.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {

addRecBtn.doClick();

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

private void customerCbActionPerformed(java.awt.event.ActionEvent evt) {

DefaultComboBoxModel combo2=(DefaultComboBoxModel)nomineeCb.getModel();

combo2.removeAllElements();

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String cus =(String)customerCb.getSelectedItem();

ResultSet rs=stmt.executeQuery("select f_name, dob from customer where name


='"+cus+"';");

RROBOSYS Insurance Smart Agent Page 190


BCA-054701683 CS-76 Report

rs.first();

fnameTf.setText(rs.getString(1));

dobTf.setText(rs.getString(2));

ResultSet rs1=stmt.executeQuery("select name from customer where name !='"+cus+"';");

while(rs1.next()){

String c = rs1.getString(1);

combo2.addElement(c);

rs1.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void nomineeCbActionPerformed(java.awt.event.ActionEvent evt) {

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String cus =(String)nomineeCb.getSelectedItem();

ResultSet rs=stmt.executeQuery("select f_name, dob from customer where name


='"+cus+"';");

rs.first();

n_fnameTf.setText(rs.getString(1));

n_dobTf.setText(rs.getString(2));

RROBOSYS Insurance Smart Agent Page 191


BCA-054701683 CS-76 Report

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new ProposalAddUI().setVisible(true);

});

VIEWMATUREDUI.JAVA

public class ViewMaturedUI extends javax.swing.JFrame {

public ViewMaturedUI() {

initComponents();

private void printBtnActionPerformed(java.awt.event.ActionEvent evt) {

PrintUtilities.printComponent(this);

private void formWindowOpened(java.awt.event.WindowEvent evt) {

// For displaying Matured Policies

DefaultTableModel tab2=(DefaultTableModel)maturityTbl.getModel();

tab2.getDataVector().removeAllElements();

RROBOSYS Insurance Smart Agent Page 192


BCA-054701683 CS-76 Report

tab2.fireTableDataChanged();

String filter="";

if (ISA.code!=0){

filter ="and agent.ag_id ="+ISA.code;

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String sql1="select policy_no, customer.name, plan.name, "+

"SA, proposal.maturity, mat_date, lpd from agent, plan, customer, proposal, policy "+

"where proposal.ag_id=agent.ag_id and proposal.pl_id=plan.pl_id and policy.prop_id =


proposal.prop_id"

+ " and proposal.cus_id=customer.cus_id and


period_diff(date_format(now(),'%Y%m'),date_format(mat_date,'%Y%m'))>=0 "

+filter+";";

ResultSet rs=stmt.executeQuery(sql1);

while(rs.next()){

int policy=rs.getInt(1);

String pl_name=rs.getString(3);

String cus_name=rs.getString(2);

String mat_date=rs.getString(6);

int SA=rs.getInt(4);

int maturity=rs.getInt(5);

String lpd=rs.getString(7);

tab2.addRow(new Object[]{policy, cus_name, pl_name, SA, maturity, mat_date, lpd});

RROBOSYS Insurance Smart Agent Page 193


BCA-054701683 CS-76 Report

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void searchBtnActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel tab2=(DefaultTableModel)maturityTbl.getModel();

tab2.getDataVector().removeAllElements();

tab2.fireTableDataChanged();

String value=searchTf.getText();

String column=(String) selectCb.getSelectedItem();

String filter="";

if (ISA.code!=0){

filter ="and agent.ag_id ="+ISA.code;

try{

Class.forName("java.sql.Driver");

Connection con=(Connection) DriverManager.getConnection

("jdbc:mysql://localhost/isa","root","");

Statement stmt=con.createStatement();

String sql1="select policy_no, customer.name, plan.name, "+

"SA, proposal.maturity, mat_date, lpd from agent, plan, customer, proposal, policy "+

"where proposal.ag_id=agent.ag_id and proposal.pl_id=plan.pl_id and policy.prop_id =


proposal.prop_id"

RROBOSYS Insurance Smart Agent Page 194


BCA-054701683 CS-76 Report

+ " and proposal.cus_id=customer.cus_id and


period_diff(date_format(now(),'%Y%m'),date_format(mat_date,'%Y%m'))>=0 "

+filter+" and "+column+" like '%"+value+"%' ;";

ResultSet rs=stmt.executeQuery(sql1);

while(rs.next()){

int policy=rs.getInt(1);

String pl_name=rs.getString(3);

String cus_name=rs.getString(2);

String mat_date=rs.getString(6);

int SA=rs.getInt(4);

int maturity=rs.getInt(5);

String lpd=rs.getString(7);

tab2.addRow(new Object[]{policy, cus_name, pl_name, SA, maturity, mat_date, lpd});

rs.close();

stmt.close();

con.close();

catch(Exception e){

JOptionPane.showMessageDialog(this,e.getMessage());

private void searchTfActionPerformed(java.awt.event.ActionEvent evt) {

searchBtn.doClick();

public static void main(String args[]) {

RROBOSYS Insurance Smart Agent Page 195


BCA-054701683 CS-76 Report

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new ViewMaturedUI().setVisible(true);

});

RROBOSYS Insurance Smart Agent Page 196


BCA-054701683 CS-76 Report

7. Testing
7.1 Test Strategies and Techniques

Testing is a important and integral part of SDLC. It ensures the effort of programmer are not

fruitless. As the project undertaken by me is RDBMS, the database integral referentiality enforces

robustness along with superb exception handling of java. Still I have framed many test cases to

ensure the correctness of the program. Unit Testing of modules and function included in these

modules are tested using white box tesing, in which I have all possible input to check all possible

program flow to avoid any inconvience caused to the clients. Integral or System testing have

been done ensure correct functioning and achieving the overall objective of development.

7.2 Test Plan Used

Test Case No TCT-001

Functionality Login without username and password.

Environment Login Form

Procedure

• Click on the login button without filling username, password.

Expected Outcome User cannot logged in and Permission Denied message will be displayed.

Test Case No TCT-002

Functionality Creation of Insurer without filling details

Environment Add Insurer of Insurer Manager

Procedure

RROBOSYS Insurance Smart Agent Page 197


BCA-054701683 CS-76 Report

• Click on Add Insurer of Policy Manager.

• Add Record without filling all the fields.

Expected Outcome An error alert message would be displayed showing that please enter the

details for insurer.

Test Case No TCT-003

Functionality Creation of Plan without Insurer and other detail

Environment Add Plan of Policy Manager

Procedure

• Click on Add Plan of Policy Manager.

• Add Record without filling all the fields.

Expected Outcome An error alert message would be displayed showing that please enter the

details for plan.

Test Case No TCT-004

Functionality Creation of Agent without detail

Environment Add Plan of Agent Manager

Procedure

• Click on Add Plan of Agent Manager.

• Add Record without filling all the fields.

Expected Outcome An error alert message would be displayed showing that please enter the

details for plan.

RROBOSYS Insurance Smart Agent Page 198


BCA-054701683 CS-76 Report

Test Case No TCT-005

Functionality Creation of Customer without detail

Environment Add Plan of Customer Manager

Procedure

• Click on Add Customer of Customer Manager.

• Add Record without filling all the fields.

Expected Outcome An error alert message would be displayed showing that please enter the

details for plan.

Test Case No TCT-006

Functionality Creation of Proposal with SA and term less than

Environment Add Proposal of Policy Manager

Procedure

• Click on Add Proposal of Policy Manager.

• Add Record with SA and term less than given in plan.

Expected Outcome An error alert message would be displayed showing that please enter the Min

SA and minimum term of plan.

Test Case No TCT-007

Functionality Creation of Policy without premium and commencement date

Environment Add Policy of Policy Manager

Procedure

• Click on Add Policy of Policy Manager.

RROBOSYS Insurance Smart Agent Page 199


BCA-054701683 CS-76 Report

• Add Record without filling all the fields.

Expected Outcome An error alert message would be displayed showing that please enter the

details for plan.

RROBOSYS Insurance Smart Agent Page 200


BCA-054701683 CS-76 Report

8. Input & Output Screen


Insurance Smart Agent 2013: Main Form with Login

Insurer Manager

RROBOSYS Insurance Smart Agent Page 201


BCA-054701683 CS-76 Report

Add Insurer

Modify Insurer

RROBOSYS Insurance Smart Agent Page 202


BCA-054701683 CS-76 Report

Print Dialog Box

Plan Manager

RROBOSYS Insurance Smart Agent Page 203


BCA-054701683 CS-76 Report

Add Plan

Modify Plan

RROBOSYS Insurance Smart Agent Page 204


BCA-054701683 CS-76 Report

Agent Manager

Add Agent

RROBOSYS Insurance Smart Agent Page 205


BCA-054701683 CS-76 Report

Modify Agent

Customer Manager

RROBOSYS Insurance Smart Agent Page 206


BCA-054701683 CS-76 Report

Add Customer

Modify Customer

RROBOSYS Insurance Smart Agent Page 207


BCA-054701683 CS-76 Report

Policy Manager

Add Proposal

RROBOSYS Insurance Smart Agent Page 208


BCA-054701683 CS-76 Report

View Matured Policies

Add Policies

RROBOSYS Insurance Smart Agent Page 209


BCA-054701683 CS-76 Report

Modify Policy

Premium Manager

RROBOSYS Insurance Smart Agent Page 210


BCA-054701683 CS-76 Report

Issue Certificate

Add Premium

RROBOSYS Insurance Smart Agent Page 211


BCA-054701683 CS-76 Report

Commission Manager

RROBOSYS Insurance Smart Agent Page 212


BCA-054701683 CS-76 Report

9. Implementation of Security of Software


9.1 Software and Database Security

Security is of prime importance for this application, where various user, who are competitors to

each other’s, provides their important and valuable data to the system. To prevent any

compromise with the security of the system and integrity of data, a multi-level security system is

proposed to be implemented in ISA.

User Authentication is used to check and maintain the user privileges to various pages. User

groups plays an important role in doing so, which is implemented. Database and data security

has been achieved by creating different roles for users. The agents are not authorized to view or

modify another agent’s data.

9.2 Creation of User Profile and access rights

Since in this project, following were the security requirements is being considered:

1. Every user has unique login id and password.

2. Administrator have a right to delete unnecessary information and their data whenever they

wish and with prior notification to the concerned persons.

Keeping above factors in mind, the users are divided into following orders:

1. Admin

2. Agents

The above roles pertaining users will be decided by admin only. There will be one admin account

after successful installation of project. Further the agents can be added as per requirement by

RROBOSYS Insurance Smart Agent Page 213


BCA-054701683 CS-76 Report

the admin. The agents can some share information like customer’s detail and hide other private

information. Even they can view the commission they have earned.

RROBOSYS Insurance Smart Agent Page 214


BCA-054701683 CS-76 Report

10. Limitations of the Project


There is always a limitation of time and resources for any develISAent. It is termed as software

crisis. I have tried my best in developing this solution for above problem. But still aspect are

noteworthy, which I will try to resolve by gaining more knowledge.

1. I could not automate the calculation of premium of a policy. As LCI, one of the major

insurer have given premium in the form tabular information based on age, term and

sum assured. There was no such formula to calculate premium. Premium have to be

entered manually after calculation from tabular data.

2. There could be some inconsistency based on premium deposition, if customer pays

premium himself at some other counter or does not give any information to the

agent. To resolve it, we should get to Insurer data of premium deposit.

RROBOSYS Insurance Smart Agent Page 215


BCA-054701683 CS-76 Report

11. Future Application of the Project


Following modules can be added to enhance the features of the ISA.

• Intranet Technology could be extended to Internet without any modification to support multi

branch facility.

• Payment module – This module can be added to ISA for maintaining the payment from the plans

and payment to the agents.

• SMS Module - This module will be added to the ISA for giving reminder using SMS to policy

holder regarding premium payment or any urgent issue.

RROBOSYS Insurance Smart Agent Page 216


BCA-054701683 CS-76 Report

12. Bibliography
Some important sources for the develISAent of Insurance System proposal are as follows:

1. IRDA Website (www.irda.gov.in )

2. LIC Website ( www.licindia.in )

3. Analysis of Visual Magic Pro, an existing Insurance Software.

4. IGNOU Study Material: System Design and Algorithm (CS-05)

5. IGNOU Study Material: Introduction to DBMS (CS-06)

RROBOSYS Insurance Smart Agent Page 217

Вам также может понравиться