codes for banking databases

codes for banking databases

sir PLZ give me codes for banking database using java

View Answers

July 31, 2012 at 12:25 PM

import java.util.Scanner;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.ResultSet;

import java.sql.Statement;

import java.util.Date;

public class Bankingdemo2 {

public static void main(String[] args) 

{
    int pinno=0;
    int amount=0;

    int menu;
    int withdraw;
    int transfer=0;
    int update=0;

    Date date =  new Date();

    Connection con = null;

    String url = "jdbc:mysql://localhost:3306/";

    String db = "CLIENT";

    String driver = "com.mysql.jdbc.Driver";

    String user = "root";

    String pass = "";
    int idno[] = {2700,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712};

    Scanner scan = new Scanner(System.in);

    try
    {
        Class.forName(driver);

        con = DriverManager.getConnection(url + db, user, pass);

        System.out.println(date);
        System.out.println("\t"+"Menu"+"\n");
        System.out.println("1. Deposit Amount");
        System.out.println("2. Withdraw Amount");
        System.out.println("3. Display Information");
        System.out.println("4. Transfer Amount ");
        System.out.println("5. Exit");

        boolean quit = false;

        do 

        {

                System.out.print("Please enter your choice: ");

                menu = scan.nextInt();

                switch (menu)

                {

                case 1:                                         //.......DEPOSIT .........//    

                    System.out.println("Enter PIN number : ");  
                    pinno =  scan.nextInt();
                    Statement st1  = con.createStatement();
                    ResultSet res1 = st1.executeQuery("SELECT balance from CLIENT.bank where idno=2701");
                    if(pinno==idno[0])

                    {
                        while (res1.next()) 
                        {
                            System.out.printf("Current Balance  : "+"%,d"+"\n",res1.getInt(1));

                            amount=res1.getInt(1);


                        }
                        System.out.println("");
                        System.out.println("Enter deposit amount : ");
                        withdraw = scan.nextInt();

                        amount = amount + withdraw;
                        System.out.printf("Available balance : "+"%,d"+"\n" ,amount);
                        st1.executeUpdate("update bank set balance='"+amount+"' where idno=2701");
                    }

                        break;




                case 2:                                         

                    //...............................WITHDRAW.........//


                    Statement st2  = con.createStatement();
                    ResultSet res2 = st2.executeQuery("SELECT balance from CLIENT.bank where idno=2701");
                    System.out.println("Enter PIN number : ");  
                    pinno =  scan.nextInt();


                    if(pinno==idno[0])

                    {
                        while (res2.next()) 
                        {

                            System.out.printf("Current Balance  : "+"%,d"+"\n",res2.getInt(1));

                            amount=res2.getInt(1);
                        }

                        System.out.println("");
                        System.out.println("Enter withdraw amount : ");
                        withdraw = scan.nextInt();

                        amount = amount - withdraw;
                        System.out.printf("Available balance : "+"%,d"+"\n" ,amount);
                        st2.executeUpdate("update bank set balance='"+amount+"' where idno=2701");
                    }

                        break;




                case 3:


                    //...............DISPLAY.........//


                    Statement st3  = con.createStatement();
                    ResultSet res3 = st3.executeQuery("SELECT * FROM CLIENT.bank where idno='"+pinno+"' ");
                    System.out.println("Enter PIN number : ");  
                    pinno =  scan.nextInt();

                    if(pinno>=idno[])

                    {
                        while (res3.next()) 
                        {

                        System.out.println(res3.getString(1)+"\t"+res3.getString(2)+"\t"+res3.getString(3)+"\t"+res3.getString(4));
                        }
                    }

                        break;

                case 4: 


                    //.........................TRANSFER.........//


                    Statement st  = con.createStatement();
                    ResultSet res = st.executeQuery("SELECT balance from CLIENT.bank where idno=2701");

                    Statement st4  = con.createStatement();
                    ResultSet res4 = st4.executeQuery("SELECT balance from CLIENT.bank where idno=2707");

                    System.out.println("Enter PIN number : ");  
                    pinno =  scan.nextInt();


                    if(pinno==idno[0])

                    {
                        while (res.next()) 
                        {

                            System.out.printf("Current Balance  : "+"%,d"+"\n",res.getInt(1));

                            transfer=res.getInt(1);
                        }
                        while (res4.next()) 
                        {

                            System.out.printf("Current Balance  : "+"%,d"+"\n",res4.getInt(1));

                            update=res4.getInt(1);
                        }

                        System.out.println("Enter PIN number : ");
                        int pinno1 = scan.nextInt();
                        if(pinno1==idno[6])

                        {



                        System.out.println("Amount to transfer : ");
                        withdraw = scan.nextInt();

                        transfer = transfer - withdraw;

                        update = update + withdraw;

                        System.out.printf("Available balance : "+"%,d"+"\n" ,transfer);
                        st4.executeUpdate("update bank set balance='"+update+"' where idno=2707");
                        st.executeUpdate("update bank set balance='"+transfer+"' where idno=2701");


                    }
                    }

                        break;

                case 5: 
                    System.out.println("Thank You !");

                    quit = true;        //....EXIT...//

                }
        }
        while (!quit);


        con.close();    
    }


    catch (Exception e) 
    {

        System.out.println(e);
     }

}

}









