ImageVerifierCode 换一换
格式:DOCX , 页数:70 ,大小:56.03KB ,
资源ID:11398045      下载积分:16 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/11398045.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(Java银行管理系统源代码.docx)为本站上传会员【精****】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

Java银行管理系统源代码.docx

1、 Java银行管理系统源代码 70 2020年4月19日 文档仅供参考 Java小型银行管理系统源代码(图形界面) accounts.java package Account; public class accounts { protected int id;//银行账号 protected String password;//用户密码 protected String name;//用户型号 protected String personId;//身份账号 protected int accountType;//账号

2、类型,0代表储蓄卡,1代表信用卡 protected double balance;//账户余额。之因此定义为protected是让她的子类能够直接用,不需要经过方法来赋值。 protected double ceiling; public String getPassword(){ return password; } public void setPassword(String password){ this.password=password; } public String getName(){ return name; }

3、 public void setName(String name){ this.name=name; } public String getPersonId(){ return personId; } public void setPersonId(String personId){ this.personId=personId; } public int getAccountType(){ return accountType; } public void setAccountType(int account

4、Type){ this.accountType=accountType; } public double getBalance(){ return balance; } public void setBalance(double balance){ this.balance=balance; } public int getId(){ return id; } public void setId(int id){ this.id=id; } public double getCeiling(){

5、 return ceiling; } public void setCeiling(double ceiling){ this.ceiling=ceiling; } //无参数构造方法 public accounts(){ } //构造方法 public accounts(String password,String name,String personId,int accountType, double balance,double ceiling){ super(); this.password=pa

6、ssword; this.name=name; this.personId=personId; this.accountType=accountType; this.balance=balance; this.ceiling=ceiling; } //存款 public void deposit(double money){ balance+=money; } //取款 public void withdraw(double money){ if(accountType==1){ if((balance+ce

7、iling)

8、t; import Account.accounts; public class DBoper { private Connection conn = null; private Statement st = null; private PreparedStatement pstmt = null; private ResultSet rs = null; private ArrayList result; //连接数据库 public Connection getConnection(){ try{ Clas

9、s.forName("com.mysql.jdbc.Driver"); conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/bankmanager?useUnicode=true&characterEncoding=utf8","root","xuewei"); }catch(Exception e){ System.out.println("数据库连接失败"); } return conn; } //修改 删除用户数据 public boolean accountDa

10、taUpdate(String sql){ conn=getConnection(); try{ pstmt=conn.prepareStatement(sql); pstmt.executeUpdate(); //System.out.println("数据更新成功"); conn.close(); return true; }catch(SQLException e){ e.printStackTrace(); //System.out.println("更新失败"); return false; }

11、 } //依据id来修改记录 public boolean dataupdateid(accounts user, int id) { conn = getConnection(); try { String sql = "update account set username=?,userpwd=?,personId=?,accountType=?,balance=?,ceiling=? where id=" + id; pstmt = conn.prepareStatement(sql); pstmt.setString(

12、1, user.getName()); pstmt.setString(2, user.getPassword()); pstmt.setString(3, user.getPersonId()); pstmt.setInt(4, user.getAccountType()); pstmt.setDouble(5, user.getBalance()); pstmt.setDouble(6, user.getCeiling()); pstmt.executeUpdate(); System.out.println("操作成功");

13、 return true; } catch (SQLException e) { e.printStackTrace(); System.out.println("操作失败"); return false; } } //插入用户数据 public boolean accountDataInsert(accounts account){ conn=getConnection(); try{ pstmt=conn.prepareStatement("insert into account (username,

14、userpwd,personId,accountType,balance,ceiling) values (?,?,?,?,?,?)"); pstmt.setString(1, account.getName()); pstmt.setString(2, account.getPassword()); pstmt.setString(3, account.getPersonId()); pstmt.setInt(4, account.getAccountType()); pstmt.setDouble(5, account.getBalance());

15、 pstmt.setDouble(6, account.getCeiling()); pstmt.executeUpdate(); System.out.println("新用户数据插入成功"); conn.close(); return true; }catch(SQLException e){ e.printStackTrace(); System.out.println("插入失败"); return false; } } //查询数据 public ResultSet dataquery(Str

