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

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/8203370.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)为本站上传会员【pc****0】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

java信用卡在线管理.docx

1、 合肥学院 计算机科学与技术系 课程设计报告 2012~2013学年第一学期 课程 Java课程设计 课程设计名称 信用卡在线管理系统 专业班级 11计本(4)班 姓名 黄伟 指导教师 张贯虹 胡春玲 2013年1月 一. 需求分析 1、课程设计名称及内容 课程设计名称:信用卡在线管理系统 设计内容:设计一个信用卡管理系统,实现基于网络管理信用卡信息。 2、任务和要求 系统用户分为管理员、注册用户和普通用户。 a) 提供注册功能,系统的访问者可以注册成为注册用户,注册信息包括卡号、密码和其他个人信息。注册用户没有任

2、何操作权限,必须经管理员审批通过后成为普通用户才有权操作。新注册的用户,卡上初始金额为0。 b) 普通用户可以执行现金转入、现金转出、个人信息修改、余额查询和交易记录查询功能。 c) 用户可以录入转入金额和转出金额,当转出金额大于信用卡的余额时,须判断透支金额是否在本卡的信用额度内(信用额度由管理员设定),如果在则允许透支,否则拒绝支出。 d) 当信用卡发生透支后,在20天内不计利息,20天后按每天1%计算利息,当透支金额+透支利息超过本卡的信用额度,则本卡自动转入“黑名单”(利息继续计算),不再允许进行现金转出操作。 e) 普通用户可以随时查看卡内余额。 f) 普通用户可以按时间段

3、查看交易记录,包括转入、转出和透支情况。 g) 管理员可以审核注册用户,设定用户信用额度,批准成为普通用户。 h) 管理员可以查看系统内的黑名单,包括卡号和透支额度。 二. 设计 1.数据库设计思想: (1)数据库的设计:我们使用的数据库是Microsoft SQL 2005。 创建record和user表: create database card; use card; create table record ( id int not null primary key , fromId varchar(100) not null,

4、toId varchar(50) not null, money float not null, tradetime datetime ); create table user1 ( id varchar(50) primary key not null, password varchar(50) not null, name varchar(100) not null, type int , money float , credit float , overdraft float , blackli

5、st int );、 交易表 用户表 (2)对数据库的操作 Insert主要时用来对数据库进行插入操作,例如在record表中插入一条记录为, public boolean insert ( Record record ){ String sql = "insert into record(id,fromId,toId,money,tradetime) values(?,?,?,?,?)"; try { PreparedStatement pre = conn.prepareStatement(sql); Calendar calendar=Cal

6、endar.getInstance(); calendar.setTime(record.getTradetime()); pre.setInt(1 , record.getId()); pre.setString(2 , record.getFromId()); pre.setString(3 , record.getToId()); pre.setDouble(4 , record.getMoney()); pre.setDate(5 , record.getTradetime()); pre.execute(); retur

7、n true; } catch (SQLException e) { e.printStackTrace(); } return false; } Delete是多数据表中的记录加以删除,例如对user表中的记录删除操作为: public boolean delete ( User user ){ String sql = "delete from [user] where id=?"; try { PreparedStatement pre = conn.prepareStatement(sql); pre.setString(1

8、 user.getId()); pre.execute(); return true; } catch (SQLException e) { e.printStackTrace(); } return false; } Update是对数据库中的信息加以修改! findAll是查找数据库中的所有记录! findById是通过用户给定的id好来对数据库进行扫描,查找出所有与输入的id相匹配的信息! 同时也可以根据其他的关键字对数据库进行查找查找,例如是否是黑名单,是否已经有透支额了等等,具体的实现见代码! 2.java程序的设计:

9、主要以下几个包: --bean --User表示的是user表中的一条记录 --Record表示的是record表中的一条记录 --ChangePasswordBean是对修改密码时的所有属性的封装 --zhucBean是在新用户注册时的一条记录,主要包括属性id ,password ,name ;以及set和get方法! --dao --DBConnection用于连接数据库 --RecordDAO接口是封装对数据表Record的操作 --UserDAO接口是封装对数据表User的操作 --exception --