Related Tutorials/Questions & Answers:
codes for banking databases
codes for banking databases  sir PLZ give me codes for banking database using java
codes for banking databases
codes for banking databases  sir plz give me codes for creating a banking database using java
Advertisements
codes for banking databases
codes for banking databases  sir plz give me codes for creating a banking database using netbeans as back end and java as front end
net_banking
net_banking  hi, I am developing a project on net_banking.. and want to know how to calculate the processing fees on loan(home/vehicle/personal)depending upon loan amount
show codes of this
show codes of this  search for the number of occurrence of "and" and "the" in the following sentence by writing a codes. the student like the best teacher at the end of the lessons and others
Banking projecy
Banking projecy  Sir I am designing a banking project where i want... help me   Hi buddy. Please make clear that the banking application you... the technology used is Java.   Hi Ankita. Please make clear that the banking
Switch databases
Switch databases  How do you inter-change between relational databases without code changes
net banking
net banking  hi.... I am developeing a net banking project...and i want coding for following... this module for new loan application... First Name,Last Name, Salaried /business, Current Organization, Resident Address, Office
HTML codes
HTML codes  Hi, I am trying to find HTML codes to learn HTML. Can any one html me? Thanks (adsbygoogle = window.adsbygoogle || []).push({});   Hi, Please check HTML examples and HTML5 Tutorials page
banking with atm
banking with atm  hai am having problem with comparing all arrays i.e how to compare all arrays with single string there is any function please help me. class Compare { main() { int idno[] = {1,2,3,4,5,6}; int input
Databases
databases
databases
databases
databases
databases
banking project database
banking project database  i want to make a project on banking using applet pls help me out in making the project   JSP Bank Application
Databases supported by Jdeveloper?
Databases supported by Jdeveloper?  I want to know what databases are supported by jdeveloper ?and any light database for jdeveloper
ModuleNotFoundError: No module named 'codes'
ModuleNotFoundError: No module named 'codes'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'codes' How to remove the ModuleNotFoundError: No module named 'codes'
ModuleNotFoundError: No module named 'codes'
ModuleNotFoundError: No module named 'codes'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'codes' How to remove the ModuleNotFoundError: No module named 'codes'
ModuleNotFoundError: No module named 'codes'
ModuleNotFoundError: No module named 'codes'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'codes' How to remove the ModuleNotFoundError: No module named 'codes'
ModuleNotFoundError: No module named 'databases'
ModuleNotFoundError: No module named 'databases'  Hi, My Python... 'databases' How to remove the ModuleNotFoundError: No module named 'databases' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'databases'
ModuleNotFoundError: No module named 'databases'  Hi, My Python... 'databases' How to remove the ModuleNotFoundError: No module named 'databases' error? Thanks   Hi, In your python environment you
codes for displaying in calendar
codes for displaying in calendar  can i get jsp codes for displaying comments, when the pointer is placed over the particular date in calendar
online banking application
online banking application  i want to develope online banking application by using jsp with oracle 10g database but i have problem to view the mini statement and balance enquiry...when we entered accontno and pin and select
How to list databases in PostgreSQL
How to list databases in PostgreSQL  Hi, I want to connect to Postgresql database and see all the databases stored in the database. How to list databases in PostgreSQL?   Hi, You can do all these with the psql prompt
ANSI Color Codes with Python
ANSI Color Codes with Python   Use ANSI codes to play with colors and styles. Create a program that will spit out a user inputted string in a color, style, or background color that they can choose. To do this, you'll need
ModuleNotFoundError: No module named 'pod-banking'
ModuleNotFoundError: No module named 'pod-banking'  Hi, My Python... 'pod-banking' How to remove the ModuleNotFoundError: No module named 'pod-banking' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'pod-banking'
ModuleNotFoundError: No module named 'pod-banking'  Hi, My Python... 'pod-banking' How to remove the ModuleNotFoundError: No module named 'pod-banking' error? Thanks   Hi, In your python environment
mobile banking login program
mobile banking login program  static Display dis; static Login destroy; public Login() { dis=Display .get Display(this); } public void startApp() { destroy=this; LoginScreen
files uploding and downloading codes
files uploding and downloading codes  any one know JSP codes for upload files,download files and delete files from a created virtual memory
Needed jsp codes
Needed jsp codes   jsp code for employee payroll.producing a payslip of every employees monthly calculating the gross pay of a particular employee considering the income tax and producing a report which can be printed out
Request for codes - JSP-Servlet
Request for codes  Sir , I am an engineering student i am interested in learning JAVA also i need some example code for creating Registration form codes for creating web based application using JSP sir plz send me which
mysqldump all databases
mysqldump all databases  How to take the backup of complete data including all the databases in the MySQL Server? Is there one command to take...-databases > all_databases.sql Thanks
JanusGraph Supported Databases
JanusGraph Supported Databases  Hi, I want to choose the backend for JanusGraph to store my graphs. Which all databases are supported by JanusGraph... processing engine which supports many back-end databases. Here is the list of database
Merge databases in SQL SErver 2005
Merge databases in SQL SErver 2005  Please help me to merge databases in SQL server 2005
jsp and ejb codes - EJB
jsp and ejb codes  give me the codes to write small shopping cart project.I only want to acess from server.i want to show the client the search place... i all want to develop..please send me the codes in using jsp and ejb.because iI
LINKING PAGES OF PROJECT ON BANKING MANAGEMENT
LINKING PAGES OF PROJECT ON BANKING MANAGEMENT  SIR. pls i want to know how to link pages such that by clicking a button different page gets open on which we can make addition or we can edit?? i m making project on Banking ..pls
ModuleNotFoundError: No module named 'coupon-codes'
ModuleNotFoundError: No module named 'coupon-codes'  Hi, My Python... 'coupon-codes' How to remove the ModuleNotFoundError: No module named 'coupon-codes' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'exit-codes'
ModuleNotFoundError: No module named 'exit-codes'  Hi, My Python... 'exit-codes' How to remove the ModuleNotFoundError: No module named 'exit-codes' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'iata_codes'
ModuleNotFoundError: No module named 'iata_codes'  Hi, My Python... 'iata_codes' How to remove the ModuleNotFoundError: No module named 'iata_codes' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'mobile-codes'
ModuleNotFoundError: No module named 'mobile-codes'  Hi, My Python... 'mobile-codes' How to remove the ModuleNotFoundError: No module named 'mobile-codes' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'prefix-codes'
ModuleNotFoundError: No module named 'prefix-codes'  Hi, My Python... 'prefix-codes' How to remove the ModuleNotFoundError: No module named 'prefix-codes' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'rkm-codes'
ModuleNotFoundError: No module named 'rkm-codes'  Hi, My Python... 'rkm-codes' How to remove the ModuleNotFoundError: No module named 'rkm-codes' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'coupon-codes'
ModuleNotFoundError: No module named 'coupon-codes'  Hi, My Python... 'coupon-codes' How to remove the ModuleNotFoundError: No module named 'coupon-codes' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'exit-codes'
ModuleNotFoundError: No module named 'exit-codes'  Hi, My Python... 'exit-codes' How to remove the ModuleNotFoundError: No module named 'exit-codes' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'funny-codes'
ModuleNotFoundError: No module named 'funny-codes'  Hi, My Python... 'funny-codes' How to remove the ModuleNotFoundError: No module named 'funny-codes' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'iata_codes'
ModuleNotFoundError: No module named 'iata_codes'  Hi, My Python... 'iata_codes' How to remove the ModuleNotFoundError: No module named 'iata_codes' error? Thanks   Hi, In your python environment you
Can you correct this codes?
Can you correct this codes?  Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 4 at searchcon.(searchcon.java:39) at search.initComponents(search.java:41) at search.(search.java:7) at payroll
Simple banking system using Java
Simple banking system using Java  I am trying to make a simple banking system that has only 3 interfaces which does not connect to the database. a person can be able to deposit and withdraw. One interface is the main office

Ads