0% found this document useful (0 votes)
44 views48 pages

BANK Management

The document provides an overview and summary of a banking management system project. It includes sections on acknowledgements, contents, introduction, software requirements, table structure, source code, and input/output interface. The introduction explains that the project creates an application for basic banking functions like account opening, updating accounts, transactions, and reports. The document outlines the necessary system requirements, database tables created, and provides high-level descriptions of the source code and user interfaces.

Uploaded by

Shoot-Em-Up
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views48 pages

BANK Management

The document provides an overview and summary of a banking management system project. It includes sections on acknowledgements, contents, introduction, software requirements, table structure, source code, and input/output interface. The introduction explains that the project creates an application for basic banking functions like account opening, updating accounts, transactions, and reports. The document outlines the necessary system requirements, database tables created, and provides high-level descriptions of the source code and user interfaces.

Uploaded by

Shoot-Em-Up
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 48

BANK Management

System
Acknowledgement
The completion of this undertaking could not have been
possible without the participation and assistance of so many
people whose names may not all be enumerated. Their
contributions are sincerely appreciated and gratefully
acknowledged.
However, I would like to express my deep appreciation and
indebtedness particularly to the following:

 The Principal, Smt. Kavitha N.P for her kind and valuable
support during the course of the project.
 Smt.Aswathy.J, Informatics Practices Teacher, whose
valuable guidance has been the ones that helped me patch
this project and make it full success, her suggestions and
instructions, has served as the major contributor towards the
completion of this project.
 The Computer Department of the school, for providing all the
infrastructural facilities required for the completion of the
project.
 The Great Almighty, relatives, friends and all others, in one
way or another, who helped me in completing the project.
Contents
1. Introduction…………………….
2. Software Requirements………
3. Table Structure………………...
4. Source Code…………………….
5. Input and Output Interface…
Introduction

A bank is a financial institution where all the transactions


relating to money takes place. The functioning of bank is a
complicated process which cash deposits, withdrawal, etc. So
there is a need for an application which can handle these
functions smoothly.
An application for opening an account, updating the existing
account, deleting an account, maintaining records of deposits,
withdrawals, providing reports to the public as well as
management is essential for the smooth functioning of the
bank.
This project is based on the creation of an application for
Banking Management.
Software requirements

System Requirements : Windows XP


Front End :Netbeans Java 6.5.1
Back End : MySQL Sever 5.1
Table Structure
CUSTOMER TABLE
Field Name Type Null Key
Accno Int(11) No Primary Key
Name Varcahr(25) No
Gender Char(10) No
DOB Date No
Address Varchar(100) No
Phone Varchar(10) No
Balance Decimal(10,2) No

TRANSACTIONS TABLE
Field Name Type Null Key
Accno Int(11) No Foreign Key
Trans_id Int(5) No
Trans_date Date No
Trans_type Varchar(10) No
Amount Decimal(10,2) No
Balance Decimal(10,2) No
Balance Decimal(10,2) No
INPUT AND
Output
INTERFACE
WELCOME FORM:

LOGIN FORM:

When user name is correct when user name and password is incorrect:
Main menu form:
CUSTOMER

ADD CUSTOMER FRAME:

Your account is created


SEARCH AND MODIFY THE ACCOUNT FRAME:
DELETE FRAME:
TRANSACTIONS:

DEPOSIT FRAME:

When amount to be credited:


WITHDRAWAL FRAME:

When account is debited:when there is no balance :


DAILY REPORT FRAME:

