Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Magazine codes for banking databases

Have Programming Question? Ask it here!
 
 
 


siddharth kothari
codes for banking databases
1 Answer(s)      2 years and 9 months ago
Posted in : Java Magazine


sir PLZ give me codes for banking database using java


Advertisement
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 creating a banking database using java
codes for banking databases
codes for banking databases  sir PLZ give me codes for 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
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
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
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
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
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
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
Switch databases
Switch databases  How do you inter-change between relational databases without code changes
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
HTML codes
HTML codes  Hi, I am trying to find HTML codes to learn HTML. Can any one html me? Thanks   Hi, Please check HTML examples and HTML5 Tutorials page. Thanks
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
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
Databases supported by Jdeveloper?
Databases supported by Jdeveloper?  I want to know what databases are supported by jdeveloper ?and any light database for jdeveloper
please send me the banking data base in swings
please send me the banking data base in swings  sir, please send me how to create the banking data base program in swings
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
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
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
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
about banking application - Servlet Interview Questions
about banking application  i put 2+ fake on banking application the interviewers are asking me where u used servlets,jsp and how .they are also asking about the how you r using jdbc (rdbms oracle). tell about this problem  
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
Merge databases in SQL SErver 2005
Merge databases in SQL SErver 2005  Please help me to merge databases in SQL server 2005
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
java sorting codes - Java Beginners
java sorting codes  I want javasorting codes. please be kind enogh and send me the codes emmediately///  Hi Friend, Please visit the following link: http://www.roseindia.net/java/beginners/arrayexamples/ Here
No complete codes for Simple Form Controlle Example
No complete codes for Simple Form Controlle Example  No complete codes
Biological Databases Links
Biological Databases       Biological Databases are like any other databases... databases: Biological Database Links
Upgrading databases between MySQL 5.0 to MySQL 5.5
Upgrading databases between MySQL 5.0 to MySQL 5.5  Upgrading databases between MySQL 5.0 to MySQL 5.5
HTML color codes
HTML Color Codes In this tutorial we will show you how to get the different color codes for designing your HTML pages. You will be able to find the  hexadecimal color code by color name. We have also provided the tool to create
is it possible to connect the multiple databases from the hibernate application
is it possible to connect the multiple databases from the hibernate application  is it possible to connect the multiple databases from the hibernate application,if it is possible then tell me with step wise manner
HTML Color Codes
:5px 0px 5px 5px; } HTML Web color codes In this page we have created a list of most used HTML Web color codes. We have shown the color... color codes: Name/String Code Name Code
Hibernate 4 Supported Databases List
Hibernate 4 Supported Databases List In this tutorial you will learn that how many databases are supported by Hibernate. Hibernate supports various of databases. Here we are giving some of the Hibernate supported database list
what are the codes for uploading and downloading files in and from database?
what are the codes for uploading and downloading files in and from database?  We are designing a student's website where they can get and post study materials. We actually need the code to upload and download files in and from
need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql
need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql  i am working on a project... to know that how to query multiple databases(databases created in my mysql) so
what is wrong with my JSP codes for updating a form?
what is wrong with my JSP codes for updating a form?  Hi experts, I have tried to emulate a code from a textbook but it doesn't work in my program.... Name - String. Here's snippet of my codes:- <% Connection conn = null
Java Servlet - matching 2 databases - Java Beginners
"A BIG THANK YOU" for helping me about the matching codes. It is working now after
can u help me to get a calendar with color codes on days ???
can u help me to get a calendar with color codes on days ???  hi roseindia, Can you help me to get the code, I need a calendar with color codes.i,e Sunday,Saturday dates display in blue color and my calendar should takes
Advertisements
 

 

 

DMCA.com