1 / 14

Fault Tolerant Banking System

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

morley
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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fault Tolerant Banking System

  2. Overview • Project Goal • Project Description • Project Structure • Test Cases • Screenshots

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

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

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

  6. 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 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); } %>

  7. 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(); %>

  8. Screenshots

  9. Screenshot for deposit

  10. Screenshot for balance check

  11. Screenshot for Withdraw

  12. Screenshot before updation is done

  13. Screenshot after deposit is done

  14. Screenshot after withdraw

More Related