DAILY COLLECTIONS:
Source code
WELCOME CODE:
private void jButton1ActionPerformed(java.awt.event.ActionEventevt) {

// To open menu interface:

this.dispose();

new login().setVisible(true);

LOGIN CODE:

importjavax.swing.JOptionPane;

private void jButton1ActionPerformed(java.awt.event.ActionEventevt) {

// TO login the bank form:

String username,password;

username=usernametf.getText();

password=passwordtf.getText();

if(username.equals("admin")&&password.equals("admin"))

JOptionPane.showMessageDialog(null,"Login Successful");

this.dispose();

newmainmenu().setVisible(true);

else

JOptionPane.showMessageDialog(null,"Login Unsuccessful \n Try Again! ");

}
private void jButton2ActionPerformed(java.awt.event.ActionEventevt) {

// To clear the textfields:

usernametf.setText("");

passwordtf.setText("");

}
MAIN MENU FORM CODE:

importjavax.swing.JOptionPane;

private void jButton1ActionPerformed(java.awt.event.ActionEventevt) {

// TO exit from the application:

intnum=JOptionPane.showConfirmDialog(null,"Are you Sure to


exit","Exit",JOptionPane.YES_NO_OPTION);

if(num==0)

System.exit(0);

else

this.dispose();

JOptionPane.showMessageDialog(null,"Welcome back!");

newmainmenu().setVisible(true);

private void jMenuItem1ActionPerformed(java.awt.event.ActionEventevt) {

// TO open the customer form:

this.dispose();

new Customer().setVisible(true);

}
private void jMenuItem2ActionPerformed(java.awt.event.ActionEventevt) {

// TO open update form:

this.dispose();

new Update().setVisible(true);

private void jMenuItem3ActionPerformed(java.awt.event.ActionEventevt) {

// TO open delete form:

this.dispose();

new delete().setVisible(true);

private void jMenuItem4ActionPerformed(java.awt.event.ActionEventevt) {

// TO open deposit form:

this.dispose();

new deposit().setVisible(true);

private void jMenuItem5ActionPerformed(java.awt.event.ActionEventevt) {

// TO open withdrawal form:

this.dispose();

new withdrawal().setVisible(true);
private void jMenuItem6ActionPerformed(java.awt.event.ActionEventevt) {

// TO open dailyreport form:

this.dispose();

newdailyreport().setVisible(true);

private void jMenuItem7ActionPerformed(java.awt.event.ActionEventevt) {

// TO open report form:

this.dispose();

new report().setVisible(true);

CUSTOMER TABLE
ADD THE CUSTOMER DETAILS:

importjava.sql.Connection;

importjava.sql.DriverManager;

importjava.sql.Statement;

importjavax.swing.JOptionPane;

private void addbtnActionPerformed(java.awt.event.ActionEventevt) {

// TO create a new accountr:

String gender="";

intaccno=Integer.parseInt(acctf.getText());

String name=nametf.getText();

if(mrb.isSelected())

gender="m";

else if(frb.isSelected())

gender="f";

else

JOptionPane.showMessageDialog(null,"Select the gender");

String dob;

String date=(String) dcmb.getSelectedItem();

String month=(String) mcmb.getSelectedItem();

String year=(String) ycmb.getSelectedItem();

dob=year+"/"+month+"/"+date;

String adress=adressta.getText();

String phone=phonetf.getText();
try

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

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/bank","root","tiger");

Statement stmt=(Statement)con.createStatement();

String query="insert into customer


values("+accno+",'"+name+"','"+gender+"','"+dob+"','"+adress+"','"+phone+"',null);";

stmt.executeUpdate(query);

JOptionPane.showMessageDialog(null,"Your account have been created!");

catch(Exception e){JOptionPane.showMessageDialog(null,e.getMessage());}

private void clearbtnActionPerformed(java.awt.event.ActionEventevt) {

// TO clear all the fields:

acctf.setText("");

nametf.setText("");

buttonGroup1.clearSelection();

ycmb.setSelectedIndex(0);

dcmb.setSelectedIndex(0);

mcmb.setSelectedIndex(0);

adressta.setText("");

phonetf.setText("");

}
private void backbtnActionPerformed(java.awt.event.ActionEventevt) {

// TO go back to mainmenu:

this.dispose();

newmainmenu().setVisible(true);

SEARCH AND MODIFY THE CUSTOMER DETAILS:


importcom.mysql.jdbc.Connection;

importcom.mysql.jdbc.Statement;

importjava.sql.DriverManager;

importjava.sql.ResultSet;

importjavax.swing.JOptionPane;

private void searchbtnActionPerformed(java.awt.event.ActionEventevt) {

// To search cutomer details:

String name,gender="",year="",month="",day="";

acctf.setEditable(false);

intaccno=Integer.parseInt(acctf.getText());

try

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

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/bank","root","tiger");

Statement stmt=(Statement)con.createStatement();

String query="Select accno,name,gender,year(dob)as year,month(dob)as month,day(dob)as


day,address,phone from customer where accno="+accno+";";

System.out.println(query);

ResultSetrs=stmt.executeQuery(query);

if(rs.next())

nametf.setText(rs.getString("name"));

gender=rs.getString("gender");
if(gender.equals("m"))

mrb.setSelected(true);

else if(gender.equals("f"))

frb.setSelected(true);

dcmb.setSelectedItem(rs.getString("day"));

mcmb.setSelectedItem(rs.getString("month"));

ycmb.setSelectedItem(rs.getString("year"));

System.out.println(year);

adressta.setText(rs.getString("address"));

phonetf.setText(rs.getString("phone"));

else

JOptionPane.showMessageDialog(null,"This account does not exist.");

catch(Exception e){JOptionPane.showMessageDialog(null,e.getMessage());

private void updatebtnActionPerformed(java.awt.event.ActionEventevt) {

// TO update the existing account details:

String gender="";

intaccno=Integer.parseInt(acctf.getText());

String name=nametf.getText();

if(mrb.isSelected())
gender="m";

else if(frb.isSelected())

gender="f";

else

JOptionPane.showMessageDialog(null,"Select the gender");

String dob;

String date=(String) dcmb.getSelectedItem();

String month=(String) mcmb.getSelectedItem();

String year=(String) ycmb.getSelectedItem();

dob=year+"/"+month+"/"+date;

String adress=adressta.getText();

String phone=phonetf.getText();

try

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

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/bank","root","tiger");

Statement stmt=(Statement)con.createStatement();

String query1="Update customer set


name='"+name+"',gender='"+gender+"',dob='"+dob+"',address='"+adress+"',phone='"+phone+"'
where accno="+accno+";";

stmt.executeUpdate(query1);

JOptionPane.showMessageDialog(null,"Your account is been updated!");

}
catch(Exception e){JOptionPane.showMessageDialog(null,e.getMessage());}

private void jButton3ActionPerformed(java.awt.event.ActionEventevt) {

// TO clear the fields:

acctf.setText("");

nametf.setText("");

buttonGroup1.clearSelection();

ycmb.setSelectedIndex(0);

dcmb.setSelectedIndex(0);

mcmb.setSelectedIndex(0);

adressta.setText("");

phonetf.setText("");

acctf.setEditable(true);

private void jButton2ActionPerformed(java.awt.event.ActionEventevt) {

// TO go back to main menu:

this.dispose();

newmainmenu().setVisible(true);

DELETE THE CUSTOMER DETAILS:

importcom.mysql.jdbc.Connection;
importcom.mysql.jdbc.Statement;

importjava.sql.DriverManager;

importjava.sql.ResultSet;

importjavax.swing.JOptionPane;

private void searchbtnActionPerformed(java.awt.event.ActionEventevt) {

// TO search cutomer details:

String name,gender="",year="",month,day;

acctf.setEditable(false);

intaccno=Integer.parseInt(acctf.getText());

try

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

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/bank","root","tiger");

Statement stmt=(Statement)con.createStatement();

String query="Select accno,name,gender,year(dob)as year,month(dob)as month,day(dob)as


day,address,phone from customer where accno="+accno+";";

ResultSetrs=stmt.executeQuery(query);

System.out.println(query);

if(rs.next())

nametf.setText(rs.getString("name"));

gender=rs.getString("gender");

if(gender.equals("m"))
mrb.setSelected(true);

else if(gender.equals("f"))

frb.setSelected(true);

System.out.println(year);

dcmb.setSelectedItem(rs.getString("day"));

mcmb.setSelectedItem(rs.getString("month"));

ycmb.setSelectedItem(rs.getString("year"));

adressta.setText(rs.getString("address"));

phonetf.setText(rs.getString("phone"));

else

JOptionPane.showMessageDialog(null,"This account does not exist.");

catch(Exception e){JOptionPane.showMessageDialog(null,e.getMessage());

private void deletebtnActionPerformed(java.awt.event.ActionEventevt) {

// To delete the account:

String gender="";

intaccno=Integer.parseInt(acctf.getText());

String name=nametf.getText();

if(mrb.isSelected())

gender="m";
else if(frb.isSelected())

gender="f";

else

JOptionPane.showMessageDialog(null,"Select the gender");

String dob;

String date=(String) dcmb.getSelectedItem();

String month=(String) mcmb.getSelectedItem();

String year=(String) ycmb.getSelectedItem();

dob=year+"/"+month+"/"+date;

String adress=adressta.getText();

String phone=phonetf.getText();

try

Class.forName("java.sql.DriverManager”);

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/bank","root","tiger");

Statement stmt=(Statement)con.createStatement();

intnum=JOptionPane.showConfirmDialog(null,"Are you Sure to


delete","Delete",JOptionPane.YES_NO_OPTION);

if(num==0)

String query2="select * from transactions where accno="+accno+";";

ResultSetrs=stmt.executeQuery(query2);

if(rs.next())
JOptionPane.showMessageDialog(null,"You cannot delete the account since this account exist in
transaction table");

else

String query1="Delete from customer where accno="+accno+";";

JOptionPane.showMessageDialog(null,"Customer details deleted");

stmt.executeUpdate(query1);

acctf.setText("");

nametf.setText("");

buttonGroup1.clearSelection();

ycmb.setSelectedIndex(0);

dcmb.setSelectedIndex(0);

mcmb.setSelectedIndex(0);

adressta.setText("");

phonetf.setText("");

if(num==1)

JOptionPane.showMessageDialog(null,"Welcome back!");

catch(Exception e)

JOptionPane.showMessageDialog(null,e.getMessage());
}

private void jButton1ActionPerformed(java.awt.event.ActionEventevt) {

// TO go back to main menu:

this.dispose();

newmainmenu().setVisible(true);

DEPOSIT CODING:

importcom.mysql.jdbc.Connection;
importcom.mysql.jdbc.Statement;

importjava.sql.DriverManager;

importjava.sql.ResultSet;

importjavax.swing.JOptionPane;

private void depositbtnActionPerformed(java.awt.event.ActionEventevt) {

// TO deposit cash into an aacount:

inttrans_id;

String trans_date="",code, deposit="";

intaccno=Integer.parseInt(acctf.getText());

double balance=0,newbalance=0;

double amount=Double.parseDouble(amountf.getText());

try

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

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/bank","root","tiger");

Statement stmt=(Statement)con.createStatement();

String query="Select balance from transactions where trans_id in (select max(trans_id)from


transactions)and accno="+accno+";";

ResultSetrs=stmt.executeQuery(query);

if(rs.next())

balance=rs.getDouble("balance");

newbalance=balance+amount;
}

else

newbalance=amount;

rs.close();

String query2="select max(trans_id)+1 as trans_id from transactions;";

rs=stmt.executeQuery(query2);

if (rs.next())

trans_id=rs.getInt(1);

else

trans_id=1;

String query3="select sysdate()as sdate;";

ResultSetsr=stmt.executeQuery(query3);

if(sr.next())

trans_date=sr.getString("sdate");

code="Insert into transactions values


("+accno+","+trans_id+",'"+trans_date+"','deposit',"+amount+","+newbalance+");";

stmt.executeUpdate(code);

String query4="Update customer set balance="+newbalance+" where accno="+accno+";";

stmt.executeUpdate(query4);

JOptionPane.showMessageDialog(null,"Your account is been creditted with "+amount);

catch (Exception e)

JOptionPane.showMessageDialog(null,e.getMessage());
}

private void formWindowOpened(java.awt.event.WindowEventevt) {

// TO find current date:

String dates="";

try

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

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/bank","root","tiger");

Statement stmt=(Statement)con.createStatement();

String query5="Select curdate()as cdate;";

ResultSetrs=stmt.executeQuery(query5);

if(rs.next())

dates=rs.getString("cdate");

daytf.setText(""+dates);

catch (Exception e)

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

private void jButton1ActionPerformed(java.awt.event.ActionEventevt) {


// TO go back to main menu:

this.dispose();

newmainmenu().setVisible(true);

WITHDRAWAL CODING:

importcom.mysql.jdbc.Connection;

importcom.mysql.jdbc.Statement;
importjava.sql.DriverManager;

importjava.sql.ResultSet;

importjavax.swing.JOptionPane;

private void withdrawalbtnActionPerformed(java.awt.event.ActionEventevt) {

// TO withdraw cash from the account:

inttrans_id;

String trans_date="",code;

double withdrawal=0;

intaccno=Integer.parseInt(acctf.getText());

double balance=0,newbalance=0;

double amount=Double.parseDouble(amountf.getText());

try

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

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/bank","root","tiger");

Statement stmt=(Statement)con.createStatement();

String query="Select balance from transactions where trans_id in (select max(trans_id)from


transactions)and accno="+accno+";";

ResultSetrs=stmt.executeQuery(query);

if(rs.next())

balance=rs.getDouble("balance");

newbalance=balance-amount;
if(newbalance<0)

JOptionPane.showMessageDialog(null,"You don't have enough balance");

newbalance=balance;

else

JOptionPane.showMessageDialog(null,"Your account have no credit balance");

if(balance>=amount)

String query2="select max(trans_id)+1 as trans_id from transactions;";

rs=stmt.executeQuery(query2);

if (rs.next())

trans_id=rs.getInt(1);

else

trans_id=1;

String query3="select sysdate()as sdate;";

ResultSetsr=stmt.executeQuery(query3);

if(sr.next())

trans_date=sr.getString("sdate");

code="Insert into transactions values


("+accno+","+trans_id+",'"+trans_date+"','withdrawal',"+amount+","+newbalance+");";

stmt.executeUpdate(code);

String query4="Update customer set balance="+newbalance+" where accno="+accno+";";


stmt.executeUpdate(query4);

JOptionPane.showMessageDialog(null,"Your account is been debited by "+amount);

catch (Exception e)

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

private void formWindowOpened(java.awt.event.WindowEventevt) {

// TO find the current date:

String dates="";

try

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

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/bank","root","tiger");

Statement stmt=(Statement)con.createStatement();

String query5="Select curdate()as cdate;";

ResultSetrs=stmt.executeQuery(query5);

if(rs.next())

dates=rs.getString("cdate");

daytf.setText(""+dates);
}

catch (Exception e)

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

private void jButton1ActionPerformed(java.awt.event.ActionEventevt) {

// TO go back to main menu:

this.dispose();

newmainmenu().setVisible(true);

DAILY REPORT CODE:

importcom.mysql.jdbc.Connection;

importcom.mysql.jdbc.Statement;
importjava.sql.DriverManager;

importjava.sql.ResultSet;

importjavax.swing.JOptionPane;

importjavax.swing.table.DefaultTableModel;

private void jButton1ActionPerformed(java.awt.event.ActionEventevt) {

// TO display customer details:

DefaultTableModel model=(DefaultTableModel)

customer.getModel();

try

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

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/bank","root","tiger");

Statement stmt=(Statement)con.createStatement();

String query="select * from customer;";

ResultSetrs=stmt.executeQuery(query);

while(rs.next())

String accno=rs.getString("accno");

String name=rs.getString("name");

String gender=rs.getString("gender");

String dob=rs.getString("dob");

String adress=rs.getString("address");
String phone=rs.getString("phone");

double balance=rs.getDouble("balance");

model.addRow(new Object[]{accno,name,gender,dob,adress,phone,balance});

catch(Exception e)

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

private void jButton2ActionPerformed(java.awt.event.ActionEventevt) {

// TO delete the rows:

DefaultTableModel model=(DefaultTableModel)customer.getModel();

int rows=model.getRowCount();

if(rows>0)

for(inti=0;i<rows;i++)

model.removeRow(0);

private void jButton3ActionPerformed(java.awt.event.ActionEventevt) {

// TO go back to main menu:


this.dispose();

newmainmenu().setVisible(true);

DAILY COLLECTION CODE:

importcom.mysql.jdbc.Connection;

importcom.mysql.jdbc.Statement;
importjava.sql.DriverManager;

importjava.sql.ResultSet;

importjavax.swing.JOptionPane;

private void formWindowActivated(java.awt.event.WindowEventevt) {

// To show daily report:

String date;

double net=0;

int result=0;

depositf.setEditable(false);

datetf.setEditable(false);

withdrawaltf.setEditable(false);

nettf.setEditable(false);

try

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

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/bank","root","tiger");

Statement stmt=(Statement)con.createStatement();

//Retrieving total amount of deposit:

String query="select sum(amount)as sum,curdate()as date from transactions where


trans_type='deposit' and trans_date=curdate();";

System.out.println(query);

ResultSetrs=stmt.executeQuery(query);

if(rs.next())
{

date=rs.getString("date");

datetf.setText(""+date);

result=rs.getInt("sum");

depositf.setText(""+result);

//Retrieving total amount of withdrawal:

String query1="select sum(amount)as sum from transactions where trans_type='withdrawal'


and trans_date=curdate();";

ResultSet rs1=stmt.executeQuery(query1);

System.out.println(query1);

if(rs1.next())

result=rs1.getInt("sum");

withdrawaltf.setText(""+result);

// To find the net amount:

int deposit=Integer.parseInt(depositf.getText());

int withdrawal=Integer.parseInt(withdrawaltf.getText());

net=deposit-withdrawal;

nettf.setText(""+net);

catch(Exception e)

{
JOptionPane.showMessageDialog(null,e.getMessage());

private void backbtnActionPerformed(java.awt.event.ActionEventevt) {

// TO go back to main menu:

this.dispose();

newmainmenu().setVisible(true);

You might also like