Download - Mojor Project
-
7/30/2019 Mojor Project
1/153
MAJOR PROJECT REPORT
INTERNET BANKINGSubmitted in partial fulfillment of the requirement for
the award of the Diploma of
(COMPUTER SCIENCE & TECHNOLOGY)
Project Guide: Submitted By:
ER. Madhu Dhiman Manju (D850325)
Monika (D850327)
Neelam (D850331)
Nirotma (D850334)
DEPARTMENT OF COMPUTER SCIENCE AND TECHNOLOGY
GOVERNMENT POLYTECHNIC FOR
WOMEN
KANDAGHAT, Distt. SOLAN (H.P.)
Department of Computer Engineering
Jan-June (2011)
-
7/30/2019 Mojor Project
2/153
GOVERNMENT POLYTEHNIC FOR WOMEN
KANDAGHAT, DISTT. SOLAN (H.P)
Department of Computer Engineering
Candidate DeclarationWe hereby declare the work which is being presented in the entitled project
INTERNET BANKING major project of the diploma in Computer science
and engineering and submitted to the department of Computer science and
engineering. H.P. India is an authentic record of our own work carried out
during a period from Jan 2011 to June 2011, under the supervision ofEr.
Madhu Dhiman (lecturer, CSE). We have not submitted then matter presented
in this project for the award of any other degree of this or any other university.
This is to certify that our statement made by the candidate is correct to the best
of my knowledge.
ER. Madhu Dhiman Manju Guleria
(Project guide) Monika Chauhan
Neelam Verma
Nirotma Panwar
OUR SPECIAL THANKS TO
Er. Vinita Arya (Principle of G.P.W Kandaghat)
Er. Madhu Dhiman
-
7/30/2019 Mojor Project
3/153
GOVERNMENT POLYTEHNIC FOR WOMEN
KANDAGHAT, DISTT.SOLAN (H.P)
Department of Computer Engineering
CERTIFICATE
This is certify that this project report titled INTERNET
BANKING submitted by Manju , Monika , Neelam & Nirotma in
the partial fulfillment of the requirement for the award of the Diploma
in computer engineering is a bonofide record of the work done by
them at the GPW campus, kandaghat from 17th Jan to 20June, 2011
under our supervision.
(ER. Madhu Dhiman) (Er. Vinita Arya)
(project guide) Principal
Deptt. Of CSE
GPW Kandaghat, Distt. Solan (H.P)
-
7/30/2019 Mojor Project
4/153
ACKNOWLEDGEMENT
Making a project is a bear of an understanding, not only for developer but alsofor those around him.
Great acknowledgement is extended to all the people who make this project
possible with their enthusiastic support and encouragement.
First and foremost, we should like to express our profound graduate and sincere
acknowledgement to polytechnic (W), Kandaghat who has been a source ofperpetual inspiration to us, gently guiding and paying our way towards a bright
carrier, throughout our diploma.
We are fortunate enough to have:
Er. Madhu Dhiman
project guide
She was ever willing to giving support and encouragement. It was only through
her care, support and help that we were able to overcome initial hiccups during
our early days in the project work.
The entire experience of our project at this institute has not only increased ourknowledge and potential but also inculcated in us the desire to learn more and
higher.
We are grateful to Er. Vinita Arya principle of Govt. Polytechnic (W)
Kandaghat for giving us opportunity to work in such a project.
Thank for all your advice and help even if we dont say it enough, we appreciate
it.
Government Polytechnic for Women
Kandaghat Distt. Solan (H.P.)
Department of Computer Engineering
-
7/30/2019 Mojor Project
5/153
INTRODUCTION TO ORGANIZATION
The Government polytechnic for Women Kandaghat is the only
polytechnic in this state for women. This institute was
established in the year 1984 by the government of H.P. The
basic theme was to improve skill and to increase the po lytechnic
are accredited by ALL INDIA COUNCIL OF TECHNICAL
EDUCATION (AICTE) and PHARMACY COUNCIL OF INDIA
(PCI).
The courses of diploma in Computer Engineering and
eltx.Engg.are also NBA accredited. Takniki shiksha Board
Dharamshala conducts the annual and semester examination and
pre-admission test (PAT) to the polytechnic.
This polytechnic has undergone a massive modernization and
computerization. The latest computers and other equipments are
installed under Broadband Aided Project.
Presently the institute offers the following courses which are as
follows:
1. Computer Engg.
2. Eltx. Engg.
3. Pharmacy
-
7/30/2019 Mojor Project
6/153
PREFACE
It has been a great experience work together here in our college under
the guidance of brilliant minds and highly qualified people here in
govt. polytechnic college for women, who have made enormous
efforts to make all the jobs under taken here successfully alwayscontributed significantly to the development and progress their minds.
It has been due to their astounding efforts that we are today enjoying
all sorts of luxuries that computer world has provided with us.
During our working on this project we try our level best to keep
things understandable.
-
7/30/2019 Mojor Project
7/153
INDEX
-
7/30/2019 Mojor Project
8/153
INTRODUCTION
INTRODUCTION
-
7/30/2019 Mojor Project
9/153
-
7/30/2019 Mojor Project
10/153
FEASIBILITYSTUDY
FEASIBILITY STUDYFeasibility study is a preliminary study undertaken to determine and document a
projects viability. The term feasibility study is also used to refer to the resultingdocument. These results of this study are use to make a decision whether to
-
7/30/2019 Mojor Project
11/153
proceed with the project, or table it. If it indeed leads to a project being
approved, it will-before the real work of the proposed project starts-be used to
ascertain the likelihood of the projects success. It is an analysis of possible
alternative solutions to a problem and a recommendation on the best
alternatices.
EXPLANATION
1.1NEED ANALYSIS1.2TECHNICAL FEASIBILITY STUDY1.3CULTURAL FEASIBILITY STUDY1.4LEGAL FEASIBILITY STUDY1.5MARKETING FEASIBILITY STUDY
EXPLANATION
Feasibility study could be used to test a proposal for new system, whichcould be used because:
The current system may no longer carry its purpose Technological advancement have rendered the current system obsolete The business is expending, allowing it to cope with extra work load Customers are complaining about the speed & quality of the work the
business provide
A feasibility study should examine three main areas:
Market issues Technical & organization requirements Financial overviews
Within a feasibility study seven areas must be reviewed, including those of
needs analysis, economics, technical, schedule, organizational, cultural & legal.
NEED ANALYSIS
A need analysis should be the first undertaking of a feasibility study as it clearly
defines the project outline and the clients requirements. Once these question
have been answered the person/s undertaking the feasibility study will haveoutline the projects need definitions.
-
7/30/2019 Mojor Project
12/153
The following questions need to be asked to define the project need definition:
What is the end deliverable?
What purpose will it serve?
What are the environmental effects??
What are the quality requirements?
What is the minimal quality requirements allowed?
What sustainability can we expect?
What carryover work can we expect?
What are the penalty clauses?
TECHNICAL FEASIBILITY STUDY
This involves questions such as whether the technologies needed for the system
exists, how difficult it will be to built, and whether the film has enough are
experience using that technology. The assessment is based on an outline design
of system requirement in term of input, output, fields, program and procedures.
This can be qualified in terms of data, trends frequency of updating etc. in orderto give an introduction to the technical system.
SCHEDULE FEASIBILITY STUDY
This involves questions such as how much time is available to built the new
system, when it can be built, whether it interferes with normal business
operation, number of resources required, dependencies etc.
CULTURAL FEASIBILITY STUDY
In this stage, the projects alternatives are evaluated for their impact on the local
and general cultural. For e.g. Environment factors need to be considered.
LEGAL FEASIBILITY STUDY
-
7/30/2019 Mojor Project
13/153
Not necessarily last, but all projects must face legal scrutiny. When an
organization has a legal council on staff or on retainer, such reviews are
typically standards.
MARKETING FEASIBILITY STUDY
This will include analysis of single and multi-dimensional market forces that
could affect the commercial, along with the company that is caring out the
feasibility achieving more and more reputation as they have carried out safety
checks which allow the system to run appropriately.
Economical Feasibility: Establishing the cost effectiveness of theproposed system that is if the benefits do not outweigh the costs then it is
not worth going ahead. Legal Feasibility: Determines whether the proposed system conflicts
with legal requirements, e.g. The Data Protection Act.
Operational Feasibility: Do the current work practices and proceduressupport a new system? Also social factors that is how the organizational
changes will affect the working life of those affected by the system.
Schedule Feasibility: Looks at how long the system will take to develop,or whether it can be completed in a given time period.
For our project that isINTERNET BANKING we applied the above
mentioned types of feasibility methods and could finally make the project.
During the life cycle of the project we underwent several steps involved in
feasibility study such as economic feasibility, schedule feasibility and
technical feasibility to make sure that we could successfully complete our
project.
-
7/30/2019 Mojor Project
14/153
SYSTEM
DEVELOPMENT
LIFE CYCLE
SYSTEM DEVELOPMENT LIFE CYCLEThe system development life cycle ia a project management technique that
divides complex projects into smaller, more easily managed segments or phases.
Segmenting projects allows managers to verify the successful.
Completion of project phases before allocating resources to subsequent phases.
-
7/30/2019 Mojor Project
15/153
Software development projects typically include initiation, planning, design,
development, testing, implementation and maintenance phases. However, the
phases may be divided differently depending on the organization involved. For
example, initial project activities might be designated as request, requirements-
definition and planning phases or initiation, concept development in reviewing
the output of each phase to ensure the system is being built o deliver the needed
functionality.
The System Development Life cycle
As used in the Construction of the Server Appliance
SYSTEM DESIGN
Introduction
-
7/30/2019 Mojor Project
16/153
Every man made entity is first a concept in someones mind computerized
system, like other product technologies are developed in response to the
perceived needs. Before any development is undertaken, certain specification
are made consulting, the end user.
Managers of the relative department & experienced engineers who have been
associated with the development of various applications based on the user
requirement, the software to be developed is plan the first step in planning a
software projects to be prepare users technology a concise statement ofthe
problem to be solved the definition problem, statement include a description of
present situation and goal to be achieved by the new system.
User Requirements
To analyze & study a system, it is most necessary to recognize the requirement
of the user. The requirements of the user of the personal information system are:
Application should be user friendly so that user can select alternatives from
menu with minimum efforts.
Help should be available to user to solve any problem that occurs at any time of
insertion, deletion and updating.
Documentation of the system knows how to start and continue using the system.
To provide guidance to a trained user to expand and improve on the existing
personal information system.
Data Flow Diagrams
-
7/30/2019 Mojor Project
17/153
Data flow diagrams (Also called Data Flow Graphs) is commonly used during
problem analysis. Data flow diagram (DFD) is quite general and is not limited
to problem analysis for software requirement specification. They were in use
long before the software engineering discipline begin and are very useful in
understanding the system and can be effectively used during analysis.
A DFD shows the flow of data through a system. It views a system as a function
that transforms the inputs into desired output.
Suggestions for constructing a data flow graph:
Work your way consistently from the inputs to the outputs or vice versa.If you get stuck, reverse direction. Start with a high level data flow graph
with few major transforms describing the entire transformation from theinputs to outputs and then refine each transform with more detailed
transformations.
Never try to show control logic. If you find yourself thinking in terms ofloops and decisions, it is time to stop and start again.
Label each arrow with proper data element. Inputs and outputs of eachtransform should be carefully identified.
Make use of and+ operation and show sufficient detail in the data flowgraph.
Try drawing alternate data flow graphs setting on one.Once we have constructed a DFD and its associated data dictionary we have to
somehow verify that they are correct. They can be no formal verification of a
DFD is modeling is not formally specified anywhere against which verification
can be done. Human processes and rules of thumb must be used for verification.
-
7/30/2019 Mojor Project
18/153
REQUIREMENTS
REQUIREMENTS
-
7/30/2019 Mojor Project
19/153
a)HARDWARE REQUIREMENTS: Processor - Pentium Memory - 128 MB Hard Disk - 500 MB or higher Monitor - Color Monitor CDROM - CDROM Drive 52X Mouse - Standard 2/3 button Keyboard - Standard Keyboard
b)SOFTWARE REQUIREMENTS:1. Windows XP as operating system
2. Java language software
-
7/30/2019 Mojor Project
20/153
LANGUAGE
SELECTION
LANGUAGE SELECTION
-
7/30/2019 Mojor Project
21/153
-
7/30/2019 Mojor Project
22/153
TESTING
TESTING
Debugging is not testing but is always occur as a consequence of testing. After
the code is written, the program is generated and executed. The code is
debugging using the built debugging facility.
-
7/30/2019 Mojor Project
23/153
Testing is a program consist of providing the programming with a set text inputs
(or text case) and observation if the program as expected.
If the program fails to behave as expected then the condition under which a
failure occurs are noted for debugging and correction.
It is preferable to discover any surprise before the organization implements they
system and depends on it. Testing is done through the system development at
various stages.
It is always a good practice to text system at different levels a various intervals
i.e. subsystem, program module as work progress and finally the system as a
whole.
If this is not done, then poorly tested system can fail after installation.
During testing one should try and fine area in which the program can Each test
case is design with the intent of finding errors in the way the system will
process it.
Through testing of program do not guarantee the reliability of system.
It is done to ensure that the system runs errors free.
SOFTWARE TESTING FUNDAMENTALS
Testing presents an interesting anomaly for the software engineer. Earlier in the
software process, the engineer attempts to build software from an abstract
concept to a tangible Implementation. No comes that are intended to demolish
the software that has been built.
-
7/30/2019 Mojor Project
24/153
Testing requires that the developer discard preconceived notions of the
correctness of the software just develop and overcome a conflict of interest
that occurs when errors are uncovered.
TESTING OBJECTIVES
There are number of rules that can serve well as testing well as testing
objectives:
1. Testing is a process of executing a program with intent of finding anerror.
2. A good test case is one that has a high probability of finding an as yetundiscovered errors.
3. A successful test is one that uncover as yet undiscovered errors.
TESTING PRINCIPLES
Before applying methods to design effective test cases, a software engineers
must understand the basic principle that guides software testing. There is a set
of testing rules.
All tests should be traceable to organize/customer requirements. Test should be planned long before testing begins. The 80% of all errors uncovered during will likely be traceable to 20 of
all program modules.
Testing should begin in the small and progress toward testing in thelarge.
Exhaustive testing is not possible.
To be done effective, an independent third party should conduct testing.
TESTING FOR THE PROJECT MANAGEMENT
Testing is done at three levels:
1. Unit Testing2. Integration Testing
-
7/30/2019 Mojor Project
25/153
3. System Testing
Unit Testing
In this phase analyst test the program/modules making up a system. For this
reason unit testing is called program or module testing. It gives stress on the
modules independently of one another to find errors. This helps the tester in
detecting errors in coding and logic that are contained within that module alone.
Integrating Testing
After all modules of a system have been unit tested, integration of modules
starts. The full product takes shape only after all the modules have been
integrated. It consists of number of steps. During the each step, some modules
are added to previously system and the system is tested again.
System Testing
Once all the modules have been integrated and tested, system testing can start.
The system testing is the last chance to detect and correct errors before the
system is installed. The purpose of the system testing is to consider all the likely
variation to which it will be subjected and push the system to its limits.
-
7/30/2019 Mojor Project
26/153
DATAFLOWDIAGRAMS
DATA FLOW DIAGRAM
A graphical tool used to describe and analyze the movements of data through a
system manual or automated including the process stores of the data and details
in the system. Data flow diagrams are the central tool and basic from which
other components are developed.
DFD SYMBOLS:
-
7/30/2019 Mojor Project
27/153
Represents data source and
destination
Process Representation
Arrow Represent Data Flow
Represent Data Source
-
7/30/2019 Mojor Project
28/153
ZERO LEVAL DFD
-
7/30/2019 Mojor Project
29/153
1 LEVEL DFD
-
7/30/2019 Mojor Project
30/153
OUTPUT FORMS
LOGIN PAGE OF MY BANK
-
7/30/2019 Mojor Project
31/153
ENTER YOUR LOGINID AND
PASSWORD TO LOGIN INTO MY BANK
PAGE OPENED AFTER LOGIN
-
7/30/2019 Mojor Project
32/153
TO VIEW ACCOUNT BALANCE CLICK
ON ACCOUNT BALANCE
-
7/30/2019 Mojor Project
33/153
AFTER CLICKINK ON VIEW BUTTON
DETAILS OF USER ACCOUNT IS DISPLAYED
TO VIEW THE ACCOUNT STATEMENT
-
7/30/2019 Mojor Project
34/153
TO VIEW ALL THE TRANSACTION
SELECT MINI STATEMENT
-
7/30/2019 Mojor Project
35/153
TO VIEW BALANCE OF SELECTED
PERIOD OF TIME
-
7/30/2019 Mojor Project
36/153
TO ADD BENIFICARY FOR TRANSACTION
TO TRANSFER THE AMOUNT WITHIN A BANK
-
7/30/2019 Mojor Project
37/153
TO ADD BENIFICIARY FOR
TRANSACTION WITH OTHER BANK(NEFT)
TO TRANSFER THE AMOUNT TO
OTHER BANK(NEFT)
-
7/30/2019 Mojor Project
38/153
TO ADD BENIFICIARY FOR TRANSACTION
WITH OTHER BANK(USING RTGS)
TO TRANSFER THE AMOUNT TO OTHER
BANK(USING RTGS)
-
7/30/2019 Mojor Project
39/153
TO VIEW THE ADDED BENIFICIARY
WITHIN A BANK
TO VIEW THE ADDED BENIFICIARY
OF OTHER BANK(NEFT)
-
7/30/2019 Mojor Project
40/153
TO VIEW THE ADDED BENIFICIARY
OF OTHER BANK(USING RTGS)
-
7/30/2019 Mojor Project
41/153
LOANS PROVIDED BY MY BANK
1.PERSONAL LOANS
2.HOME LOANS
-
7/30/2019 Mojor Project
42/153
BANK INTERESTS
TO CHANGE PASSWORD
-
7/30/2019 Mojor Project
43/153
TO REQUEST FOR INTERNET BANKING
CLICK ON REGISTER BUTTON
FILL THE FOLLOWING FIELDS
FOR REGISTRATION
-
7/30/2019 Mojor Project
44/153
CODING
-
7/30/2019 Mojor Project
45/153
USER LOGIN
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class UserLogin extends JApplet implements ActionListener
{
static int count=0;
private Connection con;
Statement stmt;
ResultSet rs;
JLabel lblLoginId, lblPassword;
JTextField tbLoginId;
JPasswordField tbPassword;
JButton btnLogin;
GridBagLayout gb;
GridBagConstraints gbc;
FileWriter fout;
BufferedWriter bwrite;
-
7/30/2019 Mojor Project
46/153
public UserLogin()
{
gb=new GridBagLayout();
gbc=new GridBagConstraints();
lblLoginId=new JLabel("Login ID: ");
lblPassword=new JLabel("Password: ");
tbLoginId=new JTextField(10);
tbPassword=new JPasswordField(10);
btnLogin=new JButton("Login Me");
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
-
7/30/2019 Mojor Project
47/153
}
public void init()
{
setLayout(gb);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=1;
add(lblLoginId,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=1;
add(tbLoginId,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=2;
add(lblPassword,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=2;
add(tbPassword,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
-
7/30/2019 Mojor Project
48/153
gbc.gridy=3;
add(btnLogin,gbc);
btnLogin.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
if(count
-
7/30/2019 Mojor Project
49/153
{ count++;
JOptionPane.showMessageDialog(null,"Sorry ! you are not a
valid user ! you have only "+(3-count)+" attempts left!");
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}else {
JOptionPane.showMessageDialog(null,"Your account has been locked
! Contact your nearest My Bank barnch");
}
}
}
-
7/30/2019 Mojor Project
50/153
USER CPANEL
import java.io.*;
import java.applet.*;
import java.awt.*;
import java.net.*;
import javax.swing.*;
public class UserCPanel extends JApplet
{
FileReader fstream;
public void init()
{
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) == null)
{
JOptionPane.showMessageDialog(null,strLine);
getAppletContext().showDocument(new
URL(getCodeBase().toString() +"index.html"), "_self");
}
br.close();
}
catch (FileNotFoundException fex)
-
7/30/2019 Mojor Project
51/153
{
try
{
getAppletContext().showDocument(new
URL(getCodeBase().toString() +"index.html"), "_self");
}
catch(Exception ex_1)
{
;;
}
}
catch (Exception e)
{
;;
}
}
}
-
7/30/2019 Mojor Project
52/153
ACCOUNT BALANCE
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class AccountBalance extends JApplet implements ActionListener
{
private Connection con;
Statement stmt;
ResultSet rs;
JLabel lblAccountNo;
JComboBox cmbAccountNo;
JButton btnView;
GridBagLayout gb;
GridBagConstraints gbc;
FileReader fstream;
-
7/30/2019 Mojor Project
53/153
FileWriter fout;
public AccountBalance()
{
gb=new GridBagLayout();
gbc=new GridBagConstraints();
lblAccountNo=new JLabel("Account Number: ");
cmbAccountNo=new JComboBox();
btnView=new JButton("View");
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
-
7/30/2019 Mojor Project
54/153
}
public void init()
{
setLayout(gb);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=1;
add(lblAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=1;
add(cmbAccountNo,gbc);
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="select * from tblAccounts where
loginid='"+strLine+"'";
-
7/30/2019 Mojor Project
55/153
rs=stmt.executeQuery(query);
while(rs.next())
{
cmbAccountNo.addItem(rs.getString(1));
}
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=6;
add(btnView,gbc);
btnView.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
if(evt.getSource()==btnView)
{
try
{
stmt=con.createStatement();
-
7/30/2019 Mojor Project
56/153
String query="select * from tblAccounts where
accountno='"+cmbAccountNo.getSelectedItem()+"'";
rs=stmt.executeQuery(query);
fout=new FileWriter("c:\\wamp\\www\\my-
bank\\account_balance.html");
BufferedWriter dos=new BufferedWriter(fout);
dos.write("Account Balance of Account
No:"+cmbAccountNo.getSelectedItem()+"
");
dos.write("");
while(rs.next())
{
dos.write("Name"+rs.getString(3)+"");
dos.write("Currency"+rs.getString(4)+"");
dos.write("Balance"+rs.getString(5)+"");
dos.write("Hold
Funds"+rs.getString(6)+"");
dos.write("Uncleared
Funds"+rs.getString(7)+"");
dos.write("Overdraft
Limit"+rs.getString(8)+"");
dos.write("Amount to be swept
in"+rs.getString(9)+"");
dos.write("Available
Balance"+rs.getString(10)+"");
-
7/30/2019 Mojor Project
57/153
}
dos.write("");
dos.close();
getAppletContext().showDocument(new
URL(getCodeBase().toString() +"account_balance.html"), "main_frame");
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
}
}
-
7/30/2019 Mojor Project
58/153
ACCOUNT STATEMENT
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class AccountSummary extends JApplet
{
private Connection con;
Statement stmt;
ResultSet rs;
FileReader fstream;
FileWriter fout;
public AccountSummary()
{
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
-
7/30/2019 Mojor Project
59/153
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
}
public void init()
{
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
try
{
stmt=con.createStatement();
String query="select * from tblAccounts where
loginid='"+strLine+"' and accounttype='Saving'";
-
7/30/2019 Mojor Project
60/153
rs=stmt.executeQuery(query);
fout=new FileWriter("c:\\wamp\\www\\my-
bank\\account_summary.html");
BufferedWriter dos=new BufferedWriter(fout);
dos.write("Saving Accounts
");
dos.write("Account
NoBranchNameCCYAvailable Balance");
while(rs.next())
{
dos.write(""+rs.getString(1)+""+rs.getString(2)+""+rs.g
etString(3)+""+rs.getString(4)+""+rs.getString(10)+"");
}
dos.write("");
dos.close();
//getAppletContext().showDocument(new
URL(getCodeBase().toString() +"account_summary.html"), "main_frame");
stmt=con.createStatement();
query="select * from tblAccounts whereloginid='"+strLine+"' and accounttype='Current'";
rs=stmt.executeQuery(query);
fout=new FileWriter("c:\\wamp\\www\\my-
bank\\account_summary.html",true);
dos=new BufferedWriter(fout);
dos.write("Current Accounts
");
-
7/30/2019 Mojor Project
61/153
dos.write("Account
NoBranchNameCCYAvailable Balance");
while(rs.next())
{
dos.write(""+rs.getString(1)+""+rs.getString(2)+""+rs.g
etString(3)+""+rs.getString(4)+""+rs.getString(10)+"");
}
dos.write("");
dos.close();
getAppletContext().showDocument(new
URL(getCodeBase().toString() +"account_summary.html"), "main_frame");
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
br.close();
}
catch (FileNotFoundException fex)
{
JOptionPane.showMessageDialog(null,fex.toString());
}
catch (Exception e)
-
7/30/2019 Mojor Project
62/153
{
JOptionPane.showMessageDialog(null,e.toString());
}
}
}
-
7/30/2019 Mojor Project
63/153
MINI STATEMENT
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.FileReader;
public class MiniStatement extends JApplet implements ActionListener
{
private Connection con;
Statement stmt;
ResultSet rs;
JLabel lblAccountNo, lblFrom, lblTo, lblShowTrans;
JComboBox cmbAccountNo, cmbFromDD, cmbFromMMM, cmbFromYY,
cmbToDD, cmbToMMM, cmbToYY, cmbShowTrans;
JRadioButton rdoMiniStat, rdoSelectPeriod;
ButtonGroup bgroup;
JButton btnView;
-
7/30/2019 Mojor Project
64/153
GridBagLayout gb;
GridBagConstraints gbc;
FileReader fstream;
FileWriter fout;
public MiniStatement()
{
gb=new GridBagLayout();
gbc=new GridBagConstraints();
lblAccountNo=new JLabel("Account Number: ");
lblFrom=new JLabel("From ");
lblTo=new JLabel("To: ");
lblShowTrans=new JLabel("Show Transactions: ");
cmbAccountNo=new JComboBox();
cmbFromDD=new JComboBox();
for(int i=1;i
-
7/30/2019 Mojor Project
65/153
String [] strFromYY={"11","12","13","14","15","16","17","18","19","20"};
cmbFromYY=new JComboBox(strFromYY);
cmbToDD=new JComboBox();
for(int i=1;i
-
7/30/2019 Mojor Project
66/153
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
}
public void init()
{
setLayout(gb);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=1;
add(lblAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=1;
-
7/30/2019 Mojor Project
67/153
add(cmbAccountNo,gbc);
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="select * from tblAccounts where
loginid='"+strLine+"'";
rs=stmt.executeQuery(query);
while(rs.next())
{
cmbAccountNo.addItem(rs.getString(1));
}
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
gbc.anchor=GridBagConstraints.NORTHWEST;
-
7/30/2019 Mojor Project
68/153
gbc.gridx=1;
gbc.gridy=2;
add(rdoMiniStat,gbc);
rdoMiniStat.addActionListener(this);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=3;
add(rdoSelectPeriod,gbc);
rdoSelectPeriod.addActionListener(this);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=3;
add(lblFrom,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=3;
gbc.gridy=3;
add(cmbFromDD,gbc);
cmbFromDD.setEnabled(false);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=4;
gbc.gridy=3;
add(cmbFromMMM,gbc);
cmbFromMMM.setEnabled(false);
-
7/30/2019 Mojor Project
69/153
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=5;
gbc.gridy=3;
add(cmbFromYY,gbc);
cmbFromYY.setEnabled(false);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=4;
add(lblTo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=3;
gbc.gridy=4;
add(cmbToDD,gbc);
cmbToDD.setEnabled(false);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=4;
gbc.gridy=4;
add(cmbToMMM,gbc);
cmbToMMM.setEnabled(false);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=5;
gbc.gridy=4;
-
7/30/2019 Mojor Project
70/153
add(cmbToYY,gbc);
cmbToYY.setEnabled(false);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=5;
add(lblShowTrans,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=5;
add(cmbShowTrans,gbc);
cmbShowTrans.setEnabled(false);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=6;
add(btnView,gbc);
btnView.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
if(evt.getSource()==btnView)
{
try
{
-
7/30/2019 Mojor Project
71/153
stmt=con.createStatement();
String query="";
if(rdoMiniStat.isSelected())
{
query="select * from tblTransaction where
accountno='"+cmbAccountNo.getSelectedItem()+"'";
}
else if(rdoSelectPeriod.isSelected())
{
if(cmbShowTrans.getSelectedItem()=="Withdrawl")
{
query="select * from tblTransaction where
accountno='"+cmbAccountNo.getSelectedItem()+"' and dttransaction between
#"+cmbFromMMM.getSelectedItem()+"/"+cmbFromDD.getSelectedItem()+"/"+cmbFromY
Y.getSelectedItem()+"# and
#"+cmbToMMM.getSelectedItem()+"/"+cmbToDD.getSelectedItem()+"/"+cmbToYY.getSelectedItem()+"# and withdrawl > 0";
}
else if(cmbShowTrans.getSelectedItem()=="Deposit")
{
query="select * from tblTransaction where
accountno='"+cmbAccountNo.getSelectedItem()+"' and dttransaction between
#"+cmbFromMMM.getSelectedItem()+"/"+cmbFromDD.getSelectedItem()+"/"+cmbFromYY.getSelectedItem()+"# and
#"+cmbToMMM.getSelectedItem()+"/"+cmbToDD.getSelectedItem()+"/"+cmbToYY.getSel
ectedItem()+"# and deposit > 0";
}
else
{
query="select * from tblTransaction whereaccountno='"+cmbAccountNo.getSelectedItem()+"' and dttransaction between
-
7/30/2019 Mojor Project
72/153
#"+cmbFromMMM.getSelectedItem()+"/"+cmbFromDD.getSelectedItem()+"/"+cmbFromY
Y.getSelectedItem()+"# and
#"+cmbToMMM.getSelectedItem()+"/"+cmbToDD.getSelectedItem()+"/"+cmbToYY.getSel
ectedItem()+"#";
}
//JOptionPane.showMessageDialog(null,query);
}
rs=stmt.executeQuery(query);
if(cmbShowTrans.getSelectedItem()=="Withdrawl")
{
fout=new FileWriter("c:\\wamp\\www\\my-
bank\\mini_statement_withdrawl.html");
BufferedWriter dos=new BufferedWriter(fout);
dos.write("Mini Statement of Account
No:"+cmbAccountNo.getSelectedItem()+"
");
dos.write("DateNarrationCheque/Ref. NoValue
DateWithdrawlClosing BalanceCr/Dr");
while(rs.next())
{
float dposit=Float.valueOf(rs.getString(8));
float wdrwl=Float.valueOf(rs.getString(7));
dos.write(""+rs.getString(2)+""+rs.getString(4)+""+rs.g
etString(5)+""+rs.getString(6)+""+wdrwl+""+(dposit-wdrwl)+"Dr");
-
7/30/2019 Mojor Project
73/153
}
dos.write("");
dos.write("
Print this Statement
");dos.close();
getAppletContext().showDocument(new
URL(getCodeBase().toString() +"mini_statement_withdrawl.html"), "main_frame");
}
else if(cmbShowTrans.getSelectedItem()=="Deposit")
{
fout=new FileWriter("c:\\wamp\\www\\my-
bank\\mini_statement_deposit.html");
BufferedWriter dos=new BufferedWriter(fout);
dos.write("Mini Statement of Account
No:"+cmbAccountNo.getSelectedItem()+"
");
dos.write("DateNarrationCheque/Ref. NoValue
DateDepositClosing BalanceCr/Dr");
while(rs.next())
{
float dposit=Float.valueOf(rs.getString(8));
float wdrwl=Float.valueOf(rs.getString(7));
dos.write(""+rs.getString(2)+""+rs.getString(4)+""+rs.g
etString(5)+""+rs.getString(6)+""+dposit+""+(dposit-
wdrwl)+"Cr");
-
7/30/2019 Mojor Project
74/153
}
dos.write("");
dos.write("
Print this Statement
");dos.close();
getAppletContext().showDocument(new
URL(getCodeBase().toString() +"mini_statement_deposit.html"), "main_frame");
}
else
{
fout=new FileWriter("c:\\wamp\\www\\my-
bank\\mini_statement.html");
BufferedWriter dos=new BufferedWriter(fout);
dos.write("Mini Statement of Account
No:"+cmbAccountNo.getSelectedItem()+"
");
dos.write("DateNarrationCheque/Ref. NoValue
DateWithdrawlDepositClosing
BalanceCr/Dr");
while(rs.next())
{
float dposit=Float.valueOf(rs.getString(8));
float wdrwl=Float.valueOf(rs.getString(7));
if(dposit==0)
dos.write(""+rs.getString(2)+""+rs.getString(4)+""+rs.g
etString(5)+""+rs.getString(6)+""+wdrwl+""+dposit+""+(dposit-wdrwl)+"Dr");
if(wdrwl==0)
-
7/30/2019 Mojor Project
75/153
dos.write(""+rs.getString(2)+""+rs.getString(4)+""+rs.g
etString(5)+""+rs.getString(6)+""+wdrwl+""+dposit+""+(dposit-wdrwl)+"Cr");
}
dos.write("");
dos.write("
Print this Statement
");dos.close();
getAppletContext().showDocument(newURL(getCodeBase().toString() +"mini_statement.html"), "main_frame");
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
else if(evt.getSource()==rdoMiniStat)
{
cmbFromDD.setEnabled(false);
cmbFromMMM.setEnabled(false);
cmbFromYY.setEnabled(false);
cmbToDD.setEnabled(false);
cmbToMMM.setEnabled(false);
cmbToYY.setEnabled(false);
cmbShowTrans.setEnabled(false);
-
7/30/2019 Mojor Project
76/153
}
else if(evt.getSource()==rdoSelectPeriod)
{
cmbFromDD.setEnabled(true);
cmbFromMMM.setEnabled(true);
cmbFromYY.setEnabled(true);
cmbToDD.setEnabled(true);
cmbToMMM.setEnabled(true);
cmbToYY.setEnabled(true);
cmbShowTrans.setEnabled(true);
}
}
}
-
7/30/2019 Mojor Project
77/153
ADD BENIFICIARY
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class AddBenificiary extends JApplet implements ActionListener
{
JLabel lblAccountNo, lblName,lblEmail;
JTextField tbAccountNo,tbName,tbEmail;
JButton btnRegister;
GridBagLayout gb;
GridBagConstraints gbc;
private Connection con;
Statement stmt;
FileReader fstream;
public AddBenificiary()
-
7/30/2019 Mojor Project
78/153
{
gb=new GridBagLayout();
gbc=new GridBagConstraints();
lblAccountNo=new JLabel("Benificiary Account No.");
lblName=new JLabel("Benificiary Name/Nick Name");
lblEmail=new JLabel("Email ID");
tbAccountNo=new JTextField(15);
tbName=new JTextField(15);
tbEmail=new JTextField(15);
btnRegister=new JButton("Add");
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
-
7/30/2019 Mojor Project
79/153
}
}
public void init()
{
setLayout(gb);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=1;
add(lblAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=2;
add(tbAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=1;
add(lblName,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=2;
add(tbName,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
-
7/30/2019 Mojor Project
80/153
gbc.gridx=3;
gbc.gridy=1;
add(lblEmail,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=3;
gbc.gridy=2;
add(tbEmail,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=4;
gbc.gridy=2;
add(btnRegister,gbc);
btnRegister.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
try
{
stmt=con.createStatement();
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
-
7/30/2019 Mojor Project
81/153
if((strLine = br.readLine()) != null)
{
String query="insert into tblTWB
(benificiary_acno,benificiary_name,emailid, loginid)
values('"+tbAccountNo.getText()+"','"+tbName.getText()+"','"+tbEmail.getText()+"','"+strLi
ne+"')";
//JOptionPane.showMessageDialog(null,query);
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Benificiary
added successfully !");
tbAccountNo.setText("");
tbName.setText("");
tbEmail.setText("");
}
else
JOptionPane.showMessageDialog(null,"Login id not
found");
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,"This benificiary
already added or this account does not exist in our bank ! Please check again.");
}
}
catch(Exception ex_1)
-
7/30/2019 Mojor Project
82/153
{
JOptionPane.showMessageDialog(null,ex_1.toString());
}
}
}
-
7/30/2019 Mojor Project
83/153
ADD BENIFICIARY (NEFT)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class AddBenificiaryNEFT extends JApplet implements ActionListener
{
JLabel lblAccountNo, lblAcType, lblIFSC, lblName,lblEmail;
JTextField tbAccountNo, tbIFSC, tbName,tbEmail;
JComboBox cmbAcType;
JButton btnRegister;
GridBagLayout gb;
GridBagConstraints gbc;
private Connection con;
Statement stmt;
FileReader fstream;
-
7/30/2019 Mojor Project
84/153
public AddBenificiaryNEFT()
{
gb=new GridBagLayout();
gbc=new GridBagConstraints();
lblAccountNo=new JLabel("Benificiary Account No.: ");
lblAcType=new JLabel("Account Type: ");
lblIFSC=new JLabel("IFSC Code: ");
lblName=new JLabel("Benificiary Name/Nick Name");
lblEmail=new JLabel("Email ID");
tbAccountNo=new JTextField(15);
tbIFSC=new JTextField(15);
tbName=new JTextField(15);
tbEmail=new JTextField(15);
String [] strAcType={"Saving","Current"};
cmbAcType=new JComboBox(strAcType);
btnRegister=new JButton("Add");
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
-
7/30/2019 Mojor Project
85/153
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
}
public void init()
{
setLayout(gb);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=1;
add(lblAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=1;
add(tbAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=2;
add(lblAcType,gbc);
-
7/30/2019 Mojor Project
86/153
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=2;
add(cmbAcType,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=3;
add(lblIFSC,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=3;
add(tbIFSC,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=4;
add(lblName,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=4;
add(tbName,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
-
7/30/2019 Mojor Project
87/153
gbc.gridx=1;
gbc.gridy=5;
add(lblEmail,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=5;
add(tbEmail,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=6;
add(btnRegister,gbc);
btnRegister.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
try
{
stmt=con.createStatement();
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
-
7/30/2019 Mojor Project
88/153
if((strLine = br.readLine()) != null)
{
String query="insert into tblTOB_NEFT
(benificiary_acno, benificiary_actype, IFSC_code, benificiary_name,emailid, loginid)values('"+tbAccountNo.getText()+"','"+cmbAcType.getSelectedItem()+"','"+tbIFSC.getText(
)+"','"+tbName.getText()+"','"+tbEmail.getText()+"','"+strLine+"')";
//JOptionPane.showMessageDialog(null,query);
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Benificiary
added successfully !");
tbAccountNo.setText("");
tbIFSC.setText("");
tbName.setText("");
tbEmail.setText("");
}
else
JOptionPane.showMessageDialog(null,"Login id not
found");
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
catch(Exception ex_1)
{
-
7/30/2019 Mojor Project
89/153
JOptionPane.showMessageDialog(null,ex_1.toString());
}
}
}
-
7/30/2019 Mojor Project
90/153
ADD BENIFICIARY (RTGS)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class AddBenificiaryRTGS extends JApplet implements ActionListener
{
JLabel lblAccountNo, lblIFSC, lblName,lblEmail;
JTextField tbAccountNo, tbIFSC, tbName,tbEmail;
JComboBox cmbAcType;
JButton btnRegister;
GridBagLayout gb;
GridBagConstraints gbc;
private Connection con;
Statement stmt;
FileReader fstream;
-
7/30/2019 Mojor Project
91/153
public AddBenificiaryRTGS()
{
gb=new GridBagLayout();
gbc=new GridBagConstraints();
lblAccountNo=new JLabel("Benificiary Account No.: ");
lblIFSC=new JLabel("IFSC Code: ");
lblName=new JLabel("Benificiary Name/Nick Name");
lblEmail=new JLabel("Email ID");
tbAccountNo=new JTextField(15);
tbIFSC=new JTextField(15);
tbName=new JTextField(15);
tbEmail=new JTextField(15);
btnRegister=new JButton("Add");
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
-
7/30/2019 Mojor Project
92/153
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
}
public void init()
{
setLayout(gb);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=1;
add(lblAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=1;
add(tbAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=3;
add(lblIFSC,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
-
7/30/2019 Mojor Project
93/153
gbc.gridy=3;
add(tbIFSC,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=4;
add(lblName,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=4;
add(tbName,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=5;
add(lblEmail,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=5;
add(tbEmail,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=6;
add(btnRegister,gbc);
-
7/30/2019 Mojor Project
94/153
btnRegister.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
try
{
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="insert into tblTOB_RTGS
(benificiary_acno, IFSC_code, benificiary_name,emailid,loginid)
values('"+tbAccountNo.getText()+"','"+tbIFSC.getText()+"','"+tbName.getText()+"','"+tbEm
ail.getText()+"','"+strLine+"')";
//JOptionPane.showMessageDialog(null,query);
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Benificiary
added successfully !");
tbAccountNo.setText("");
tbIFSC.setText("");
-
7/30/2019 Mojor Project
95/153
tbName.setText("");
tbEmail.setText("");
}
else
JOptionPane.showMessageDialog(null,"Login id not
found");
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
catch(Exception ex_1)
{
JOptionPane.showMessageDialog(null,ex_1.toString());
}
}
}
-
7/30/2019 Mojor Project
96/153
FUND TRANSFER WITHIN A BANK
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.util.Date.*;
import java.text.*;
public class TransWBank extends JApplet implements ActionListener
{
private Connection con;
Statement stmt,stmt_1;
ResultSet rs,rs_1;
JLabel lblFromAccountNo, lblToAccountNo, lblTransDesc, lblTransAmount;
JTextField txtTransDesc, txtTransAmount;
JComboBox cmbFromAccountNo, cmbToAccountNo;
JButton btnTransfer;
GridBagLayout gb;
GridBagConstraints gbc;
-
7/30/2019 Mojor Project
97/153
FileReader fstream;
FileWriter fout;
public TransWBank()
{
gb=new GridBagLayout();
gbc=new GridBagConstraints();
lblFromAccountNo=new JLabel("From Account Number: ");
lblToAccountNo=new JLabel("To Account Number");
lblTransDesc=new JLabel("Transfer Description ");
lblTransAmount=new JLabel("Transfer Amount");
txtTransDesc=new JTextField(15);
txtTransAmount=new JTextField(10);
cmbFromAccountNo=new JComboBox();
cmbToAccountNo=new JComboBox();
btnTransfer=new JButton("Transfer");
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
-
7/30/2019 Mojor Project
98/153
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
}
public void init()
{
setLayout(gb);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=1;
add(lblFromAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=1;
add(cmbFromAccountNo,gbc);
-
7/30/2019 Mojor Project
99/153
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="select * from tblAccounts where
loginid='"+strLine+"'";
rs=stmt.executeQuery(query);
while(rs.next())
{
cmbFromAccountNo.addItem(rs.getString(1));
}
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
-
7/30/2019 Mojor Project
100/153
gbc.gridy=2;
add(lblToAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=3;
add(cmbToAccountNo,gbc);
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="select * from tblTWB where
loginid='"+strLine+"'";
rs=stmt.executeQuery(query);
while(rs.next())
{
cmbToAccountNo.addItem(rs.getString(1));
}
}
-
7/30/2019 Mojor Project
101/153
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=2;
add(lblTransDesc,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=3;
add(txtTransDesc,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=3;
gbc.gridy=2;
add(lblTransAmount,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=3;
gbc.gridy=3;
add(txtTransAmount,gbc);
-
7/30/2019 Mojor Project
102/153
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=4;
gbc.gridy=6;
add(btnTransfer,gbc);
btnTransfer.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
if(evt.getSource()==btnTransfer)
{
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
java.util.Date now = new java.util.Date();
DateFormat df = DateFormat.getDateInstance();
String s = df.format(now);
if((strLine = br.readLine()) != null)
{
stmt_1=con.createStatement();
rs_1=stmt_1.executeQuery("select * from tblAccountswhere accountno='"+cmbFromAccountNo.getSelectedItem()+"'");
-
7/30/2019 Mojor Project
103/153
while(rs_1.next())
{
if(Float.valueOf(rs_1.getString(10))>Float.valueOf(txtTransAmount.getText()))
{
int chkrefno=(int)(Math.random()*1000);
String query="insert into
tblTransaction(dttransaction,accountno,narration, cheque_refno,deposit, loginid,fromacno)values('"+s+"','"+cmbToAccountNo.getSelectedItem()+"','"+txtTransDesc.getText()+"','"+ch
krefno+"',"+txtTransAmount.getText()+",'"+strLine+"','"+cmbFromAccountNo.getSelectedIt
em()+"')";
//JOptionPane.showMessageDialog(null,query);
stmt.executeUpdate(query);
String query_2="update tblAccounts set
availbalance=availbalance+"+txtTransAmount.getText()+" where
accountno='"+cmbToAccountNo.getSelectedItem()+"'";
//JOptionPane.showMessageDialog(null,query_2);
stmt.executeUpdate(query_2);
String query_1="insert into
tblTransaction(dttransaction,accountno,narration, cheque_refno,withdrawl, loginid,fromacno)
values('"+s+"','"+cmbFromAccountNo.getSelectedItem()+"','"+txtTransDesc.getText()+"','"+
-
7/30/2019 Mojor Project
104/153
chkrefno+"',"+txtTransAmount.getText()+",'"+strLine+"','"+cmbToAccountNo.getSelectedIt
em()+"')";
//JOptionPane.showMessageDialog(null,query_1);
stmt.executeUpdate(query_1);
String query_3="update tblAccounts set
availbalance=availbalance-"+txtTransAmount.getText()+" where
accountno='"+cmbFromAccountNo.getSelectedItem()+"'";
//JOptionPane.showMessageDialog(null,query_3);
stmt.executeUpdate(query_3);
JOptionPane.showMessageDialog(null,"Amount Transferred successfully !");
txtTransAmount.setText("");
txtTransDesc.setText("");
}
else
{
JOptionPane.showMessageDialog(null,"Sorry! Balance not sufficient.");
}
}
-
7/30/2019 Mojor Project
105/153
}
else
JOptionPane.showMessageDialog(null,"Login id not
found");
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
}
}
FUND TRANSFER TO OTHER BANK(NEFT)
-
7/30/2019 Mojor Project
106/153
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.util.Date.*;
import java.text.*;
public class TransNEFTBank extends JApplet implements ActionListener
{
private Connection con;
Statement stmt,stmt_1;
ResultSet rs,rs_1;
JLabel lblFromAccountNo, lblToAccountNo, lblTransDesc, lblTransAmount;
JTextField txtTransDesc, txtTransAmount;
JComboBox cmbFromAccountNo, cmbToAccountNo;
JButton btnTransfer;
GridBagLayout gb;
GridBagConstraints gbc;
-
7/30/2019 Mojor Project
107/153
FileReader fstream;
FileWriter fout;
public TransNEFTBank()
{
gb=new GridBagLayout();
gbc=new GridBagConstraints();
lblFromAccountNo=new JLabel("From Account Number: ");
lblToAccountNo=new JLabel("To Account Number");
lblTransDesc=new JLabel("Transfer Description ");
lblTransAmount=new JLabel("Transfer Amount");
txtTransDesc=new JTextField(15);
txtTransAmount=new JTextField(10);
cmbFromAccountNo=new JComboBox();
cmbToAccountNo=new JComboBox();
btnTransfer=new JButton("Transfer");
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
-
7/30/2019 Mojor Project
108/153
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
}
public void init()
{
setLayout(gb);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=1;
add(lblFromAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=1;
add(cmbFromAccountNo,gbc);
try
-
7/30/2019 Mojor Project
109/153
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="select * from tblAccounts where
loginid='"+strLine+"'";
rs=stmt.executeQuery(query);
while(rs.next())
{
cmbFromAccountNo.addItem(rs.getString(1));
}
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=2;
-
7/30/2019 Mojor Project
110/153
add(lblToAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=3;
add(cmbToAccountNo,gbc);
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="select * from tblTOB_NEFT where
loginid='"+strLine+"' and verification=1";
rs=stmt.executeQuery(query);
while(rs.next())
{
cmbToAccountNo.addItem(rs.getString(1));
}
if(cmbToAccountNo.getItemCount()==0)
JOptionPane.showMessageDialog(null,"No NEFTbenificiary verified yet !");
-
7/30/2019 Mojor Project
111/153
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=2;
add(lblTransDesc,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=3;
add(txtTransDesc,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=3;
gbc.gridy=2;
add(lblTransAmount,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=3;
gbc.gridy=3;
add(txtTransAmount,gbc);
-
7/30/2019 Mojor Project
112/153
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=4;
gbc.gridy=6;
add(btnTransfer,gbc);
btnTransfer.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
if(evt.getSource()==btnTransfer)
{
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
java.util.Date now = new java.util.Date();
DateFormat df = DateFormat.getDateInstance();
String s = df.format(now);
if((strLine = br.readLine()) != null)
{
stmt_1=con.createStatement();
-
7/30/2019 Mojor Project
113/153
rs_1=stmt_1.executeQuery("select * from tblAccounts
where accountno='"+cmbFromAccountNo.getSelectedItem()+"'");
while(rs_1.next())
{
if(Float.valueOf(rs_1.getString(10))>Float.valueOf(txtTransAmount.getText()))
{
int chkrefno=(int)(Math.random()*1000);
String query="insert into
tblTransaction(dttransaction,accountno,narration, cheque_refno,deposit, loginid,fromacno)
values('"+s+"','"+cmbToAccountNo.getSelectedItem()+"','"+txtTransDesc.getText()+"','"+ch
krefno+"',"+txtTransAmount.getText()+",'"+strLine+"','"+cmbFromAccountNo.getSelectedIt
em()+"')";
//JOptionPane.showMessageDialog(null,query);
stmt.executeUpdate(query);
String query_2="update tblTOB_NEFT
set availbalance=availbalance+"+txtTransAmount.getText()+" where
benificiary_acno='"+cmbToAccountNo.getSelectedItem()+"'";
//JOptionPane.showMessageDialog(null,query_2);
stmt.executeUpdate(query_2);
-
7/30/2019 Mojor Project
114/153
String query_1="insert into
tblTransaction(dttransaction,accountno,narration, cheque_refno,withdrawl, loginid,fromacno)
values('"+s+"','"+cmbFromAccountNo.getSelectedItem()+"','"+txtTransDesc.getText()+"','"+
chkrefno+"',"+txtTransAmount.getText()+",'"+strLine+"','"+cmbToAccountNo.getSelectedIt
em()+"')";
//JOptionPane.showMessageDialog(null,query_1);
stmt.executeUpdate(query_1);
String query_3="update tblTOB_NEFT
set availbalance=availbalance-"+txtTransAmount.getText()+" where
benificiary_acno='"+cmbFromAccountNo.getSelectedItem()+"'";
//JOptionPane.showMessageDialog(null,query_3);
stmt.executeUpdate(query_3);
JOptionPane.showMessageDialog(null,"Amount Transferred successfully !");
txtTransAmount.setText("");
txtTransDesc.setText("");
}
else
{
JOptionPane.showMessageDialog(null,"Sorry! Balance not sufficient.");
-
7/30/2019 Mojor Project
115/153
}
}
}
else
JOptionPane.showMessageDialog(null,"Login id not
found");
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
}
}
-
7/30/2019 Mojor Project
116/153
FUND TRANSFER TO OTHER BANK (USING RTGS)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.util.Date.*;
import java.text.*;
public class TransRTGSBank extends JApplet implements ActionListener
{
private Connection con;
Statement stmt,stmt_1;
ResultSet rs,rs_1;
JLabel lblFromAccountNo, lblToAccountNo, lblTransDesc, lblTransAmount;
JTextField txtTransDesc, txtTransAmount;
JComboBox cmbFromAccountNo, cmbToAccountNo;
JButton btnTransfer;
GridBagLayout gb;
GridBagConstraints gbc;
-
7/30/2019 Mojor Project
117/153
FileReader fstream;
FileWriter fout;
public TransRTGSBank()
{
gb=new GridBagLayout();
gbc=new GridBagConstraints();
lblFromAccountNo=new JLabel("From Account Number: ");
lblToAccountNo=new JLabel("To Account Number");
lblTransDesc=new JLabel("Transfer Description ");
lblTransAmount=new JLabel("Transfer Amount");
txtTransDesc=new JTextField(15);
txtTransAmount=new JTextField(10);
cmbFromAccountNo=new JComboBox();
cmbToAccountNo=new JComboBox();
btnTransfer=new JButton("Transfer");
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
-
7/30/2019 Mojor Project
118/153
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
}
public void init()
{
setLayout(gb);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=1;
add(lblFromAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=1;
add(cmbFromAccountNo,gbc);
-
7/30/2019 Mojor Project
119/153
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="select * from tblAccounts where
loginid='"+strLine+"'";
rs=stmt.executeQuery(query);
while(rs.next())
{
cmbFromAccountNo.addItem(rs.getString(1));
}
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
-
7/30/2019 Mojor Project
120/153
gbc.gridy=2;
add(lblToAccountNo,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=3;
add(cmbToAccountNo,gbc);
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="select * from tblTOB_RTGS where
loginid='"+strLine+"' and verification=1";
rs=stmt.executeQuery(query);
while(rs.next())
{
cmbToAccountNo.addItem(rs.getString(1));
}
-
7/30/2019 Mojor Project
121/153
if(cmbToAccountNo.getItemCount()==0)
JOptionPane.showMessageDialog(null,"No RTGS
benificiary verified yet !");
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=2;
add(lblTransDesc,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=3;
add(txtTransDesc,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=3;
gbc.gridy=2;
add(lblTransAmount,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
-
7/30/2019 Mojor Project
122/153
gbc.gridx=3;
gbc.gridy=3;
add(txtTransAmount,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=4;
gbc.gridy=6;
add(btnTransfer,gbc);
btnTransfer.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
if(evt.getSource()==btnTransfer)
{
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
java.util.Date now = new java.util.Date();
DateFormat df = DateFormat.getDateInstance();
String s = df.format(now);
if((strLine = br.readLine()) != null)
-
7/30/2019 Mojor Project
123/153
{
stmt_1=con.createStatement();
rs_1=stmt_1.executeQuery("select * from tblAccounts
where accountno='"+cmbFromAccountNo.getSelectedItem()+"'");
while(rs_1.next())
{
if(Float.valueOf(rs_1.getString(10))>Float.valueOf(txtTransAmount.getText()))
{
int chkrefno=(int)(Math.random()*1000);
String query="insert into
tblTransaction(dttransaction,accountno,narration, cheque_refno,deposit, loginid,fromacno)
values('"+s+"','"+cmbToAccountNo.getSelectedItem()+"','"+txtTransDesc.getText()+"','"+ch
krefno+"',"+txtTransAmount.getText()+",'"+strLine+"','"+cmbFromAccountNo.getSelectedItem()+"')";
//JOptionPane.showMessageDialog(null,query);
stmt.executeUpdate(query);
String query_2="update tblTOB_RTGS
set availbalance=availbalance+"+txtTransAmount.getText()+" where
benificiary_acno='"+cmbToAccountNo.getSelectedItem()+"'";
//JOptionPane.showMessageDialog(null,query_2);
-
7/30/2019 Mojor Project
124/153
stmt.executeUpdate(query_2);
String query_1="insert into
tblTransaction(dttransaction,accountno,narration, cheque_refno,withdrawl, loginid,fromacno)values('"+s+"','"+cmbFromAccountNo.getSelectedItem()+"','"+txtTransDesc.getText()+"','"+
chkrefno+"',"+txtTransAmount.getText()+",'"+strLine+"','"+cmbToAccountNo.getSelectedIt
em()+"')";
//JOptionPane.showMessageDialog(null,query_1);
stmt.executeUpdate(query_1);
String query_3="update tblTOB_RTGS
set availbalance=availbalance-"+txtTransAmount.getText()+" where
benificiary_acno='"+cmbFromAccountNo.getSelectedItem()+"'";
//JOptionPane.showMessageDialog(null,query_3);
stmt.executeUpdate(query_3);
JOptionPane.showMessageDialog(null,"Amount Transferred successfully !");
txtTransAmount.setText("");
txtTransDesc.setText("");
}
else
{
-
7/30/2019 Mojor Project
125/153
JOptionPane.showMessageDialog(null,"Sorry! Balance not sufficient.");
}
}
}
else
JOptionPane.showMessageDialog(null,"Login id not
found");
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
}
}
-
7/30/2019 Mojor Project
126/153
VIEW BENIFICIARY WITHIN BANK
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class ViewBenificiary extends JApplet
{
private Connection con;
Statement stmt;
ResultSet rs;
FileReader fstream;
FileWriter fout;
public ViewBenificiary()
{
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
-
7/30/2019 Mojor Project
127/153
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
}
public void init()
{
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="select * from tblTWB where
loginid='"+strLine+"'";
rs=stmt.executeQuery(query);
-
7/30/2019 Mojor Project
128/153
fout=new FileWriter("c:\\wamp\\www\\my-
bank\\transfer_view_benificiary.html");
BufferedWriter dos=new BufferedWriter(fout);
dos.write("Your Benificiary within BANK:
");
dos.write("");
dos.write("Benificiary Account
NumberBenificiary NameEmail");
while(rs.next())
{
dos.write(""+rs.getString(1)+""+rs.getString(2)+""+rs.g
etString(3)+"");
}
dos.write("");
dos.write("
Print this Statement
");dos.close();
getAppletContext().showDocument(new
URL(getCodeBase().toString() +"transfer_view_benificiary.html"), "main_frame");
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
}
-
7/30/2019 Mojor Project
129/153
VIEW BENIFICIARY OF OTHER BANK (NEFT)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class ViewBenificiaryNEFT extends JApplet
{
private Connection con;
Statement stmt;
ResultSet rs;
FileReader fstream;
FileWriter fout;
public ViewBenificiaryNEFT()
{
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
-
7/30/2019 Mojor Project
130/153
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
}
public void init()
{
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="select * from tblTOB_NEFT where
loginid='"+strLine+"'";
rs=stmt.executeQuery(query);
-
7/30/2019 Mojor Project
131/153
fout=new FileWriter("c:\\wamp\\www\\my-
bank\\transfer_view_benificiaryNEFT.html");
BufferedWriter dos=new BufferedWriter(fout);
dos.write("Your Benificiary NEFT Accounts:
");
dos.write("");
dos.write("Benificiary Account
NumberBenificiary Account TypeIFSC
CodeBenificiary NameEmail");
while(rs.next())
{
dos.write(""+rs.getString(1)+""+rs.getString(2)+""+rs.g
etString(3)+""+rs.getString(4)+""+rs.getString(5)+"");
}
dos.write("");
dos.write("
Print this Statement
");dos.close();
getAppletContext().showDocument(new
URL(getCodeBase().toString() +"transfer_view_benificiaryNEFT.html"), "main_frame");
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
}
-
7/30/2019 Mojor Project
132/153
VIEW BENIFICIRY OF OTHER BANK(USING RTGS)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class ViewBenificiaryRTGS extends JApplet
{
private Connection con;
Statement stmt;
ResultSet rs;
FileReader fstream;
FileWriter fout;
public ViewBenificiaryRTGS()
{
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
-
7/30/2019 Mojor Project
133/153
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
}
public void init()
{
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
if((strLine = br.readLine()) != null)
{
stmt=con.createStatement();
String query="select * from tblTOB_RTGS where
loginid='"+strLine+"'";
rs=stmt.executeQuery(query);
-
7/30/2019 Mojor Project
134/153
fout=new FileWriter("c:\\wamp\\www\\my-
bank\\transfer_view_benificiaryRTGS.html");
BufferedWriter dos=new BufferedWriter(fout);
dos.write("Your Benificiary RTGS Accounts:
");
dos.write("");
dos.write("Benificiary Account
NumberIFSC CodeBenificiary
NameEmail");
while(rs.next())
{
dos.write(""+rs.getString(1)+""+rs.getString(2)+""+rs.g
etString(3)+""+rs.getString(4)+"");
}
dos.write("");
dos.write("
Print this Statement
");dos.close();
getAppletContext().showDocument(new
URL(getCodeBase().toString() +"transfer_view_benificiaryRTGS.html"), "main_frame");
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
}
-
7/30/2019 Mojor Project
135/153
CHANGE PASSWORD
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
import java.io.*;
import java.io.BufferedReader;
import java.io.FileReader;
public class ChangePassword extends JApplet implements ActionListener
{
private Connection con;
Statement stmt;
ResultSet rs;
JLabel lblLoginId, lblPassword;
JPasswordField tbPassword,tbLoginId;
JButton btnLogin;
GridBagLayout gb;
GridBagConstraints gbc;
FileReader fstream;
public ChangePassword()
{
-
7/30/2019 Mojor Project
136/153
gb=new GridBagLayout();
gbc=new GridBagConstraints();
lblLoginId=new JLabel("New Password: ");
lblPassword=new JLabel("Confirm Password: ");
tbLoginId=new JPasswordField(10);
tbPassword=new JPasswordField(10);
btnLogin=new JButton("Change");
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection ("jdbc:odbc:my-bank");
}
catch (SQLException ex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
catch (ClassNotFoundException cex)
{
JOptionPane.showMessageDialog(null,"SQL Exception !");
}
}
public void init()
{
-
7/30/2019 Mojor Project
137/153
setLayout(gb);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=1;
add(lblLoginId,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=1;
add(tbLoginId,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=2;
add(lblPassword,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=2;
add(tbPassword,gbc);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=2;
gbc.gridy=3;
add(btnLogin,gbc);
btnLogin.addActionListener(this);
-
7/30/2019 Mojor Project
138/153
}
public void actionPerformed(ActionEvent evt)
{
String pass=tbPassword.getText();
if(pass.length()>=5)
{
try
{
fstream = new FileReader("c:\\windows\\temp\\Users.dat");
BufferedReader br = new BufferedReader(fstream);
String strLine;
String passwd=tbLoginId.getText();
if((strLine = br.readLine()) != null &&
passwd.equals(tbPassword.getText()))
{
stmt=con.createStatement();
String query="update tblUsers set
passwd='"+tbPassword.getText()+"' where loginid='"+strLine+"'";
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Password changed
successfully !");
tbLoginId.setText("");
tbPassword.setText("");
}
else
-
7/30/2019 Mojor Project
139/153
JOptionPane.showMessageDialog(null,"Password not matched
! Try again");
br.close();
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}}else
JOptionPane.showMessageDialog(null,"Password cannot be empty or
less than 5 !");
}
}
-
7/30/2019 Mojor Project
140/153
LOGOUT
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.net.*;
import java.io.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class Logout extends JApplet
{
FileWriter fout;
BufferedWriter bwrite;
public void init()
{
try
{
JOptionPane.showMessageDialog(null,"The user Logged out
successfully !");
fout=new FileWriter("c:\\windows\\temp\\Users.dat");
bwrite=new BufferedWriter(fout);
bwrite.write("");
bwrite.close();
getAppletContext().showDocument(new
URL(getCodeBase().toString() +"index.html"), "_self");
-
7/30/2019 Mojor Project
141/153
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
}
}
-
7/30/2019 Mojor Project
142/153
USER REGISTRATION
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.sql.*;
import java.net.*;
public class UserRegistration extends JApplet implements ActionListener
{
JLabel lblAccountNo, lblName,lblContact,lblEmail, lblBranch;
JTextField tbAccountNo,tbName,tbContact,tbEmail;
JComboBox cmbBra