16、ing sql) { conn = getConnection(); try { pstmt = conn.prepareStatement(sql); rs = pstmt.executeQuery(); } catch (SQLException e) { e.printStackTrace(); System.out.println("检索失败"); } return rs; } public ResultSet testlist() { try { String sql = "s

17、elect * from account where id =1001"; pstmt = conn.prepareStatement(sql); System.out.println(sql); rs = pstmt.executeQuery(); } catch (SQLException e) { e.printStackTrace(); System.out.println("检索失败"); } return rs; } public ArrayList testt(int id) {

18、 ArrayList list = new ArrayList(); conn = getConnection(); try { String sql = "select * from account where id=" + id; pstmt = conn.prepareStatement(sql); rs = pstmt.executeQuery(); while (rs.next()) { accounts user = new accounts(); user.setName(rs

19、getString("username")); user.setPassword(rs.getString("userpwd")); user.setPersonId(rs.getString("personId")); user.setAccountType(rs.getInt("accountType")); user.setBalance(rs.getDouble("balance")); user.setCeiling(rs.getDouble("ceiling")); list.add(user); }

20、} catch (SQLException e) { e.printStackTrace(); System.out.println("检索失败"); } return list; } //根据卡号和密码验证用户是否存在 public boolean verify(int id,String password){ conn=getConnection(); try{ pstmt=conn.prepareStatement("select * from account where id=? and userpwd=?")

21、 pstmt.setInt(1, id); pstmt.setString(2, password); rs=pstmt.executeQuery(); if(rs.next()){ return true; }else{ return false; } }catch(SQLException e){ e.printStackTrace(); return false; } } /** * 登录验证 */ public accounts verifyAccount(i

22、nt id, String password) { boolean flag = verify(id, password); if(flag){ accounts account=queryByIDandPassword(id, password); return account; } else { System.out.println("用户不存在!"); return null; } } //根据卡号和密码查询信息 public accounts queryByIDandPassword(int

23、 id,String password){ conn=getConnection(); try{ pstmt=conn.prepareStatement("select * from account where id=? and userpwd=?"); pstmt.setInt(1, id); pstmt.setString(2, password); rs=pstmt.executeQuery(); accounts account=new accounts(); while(rs.next()){ account.se

24、tId(rs.getInt("id")); account.setName(rs.getString("username")); account.setPassword(rs.getString("userpwd")); account.setPersonId(rs.getString("personId")); account.setAccountType(rs.getInt("accountType")); account.setBalance(rs.getDouble("balance")); account.setCeilin

25、g(rs.getDouble("ceiling")); } return account; }catch(SQLException e){ e.printStackTrace(); return null; } } //根据卡号查询信息 public accounts queryByID(int id){ conn=getConnection(); try{ pstmt=conn.prepareStatement("select * from account where id=?"); pstmt.set

26、Int(1, id); rs=pstmt.executeQuery(); accounts account=new accounts(); while(rs.next()){ account.setId(rs.getInt("id")); account.setName(rs.getString("username")); account.setPassword(rs.getString("userpwd")); account.setPersonId(rs.getString("personId")); account

27、setAccountType(rs.getInt("accountType")); account.setBalance(rs.getDouble("balance")); account.setCeiling(rs.getDouble("ceiling")); } return account; }catch(SQLException e){ e.printStackTrace(); return null; } } public static void main(String[] args) { // TODO

28、 Auto-generated method stub DBoper op=new DBoper(); ArrayList list=op.testt(1001); for(int i=0;i

29、r.getPersonId()); System.out.println(user.getAccountType()); System.out.println(user.getBalance()); System.out.println(user.getCeiling()); } } } //图像界面文件夹 DN_SYSTEM Default.java //主界面 package DN_SYSTEM; import java.awt.Color; import java.awt.Container; import java.a

30、wt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.WindowConstants; import Account.accounts; import DB.DBoper; publ

31、ic class Default extends JFrame implements ActionListener{ accounts account=DN_ATM.client; DBoper db=new DBoper(); private JFrame jf; private JButton btn0,btn1,btn2,btn3,btn4,btn5; private Container c; public void defaltDemo() { //添加主界面卡片 //DN_ATM.id; int id=DN_ATM.id;

32、 //account=db.queryByID(id); jf=new JFrame("DEFAULT"); c=jf.getContentPane(); c.setLayout(null); c.setBackground(new Color(119,119,253)); JLabel lblwel = new JLabel("欢迎"+account.getName()+"用达能银行ATM系统"); lblwel.setBounds(20, 15, 350, 30); c.add(lblwel); JLabel lb

33、lwel1 = new JLabel("请选择您需要的交易类型"); lblwel1.setBounds(120, 45, 350, 30); c.add(lblwel1); btn1 = new JButton("取款服务"); btn1.addActionListener(this); btn1.setBounds(70, 90, 100, 30); c.add(btn1); btn2=new JButton("存款服务"); btn2.addActionListener(this); btn2.setBounds(21

34、0, 90, 100, 30); c.add(btn2); btn3 = new JButton("查询余额"); btn3.addActionListener(this); btn3.setBounds(70, 150, 100, 30); c.add(btn3); btn4 = new JButton("转账服务"); btn4.addActionListener(this); btn4.setBounds(210, 150, 100, 30); c.add(btn4); btn5 = new JButto

35、n("注销账户"); btn5.addActionListener(this); btn5.setBounds(70, 210, 100, 30); c.add(btn5); btn0 = new JButton("退出操作"); btn0.addActionListener(this); btn0.setBounds(210, 210, 100, 30); c.add(btn0); jf.setVisible(true); jf.setResizable(false); jf.setSize(400,30

36、0); jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); } //事件处理 @Override public void actionPerformed(ActionEvent e){ //取款服务 if(e.getSource().equals(btn1)){ OutMoney outmoney=new OutMoney(); outmoney.outMoney(); jf.dispose(); } //存款服务 if(e.