10、inputChangePasswordInfoNotRightException是用来显示输入的修改密码的出错的信息! --InputGetNumNotRightException是用户输入的取款金额不合法异常 --InputSetNumNotRightException是用户输入的存款金额不合法异常 --LoginInfoNotRightException 是用户登陆是的不合法异常 --imp --RecordDAOImp是对接口RecordDAO中的方法的实现。 --UserDAOImp是对接口UserDAO中方法的实现。 --service --Cha

11、ngePasswordService是对修改密码服务中可能出现的不正常信息加以分类并且予以处理。 --GetService是对用户输入的取款信息的不正常信息加以分类并且予以处理。 -- LoginService是对用户在登陆时输入信息的不正常信息加以分类并且予以处理。 -- SetService是对用户输入的存款信息的不正常信息加以分类并且予以处理。 -- view -- ChangePasswordFrame是修改密码的操作界面。 -- GetFrame是用户进行取款操作的界面。 -- GuanlFram是管理员进行操作的界面。 -- LoginView是登陆主界

12、面。 -- PtFram是普通用户的操作界面。 -- SetFrame是用户进行存款操作的界面。 -- zhucFram是新注册用户进行注册的界面。 a.登陆时主界面设计 public class LoginView extends JFrame implements ActionListener{ private JButton adminLoginButton; private JButton zhucButton; private JButton loginButton; private JTextField idField; private JP

13、asswordField passwordField; private JLabel showMessageLabel; private String title="登陆"; private JPanel panel=null; //protected ImageIcon icon; public LoginView(){ //窗口属性设置 this.setBounds(250, 80, 550,600); //icon=new ImageIcon("img/1.jpg"); panel=new JPanel(); panel.setLayo

14、ut(null); panel.setBounds(250, 80, 600,650); //创建相应的组件 adminLoginButton=new JButton("管理员登陆"); JLabel welcomeLabel=new JLabel("欢迎使用信用卡网上管理模拟系统"); showMessageLabel=new JLabel(); JLabel nameLabel=new JLabel("账号"); JLabel passwordLabel=new JLabel("密码"); idField=new JTextField(); passwo

15、rdField=new JPasswordField(); zhucButton=new JButton("注册"); loginButton=new JButton("登陆"); // button.setIcon(new ImageIcon(button.getToolkit().getImage("F:\\MyEclipse\\abcdefg\\atm\\icon.png"))); //组件属性设置 adminLoginButton.setBounds(390, 340, 120, 25); showMessageLabel.setBounds(100, 500,

16、500, 30); welcomeLabel.setFont(new Font("隶书",Font.BOLD,30)); welcomeLabel.setBounds(20, 50, 500, 60); nameLabel.setBounds(170,240,60,30); passwordLabel.setBounds(170, 290, 60, 30); idField.setBounds(205, 240, 180, 25); passwordField.setBounds(205, 290, 180, 25); zhucButton.setBounds(20

17、5, 340,60,25); loginButton.setBounds(305, 340,60,25); passwordField.setEchoChar('*'); // 注册监听器 adminLoginButton.addActionListener(this); zhucButton.addActionListener(this); loginButton.addActionListener(this); passwordField.addActionListener(this); //向面板中添加各个组件 panel.add(adminLogin

