Fault tolerant banking system
This presentation is the property of its rightful owner.
Sponsored Links
1 / 14

Fault Tolerant Banking System PowerPoint PPT Presentation


  • 77 Views
  • Uploaded on
  • Presentation posted in: General

Fault Tolerant Banking System. Overview. Project Goal Project Description Project Structure Test Cases Screenshots. Project Goal.

Download Presentation

Fault Tolerant Banking System

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Fault tolerant banking system

Fault Tolerant Banking System


Overview

Overview

  • Project Goal

  • Project Description

  • Project Structure

  • Test Cases

  • Screenshots


Project goal

ProjectGoal

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.


Project description

ProjectDescription

  • 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.


Project structure

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.


Test cases

Test Cases

The Main page consists a part of code which syncs

the two databases every time when an update is

done 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 [email protected]";

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);

}

%>


Test cases1

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.*" %>

    <[email protected] 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();

    %>


Screenshots

Screenshots


Screenshot for deposit

Screenshot for deposit


Screenshot for balance check

Screenshot for balance check


Screenshot for withdraw

Screenshot for Withdraw


Screenshot before updation is done

Screenshot before updation is done


Screenshot after deposit is done

Screenshot after deposit is done


Screenshot after withdraw

Screenshot after withdraw


  • Login