37、getSource().equals(btn2)){ InMoney inmoney=new InMoney(); inmoney.InMoney(); jf.dispose(); } //查询余额 if(e.getSource().equals(btn3)){ GetBalance getbalance=new GetBalance(); getbalance.getBalance(); jf.dispose(); } //转账服务 if(e.getSource().equals(btn4))

38、{ TransferAccounts tranfer=new TransferAccounts(); tranfer.transferAccounts(); jf.dispose(); } //注销账户 if(e.getSource().equals(btn5)){ String sql="delete from account where id="+account.getId(); boolean flag=db.accountDataUpdate(sql); if(flag){ JOptionPane.sh

39、owMessageDialog(this,"注销成功!"); } else{ JOptionPane.showMessageDialog(this, "注销失败!"); } } if(e.getSource().equals(btn0)){ System.exit(0); } } public static void main(String[] args) { // TODO Auto-generated method stub Default defaults=new Default(); de

40、faults.defaltDemo(); } } DN_ATM.java //功能界面 package DN_SYSTEM; import java.awt.CardLayout; import java.awt.Color; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.AbstractButton; import javax.swing.JButton; i

41、mport javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JTextField; import DB.DBoper; import Account.accounts; public class DN_ATM extends JFrame implements ActionListener{ pri

42、vate JLabel lbljixu; private JButton btngetcard; private JButton btncard,btn010,btn_addAccount,btnsure,btnback; private JTextField txt1; private JPasswordField txt2; private Container container; private CardLayout Layout; private JLabel lblwrong; private JPanel panelfirst,panelmain;

43、 public static int id; static accounts client = null; public DN_ATM(){ super("达能银行"); this.setSize(435, 350); this.setLocation(500,250); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //设置不可改变窗口大小 this.setResizable(false); } //布局 public void setLayout()

44、{ //用卡片布局 Layout = new CardLayout(); container = getContentPane(); container.setLayout(Layout); //添加第一张卡片 panelfirst = new JPanel(null); //设置卡片的背景颜色 panelfirst.setBackground(new Color(119,119,253)); lbljixu = new JLabel("请放入磁卡,然后继续操作"); //设置卡片在Panel中的位置

45、 lbljixu.setBounds(140, 90, 350, 30); //为第一张卡片添加一个Label panelfirst.add(lbljixu); //为第一张卡片添加一个按钮 btncard = new JButton("继续"); btncard.setBounds(310, 180, 80, 30); //为按钮注册事件监听器 btncard.addActionListener(this); //开始时设置按钮不可按 btncard.setEnabled(false); panel

46、first.add(btncard); //为第一张卡片添加一个按钮 btngetcard = new JButton("取卡"); btngetcard.setEnabled(false); btngetcard.setBounds(310, 220, 80, 30); btngetcard.addActionListener(this); panelfirst.add(btngetcard); //添加登录输入卡片 panelmain = new JPanel(null); panelmain.se

47、tBackground(new Color(119,119,253)); //添加登录输入卡号 JLabel lblnumber = new JLabel("请输入您的银行卡卡号:"); panelmain.add(lblnumber); lblnumber.setBounds(30, 30, 150, 30); //设置文本框为密码型 txt1 = new JTextField(12); //文本框不可选中 //txt1.enable(false); panelmain.add(txt1);

48、txt1.setBounds(170, 30, 200, 30); JLabel lblpwd = new JLabel("请输入您的银行卡密码:"); panelmain.add(lblpwd); lblpwd.setBounds(30, 80, 150, 30); //设置文本框为密码型 txt2 = new JPasswordField(12); //文本框不可选中 //txt2.enable(false); panelmain.add(txt2); //文本框的输入内容用*显示 txt2

49、setEchoChar('*'); txt2.setBounds(170, 80, 200, 30); //添加选择按钮 btnsure = new JButton("确定"); btnsure.addActionListener(this); panelmain.add(btnsure); btnsure.setBounds(70, 160, 80, 30); //添加重输按钮 btn010 = new JButton("重输"); btn010.addActionListener(this);

50、 panelmain.add(btn010); btn010.setBounds(175,160,80,30); btnback = new JButton("退出"); btnback.addActionListener(this); panelmain.add(btnback); btnback.setBounds(280, 160, 80, 30); //开户 btn_addAccount = new JButton("开户"); btn_addAccount.setBounds(70, 220, 8

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服