Top Banner
FAULT TOLERANT BANKING SYSTEM
14

Fault Tolerant Banking System

Jan 21, 2016

Download

Documents

Morley

Fault Tolerant Banking System. Overview. Project Goal Project Description Project Structure Test Cases Screenshots. Project Goal. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Fault Tolerant Banking System

FAULT TOLERANT BANKING SYSTEM

Page 2: Fault Tolerant Banking System

OVERVIEW

Project Goal Project Description Project Structure Test Cases Screenshots

Page 3: Fault Tolerant Banking System

PROJECT GOAL

This is a scenario where a user requests a transaction to the bank database server. During this transaction, if there is an error like database server suddenly stops responding. Then, to provide the service to the customer with out any interference even if the server is down is the main goal of this Fault Tolerant Banking System.

Page 4: Fault Tolerant Banking System

PROJECT DESCRIPTION This project handles the situation where a

user requests for a transaction to the Bank Database server, while the database is down.

This is done by using two databases which are replicated.

That is, when one database is down we connect the request to the other database and provide the service to the user without any interruption or fault.

Page 5: Fault Tolerant Banking System

PROJECT STRUCTURE

Firstly, I create two databases and replicated the data in them.

After replicating, I created a JSP page which consists of a HTML form which takes the data from user and passes those parameter correspondingly.

From Main page we move on to other JSP pages (withdraw, deposit, check balance) where we process the transaction as user requested.

Created some other JSP pages which handle the exception in the code like if one database is down

We throw an exception and handle it in the exception handler page by connecting to other database complete the transaction.

Page 6: Fault Tolerant Banking System

TEST CASES

The Main page consists a part of code which syncsthe two databases every time when an update isdone to one of the tables.Class.forName("oracle.jdbc.OracleDriver");Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:rani","system","usha");Statement stm=null;String rec="select * from customer minus select * from customer@link2";Statement stmt2=null;stmt2=con.createStatement();Statement stm2=conn.createStatement();int mod1= stm2.executeUpdate(re);int mod=stmt2.executeUpdate(rec);if(mod==1){String rec1="update rani.customer set rani.customer.amount=orcl.customer.amount where

rani.customer.acc_no=orcl.customer.acc_no ";stmt=conn.createStatement();stmt.executeUpdate(rec1);}if(mod1==1) { String rec1="update orcl.customer set orcl.customer.amount=rani.customer.amount where

orcl.customer.acc_no=rani.customer.acc_no ";stmt=con.createStatement();stmt.executeUpdate(rec1); }%>

Page 7: Fault Tolerant Banking System

TEST CASES: If during an operation, one of the database does not respond then we check whether the other database is used for further

processing of operation or transaction.<%@ page isErrorPage="true" import="java.io.*" %><%@page language="java" import="java.lang.*" import="java.sql.*" import="java.math.*"%><html><head> <title> </title>

<style type="text/css">body, p { font-family:Tahoma; font-size:10pt; padding-left:30; }pre { font-size:8pt; }</style>

</head><body> <%String str=request.getParameter("r1");String account_no_1=request.getParameter("account_no");int ID2=Integer.parseInt(account_no_1);String amount_1=request.getParameter("amount");int ID=Integer.parseInt(amount_1);Class.forName("oracle.jdbc.OracleDriver");Connection con= DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:rani","system","usha");String rec="Update customer set amount= amount + "+ID+" where acc_no='"+ID2+"'";Statement stmt=con.createStatement();int mod=stmt.executeUpdate(rec);if(mod==1){%><script type="text/JavaScript">alert("Deposit Completed Successfully");document.write('account number:', +account_no_1,'updated with amount:', +id,'currently the balance in the account is:', +amount);</script><%}%><%con.commit();stmt.close();con.close();%>

Page 8: Fault Tolerant Banking System

SCREENSHOTS

Page 9: Fault Tolerant Banking System

SCREENSHOT FOR DEPOSIT

Page 10: Fault Tolerant Banking System

SCREENSHOT FOR BALANCE CHECK

Page 11: Fault Tolerant Banking System

SCREENSHOT FOR WITHDRAW

Page 12: Fault Tolerant Banking System

SCREENSHOT BEFORE UPDATION IS DONE

Page 13: Fault Tolerant Banking System

SCREENSHOT AFTER DEPOSIT IS DONE

Page 14: Fault Tolerant Banking System

SCREENSHOT AFTER WITHDRAW