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

加入VIP,免费下载
 

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

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

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(信用卡在线管理系统文档格式.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

信用卡在线管理系统文档格式.docx

1、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, toId varchar(50) not null, money float not null, tradetime datetime);create table user1 id varchar(50) primary key not null, pa

2、ssword varchar(50) not null, name varchar(100) not null, type int , money float , credit float , overdraft float , blacklist int 、交易表用户表(2)对数据库的操作Insert主要时用来对数据库进行插入操作,例如在record表中插入一条记录为,public boolean insert ( Record record ) String sql = insert into record(id,fromId,toId,money,tradetime) values(?,

3、?); try PreparedStatement pre = conn.prepareStatement(sql); Calendar calendar=Calendar.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 ,

4、record.getTradetime(); pre.execute(); return true; catch (SQLException e) e.printStackTrace(); return false; Delete是多数据表中的记录加以删除,例如对user表中的记录删除操作为:public boolean delete ( User user )delete from user where id=? pre.setString(1, user.getId(); e.printStackTrace();Update是对数据库中的信息加以修改!findAll是查找数据库中的所有记录

5、!findById是通过用户给定的id好来对数据库进行扫描,查找出所有与输入的id相匹配的信息!同时也可以根据其他的关键字对数据库进行查找查找,例如是否是黑名单,是否已经有透支额了等等,具体的实现见代码!2.java程序的设计: 主要以下几个包: -bean -User表示的是user表中的一条记录 -Record表示的是record表中的一条记录 -ChangePasswordBean是对修改密码时的所有属性的封装 -zhucBean是在新用户注册时的一条记录,主要包括属性id ,password ,name ;以及set和get方法! -dao -DBConnection用于连接数据库-R

6、ecordDAO接口是封装对数据表Record的操作-UserDAO接口是封装对数据表User的操作 -exception -inputChangePasswordInfoNotRightException是用来显示输入的修改密码的出错的信息! -InputGetNumNotRightException是用户输入的取款金额不合法异常-InputSetNumNotRightException是用户输入的存款金额不合法异常 -LoginInfoNotRightException 是用户登陆是的不合法异常 -imp -RecordDAOImp是对接口RecordDAO中的方法的实现。 -UserDA

7、OImp是对接口UserDAO中方法的实现。-service -ChangePasswordService是对修改密码服务中可能出现的不正常信息加以分类并且予以处理。 -GetService是对用户输入的取款信息的不正常信息加以分类并且予以处理。 - LoginService是对用户在登陆时输入信息的不正常信息加以分类并且予以处理。 - SetService是对用户输入的存款信息的不正常信息加以分类并且予以处理。- view - ChangePasswordFrame是修改密码的操作界面。- GetFrame是用户进行取款操作的界面。- GuanlFram是管理员进行操作的界面。- Login

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

9、dField; 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.setLayout(null); panel.setBounds(250, 80, 600,650); /创建相应的组件 adm

10、inLoginButton=new JButton(管理员登陆 JLabel welcomeLabel=new JLabel(欢迎使用信用卡网上管理模拟系统 showMessageLabel=new JLabel(); JLabel nameLabel=new JLabel(账号 JLabel passwordLabel=new JLabel(密码 idField=new JTextField(); passwordField=new JPasswordField(); zhucButton=new JButton(注册 loginButton=new JButton(/ button.set

11、Icon(new ImageIcon(button.getToolkit().getImage(F:MyEclipseabcdefgatmicon.png); /组件属性设置 adminLoginButton.setBounds(390, 340, 120, 25); showMessageLabel.setBounds(100, 500, 500, 30); welcomeLabel.setFont(new Font(隶书,Font.BOLD,30); welcomeLabel.setBounds(20, 50, 500, 60); nameLabel.setBounds(170,240,6

12、0,30); passwordLabel.setBounds(170, 290, 60, 30); idField.setBounds(205, 240, 180, 25); passwordField.setBounds(205, 290, 180, 25); zhucButton.setBounds(205, 340,60,25); loginButton.setBounds(305, 340,60,25); passwordField.setEchoChar(* / 注册监听器 adminLoginButton.addActionListener(this); zhucButton.ad

13、dActionListener(this); loginButton.addActionListener(this); passwordField.addActionListener(this); /向面板中添加各个组件 panel.add(adminLoginButton); panel.add(showMessageLabel); panel.add(welcomeLabel); panel.add(nameLabel); panel.add(passwordLabel); panel.add(idField); panel.add(passwordField); panel.add(zh

14、ucButton); panel.add(loginButton); this.add(panel); this.addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent e) System.exit(0); ); this.setResizable(false); this.setVisible(true); /* * 事件处理 */ public void actionPerformed(ActionEvent e) if(JButton)e.getSource()=zhucButton) new

15、 zhucFram(新用户注册界面 else if(JButton)e.getSource()=loginButton) 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.findByIdAndPasswo

16、rd(user); System.out.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.DEFAULT_OPTION); catch (LoginInfoNo

17、tRightException e1) e1.printStackTrace(); System.out.println(e.toString(); showMessageLabel.setText(e.toString(); else if(e.getSource()=adminLoginButton) if(admin.equals(idField.getText()&.equals(String.valueOf(passwordField.getPassword() /管理员注册成功后的主界面 new GuanlFram( 管理员登陆成功后的操作界面).setVisible(true);

18、 else showMessageLabel.setText(账号错或者密码错,请查找后重新登陆! idField.setText(null); passwordField.setText(null);主界面截图:b.注册新用户界面public class zhucFram extends JFrame implements ActionListener Box basebox,box1,box2; Button Button1,Button2; TextField NameTextField =new TextField(12); TextField idTextField =new Tex

19、tField(12); JPasswordField passwordTextField = new JPasswordField(12); JPasswordField 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

20、);卡号请输入密码请再输一遍 box1.add(Button1); box2=Box.createVerticalBox(); box2.add(NameTextField); box2.add(Box.createVerticalStrut(8); box2.add(idTextField); box2.add(passwordTextField); box2.add(repasswordTextField); box2.add(Button2); basebox=Box.createHorizontalBox(); basebox.add(box1); basebox.add(Box.cr

21、eateHorizontalStrut(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) if(e.getSource()=Button1) String userName = String.valueOf(

22、NameTextField.getText() ; String userId = String.valueOf(idTextField.getText() ; String userPassword = String.valueOf(passwordTextField.getPassword() ; String testPassword = String.valueOf(repasswordTextField.getPassword() ; if(userPassword.equals(testPassword) try User user1=new User(); user1.setId

23、(userId); user1.setName(userName); user1.setPassword(userPassword); UserDAOImp addUser=new UserDAOImp(); boolean success=addUser.insert(user1); if(success) JOptionPane.showMessageDialog(null,注册成功,请重新登陆 else JOptionPane.showMessageDialog(null,注册失败! catch(Throwable www)(); JOptionPane.showMessageDialo

24、g(null,您输入的密码前后不符,请重新输入 elsedispose() ;用户注册界面截图:c.管理员登陆界面public class GuanlFram extends Frame implements ActionListener Button shenhButton=new Button(审核注册用户 Button chakButton=new Button(查看系统内的黑名单 Button _return = new Button(返回 Box baseBox,box1; public GuanlFram(String s) box1.add(Box.createVerticalStrut(10); box1.add(shenhButton); box1.add(chakButton); box1.add(_return); baseBox=Box.createHorizontalBox(); baseBox.add(box1); _return.addActionListener(this); shenhButton.addActionListener(this); chakButton.addActionListener(this); add(baseBox); this.addWindowListene

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1