18、Button); panel.add(showMessageLabel); panel.add(welcomeLabel); panel.add(nameLabel); panel.add(passwordLabel); panel.add(idField); panel.add(passwordField); panel.add(zhucButton); panel.add(loginButton); this.add(panel); this.addWindowListener(new WindowAdapter(){ public void

19、windowClosing(WindowEvent e){ System.exit(0); } }); this.setResizable(false); this.setVisible(true); } /* * 事件处理 */ public void actionPerformed(ActionEvent e) { if((JButton)e.getSource()==zhucButton){ new zhucFram("新用户注册界面"); } else if((JButton)e.getSource()==lo

20、ginButton){ UserDAOImp userDao=new UserDAOImp(); User user=new User(); LoginService loginService=new LoginService(); user.setId(idField.getText().trim()); user.setPassword(String.valueOf(passwordField.getPassword())); User user1=userDao.findByIdAndPassword(user); System.o

21、ut.println("user="+user.getPassword()); try { loginService.checkLoginInfo(user1); //用户登陆成功后得主界面 new PtFram("用户登陆成功后的操作界面",user.getId()).setVisible(true); this.setVisible(false); System.out.println("ghghj"); JOptionPane.showMessageDialog(null,"登陆成功!!","",JOptionPane.

22、DEFAULT_OPTION); } catch (LoginInfoNotRightException e1){ e1.printStackTrace(); System.out.println(e.toString()); showMessageLabel.setText(e.toString()); } } else if(e.getSource()==adminLoginButton){ if("admin".equals(idField.getText())&&"admin".equals(String.valueOf

23、passwordField.getPassword()))){ //管理员注册成功后的主界面 new GuanlFram(" 管理员登陆成功后的操作界面").setVisible(true); this.setVisible(false); } else { showMessageLabel.setText("账号错或者密码错,请查找后重新登陆!"); idField.setText(null); passwordField.setText(null); } } } } 主界面截

24、图: b.注册新用户界面 public class zhucFram extends JFrame implements ActionListener { Box basebox,box1,box2; Button Button1,Button2; TextField NameTextField =new TextField(12); TextField idTextField =new TextField(12); JPasswordField passwordTextField = new JPasswordField(12); JPasswordField

25、 repasswordTextField = new JPasswordField(12); public zhucFram(String s) { super(s); Button1=new Button("确定"); Button2=new Button("取消"); box1=Box.createVerticalBox(); box1.add(new Label("姓名")); box1.add(Box.createVerticalStrut(8)); box1.add(new Label("卡号")); box1.add(Box.

26、createVerticalStrut(8)); box1.add(new Label("请输入密码")); box1.add(Box.createVerticalStrut(8)); box1.add(new Label("请再输一遍")); box1.add(Box.createVerticalStrut(8)); box1.add(Button1); box2=Box.createVerticalBox(); box2.add(NameTextField); box2.add(Box.createVerticalStrut(8));

27、box2.add(idTextField); box2.add(Box.createVerticalStrut(8)); box2.add(passwordTextField); box2.add(Box.createVerticalStrut(8)); box2.add(repasswordTextField); box2.add(Box.createVerticalStrut(8)); box2.add(Button2); basebox=Box.createHorizontalBox(); basebox.add(box1); bas

28、ebox.add(Box.createHorizontalStrut(10)); basebox.add(box2); Button1.addActionListener(this); Button2.addActionListener(this); setLayout(new FlowLayout()); add(basebox); setBounds(240,250,500,300); setVisible(true); } public void actionPerformed(ActionEvent e) { i

29、f(e.getSource()==Button1) { String userName = String.valueOf(NameTextField.getText()) ; String userId = String.valueOf(idTextField.getText()) ; String userPassword = String.valueOf(passwordTextField.getPassword()) ; String testPassword = String.valueOf(repasswordTextFi

30、eld.getPassword()) ; if(userPassword.equals(testPassword)){ try{ User user1=new User(); user1.setId(userId); user1.setName(userName); user1.setPassword(userPassword); UserDAOImp addUser=new UserDAOImp(); boolean success=addUser.insert(user1

31、); if(success) JOptionPane.showMessageDialog(null,"注册成功,请重新登陆","",JOptionPane.DEFAULT_OPTION); else{ JOptionPane.showMessageDialog(null,"注册失败!!","",JOptionPane.DEFAULT_OPTION); } } catch(Throwable www){www.printStackTrace();} } else{

32、 JOptionPane.showMessageDialog(null,"您输入的密码前后不符,请重新输入","",JOptionPane.DEFAULT_OPTION); } } else{dispose() ;} } } 用户注册界面截图: c.管理员登陆界面 public class GuanlFram extends Frame implements ActionListener{ Button shenhButton=new Button("审核注册用户"); Button chakButton=new Button("查看系统内的黑名

33、单"); Button _return = new Button("返回"); Box baseBox,box1; public GuanlFram(String s) { super(s); box1=Box.createVerticalBox(); box1.add(Box.createVerticalStrut(10)); box1.add(shenhButton); box1.add(Box.createVerticalStrut(10)); box1.add(chakButton); box1.add(Box.createVe

34、rticalStrut(10)); box1.add(_return); baseBox=Box.createHorizontalBox(); baseBox.add(box1); _return.addActionListener(this); shenhButton.addActionListener(this); chakButton.addActionListener(this); setLayout(new FlowLayout()); add(baseBox); this.addWindowListener(new Window

35、Adapter(){ public void windowClosing(WindowEvent e){ System.exit(0); } }); setBounds(240,250,500,300); setVisible(true); } public void actionPerformed(ActionEvent e) { if(e.getSource()==shenhButton) { //System.out.println("新注册用户的信息"); U

36、serDAOImp userdao=new UserDAOImp(); List list = new UserDAOImp().findByType(0); final Frame frame=new Frame(); TextArea text=new TextArea(50,50); frame.setLayout(new FlowLayout()); frame.add(text); frame.setBounds(240,250,500,300); // frame.add(_

37、return); frame.setVisible(true); frame.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){ frame.setVisible(false); } }); if(list.size()==0) text.append("系统现在没有新注册的用户"); else{ for(int i=0;i

38、size();i++){ User user=(User)list.get(i); text.append("卡号:"+user.getId()); text.append("\n密码:"+user.getPassword()); text.append("\n姓名:"+user.getName()); text.append("\n余额"+user.getMoney()); text.append("\n信用额度"+user.getCredit()); text.ap

39、pend("\n透支金额"+user.getOverdraft()); text.append("\n******************************"); text.append("\n此时系统已经将新注册用户提升为普通用户了!"); user.setType(1); text.append("\n******************************"); text.append("\n系统已经将新注册用户的信用额度设置为1000元!"); user.setCr

40、edit(1000); userdao.update(user); } } } else if(e.getSource()==chakButton) { //System.out.println("进入系统黑名单界面"); List list = new UserDAOImp().findByBlacklist(1); final Frame frame=new Frame(); TextArea text=new TextArea(50,50);

41、 frame.setLayout(new FlowLayout()); frame.add(text); frame.setBounds(240,250,500,300); frame.setVisible(true); frame.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){ frame.setVisible(false); } }); if(list.si

42、ze()==0) text.append("系统现在没有黑名单的用户"); else{ for(int i=0;i

43、etMoney()); text.append("\n信用额度:"+user.getCredit()); text.append("\n透支金额:"+user.getOverdraft()); text.append("\n******************************"); } } } else if(e.getSource() == _return){ new LoginView(); dispo

44、se(); } } } 管理员登陆界面截图: e.普通用户登陆界面 public class PtFram extends Frame implements ActionListener{ private String id; Button getButton=new Button("现金转出"); Button setButton=new Button("现金转入"); Button changeButton=new Button("个人信息修改"); Button serchButton=new Button("余额查询"

45、); Button serchjiluButton=new Button("交易记录查询"); Button serchfhButton=new Button("返回"); Box baseBox,box1; public PtFram(String s,String id) { super(s); this.id=id; box1=Box.createVerticalBox(); box1.add(Box.createVerticalStrut(10)); box1.add(getButton); box1.add(Box.create

46、VerticalStrut(10)); box1.add(setButton); box1.add(Box.createVerticalStrut(10)); box1.add(changeButton); box1.add(Box.createVerticalStrut(10)); box1.add(serchButton); box1.add(Box.createVerticalStrut(10)); box1.add(serchjiluButton); box1.add(Box.createVerticalStrut(10)); bo

47、x1.add(serchfhButton); baseBox=Box.createHorizontalBox(); baseBox.add(box1); getButton.addActionListener(this); setButton.addActionListener(this); changeButton.addActionListener(this); serchButton.addActionListener(this); serchjiluButton.addActionListener(this); serchfhButton

48、addActionListener(this); setLayout(new FlowLayout()); add(baseBox); this.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){ System.exit(0); } }); setBounds(240,250,500,300); setVisible(true); } public void actionPerformed(ActionEv

49、ent e) { if(e.getSource()==getButton) { System.out.println("进入现金转出界面"); new GetFrame(id).setVisible(true); } else if(e.getSource()==setButton) { System.out.println("进入现金转入界面"); new SetFrame(id).setVisible(true);

50、 } else if(e.getSource()==changeButton) { System.out.println("进入信息修改界面"); //User user=new UserDAOImp().update(id); new ChangePasswordFrame(id).setVisible(true); } else if(e.getSource()==serchButton) { System.out.println("进入余额查询界面");

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

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

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

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

gongan.png浙公网安备33021202000488号   

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

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

客服