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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

Java SE课程设计.docx

1、Java SE课程设计Java SE程序设计期末课程设计报告题 目: 校友录管理系统 班 级: *级*班 学 号: 201281110103 201281110158 姓 名: * * 成 绩: 完成时间: 2014 年 6 月目 录第一章 引言 21.1开发背景 21.2需求分析 2第二章 系统设计 22.1 功能设计 22.2 数据库设计 32.3 流程(或算法)设计 32.4 类与接口设计 4第三章 系统实现 43.1 管理子系统 4第四章 设计总结 5参考文献 附 录(核心代码) 6校友录管理系统第一章 引言 1.1开发背景1、巩固和提高JAVA编程技术。2、培养掌握学习设计的基本思路

2、和方法。3、增强分析、解决问题的能力。4、提高科技论文的写作能力。1.2需求分析功能需求分析:校友录主要有一下模块:校友录界面设计、添加联系人、删除联系人、浏览所有联系人、修改信息、查询联系人。第二章 系统设计2.1 功能设计通讯录界面设计主要功能是设计校友录的界面,能够提示用户的实际操作等。其中:1添加联系人2删除联系人3显示所有联系人4修改信息5查找联系人 6重置校友录添加联系人模块主要功能是添加联系人模块,添加操作是根据用户的要求实现的。包括添加联系人的姓名、性别、年龄、电话、QQ、地址等。校友录删除联系人模块主要功能是删除不再需要的联系人。校友录显示所有联系人模块显示所有的联系人的信息

3、。包括姓名、年龄、性别、电话、QQ、地址并提示所有联系人已经全部显示出来!校友录修改联系人模块主要是修改联系人的信息,界面提示要输入需要修改的姓名或者电话号码,显示出改联系人的所有信息,并提示根据下面提示修改信息,姓名、年龄、电话、QQ、地址等。2.2 数据库设计 运行环境运行平台:Windows 7运行环境:eclipse开发工具和编程语言系统开发语言:Java数据库管理软件:MySQL SQLyog2.3流程(或算法)设计图2.3 系统功能流程第三章 系统实现3.1 管理子系统主界面如下:用户进入系统后,输入用户名和密码即可登录进行相关操作,若用户名错误、密码错误或用户名与密码不匹配则无法

4、登陆。添加运行程序如下根据用户的要求实现添加联系人的。包括添加联系人的姓名、性别、年龄、电话、QQ、地址等。查询运行程序如下查询模块可以进行学生信息查询,所有的校友以及相关信息都可在这里查看。修改程序如下修改模块可以及时对联系人的相关信息进行修改。删除运行程序如下鼠标右键单击要删除的联系人,会弹出删除或修改字样,点删除即可。第四章 设计总结心得体会: 历时半个月的努力,校友录管理系统已经顺利完成。在这段时间里,我们严格要求自己,不断寻找自身差距,拓展知识面,培养实际工作能力。在本套系统的设计里,让我对java程序设计语言及Mysql数据库有了更深刻的理解,使我能更好的从理论结合实际,从中收益匪

5、浅。本系统的数据库采用了Mysql,数据库应用程序的开发使用java语言。 在设计中也遇到了很多困难,但最终都找资料解决了。这次设计的经历为我以后的设计积累了宝贵的经验。因为时间比较紧张,该系统还有很多不足之处,系统功能还有待进一步完善和拓展,例如同学照片之类的信息完善,还有校内同学的院系分布等等。系统设计的过程中,让我深深体会到一个有价值的软件对系统需求进行详细的分析是至关重要的,如Mysql的可视化界面SQLyog,而画出系统流程图和结构图则是不可缺少的步骤。这样才可以在设计时做到有条不紊的进行。参考文献【1】王珊,萨师煊,数据库系统概论(第四版),高等教育出版社。【2】钱雪忠.数据库原理

6、及应用(第二版).北京:北京邮电大学出版社,2007【3】王珊.数据库技术与联机分析处理.北京:北京科学出版社,1998附 录(核心代码)package .cxsw.project;import java.util.List;public class LoginDialog extends Dialog protected Object result; public static Shell shell; private Text text; private Text text_1; public LoginDialog(Shell parent, int style) super(paren

7、t, style); setText(SWT Dialog); public Object open() createContents(); shell.open(); shell.layout(); Display display = getParent().getDisplay(); while (!shell.isDisposed() if (!display.readAndDispatch() display.sleep(); return result; private void createContents() shell = new Shell(getParent(), SWT.

8、SHELL_TRIM | SWT.BORDER); shell.setSize(450, 300); shell.setText(getText(); Label lblNewLabel = new Label(shell, SWT.NONE); lblNewLabel.setFont(SWTResourceManager.getFont(华文琥珀, 22, SWT.NORMAL); lblNewLabel.setBounds(50, 55, 319, 34); lblNewLabel.setText(u6B22u8FCEu8FDBu5165u6821u53CBu5F55u7BA1u7406u

9、7CFBu7EDF); Label lblNewLabel_2 = new Label(shell, SWT.NONE); lblNewLabel_2.setBounds(102, 104, 48, 34); lblNewLabel_2.setText(u7528u6237u540DuFF1A); text = new Text(shell, SWT.BORDER); text.setBounds(159, 99, 110, 23); Label lblNewLabel_1 = new Label(shell, SWT.NONE); lblNewLabel_1.setText(u5BC6 u7

10、801uFF1A); lblNewLabel_1.setBounds(102, 155, 61, 23); text_1 = new Text(shell, SWT.BORDER | SWT.PASSWORD); text_1.setBounds(159, 155, 110, 23); Button btnNewButton = new Button(shell, SWT.NONE); btnNewButton.addSelectionListener(new SelectionAdapter() public void widgetSelected(SelectionEvent e) Str

11、ing userName=text.getText().trim(); String userPsw=text_1.getText().trim(); DbUtil db= new DbUtil(); ListMaplist=db.query(select * from user where username=? and userpassword=?,new ObjectuserName,userPsw); if(list.size()0) MainDialog mg= new MainDialog(new Shell(),SWT.None); mg.open(); else System.o

12、ut.println(错误); ); btnNewButton.setBounds(143, 204, 80, 27); btnNewButton.setText(u767Bu5F55); package .cxsw.project;import org.eclipse.swt.SWT;public class AddSStudentDialog extends Dialog protected Object result; protected Shell shell; private Text text; private Text text_1; private Text text_3; p

13、rivate Text text_4; private Text text_5; private Text text_2; public AddSStudentDialog(Shell parent, int style) super(parent, style); setText(SWT Dialog); public Object open() createContents(); shell.open(); shell.layout(); Display display = getParent().getDisplay(); while (!shell.isDisposed() if (!

14、display.readAndDispatch() display.sleep(); return result; private void createContents() shell = new Shell(getParent(), SWT.SHELL_TRIM | SWT.BORDER); shell.setSize(390, 379); shell.setText(getText(); Label lblNewLabel = new Label(shell, SWT.NONE); lblNewLabel.setBounds(49, 45, 61, 17); lblNewLabel.se

15、tText(u59D3 u540DuFF1A); Label label = new Label(shell, SWT.NONE); label.setBounds(49, 86, 61, 17); label.setText(u6027 u522BuFF1A); Label label_1 = new Label(shell, SWT.NONE); label_1.setBounds(49, 126, 61, 17); label_1.setText(u5E74 u9F84uFF1A); Label label_2 = new Label(shell, SWT.NONE); label_2.

16、setBounds(49, 163, 61, 17); label_2.setText(u7535 u8BDDuFF1A); Label lblQq = new Label(shell, SWT.NONE); lblQq.setBounds(49, 204, 61, 17); lblQq.setText( QQ:); Label label_3 = new Label(shell, SWT.NONE); label_3.setBounds(49, 242, 61, 17); label_3.setText( u5730 u5740uFF1A); Button btnNewButton = ne

17、w Button(shell, SWT.NONE); btnNewButton.setBounds(84, 277, 80, 27); btnNewButton.setText(u91CDu7F6E); Button button = new Button(shell, SWT.NONE); button.addSelectionListener(new SelectionAdapter() Override public void widgetSelected(SelectionEvent e) String stuName=text.getText().trim(); String stu

18、Sex=text_1.getText().trim(); String stuAge=text_2.getText().trim(); String stuPhone=text_3.getText().trim(); String stuQQ=text_4.getText().trim(); String stuAddress=text_5.getText().trim(); DbUtil db= new DbUtil(); int result=db.update(insert into student(name,sex,age,phone,address,QQ)value(?,?,?,?,

19、?,?),new Object stuName,stuSex,stuAge,stuPhone,stuAddress,stuQQ ); if(result0) MessageBox box= new MessageBox(new Shell(),SWT.None); box.setText(提示信息); box.setMessage(添加成功!); box.open(); shell.close(); else MessageBox box= new MessageBox(new Shell(),SWT.None); box.setText(提示信息); box.setMessage(添加失败!

20、); box.open(); ; ); button.setText(u6DFBu52A0); button.setBounds(210, 277, 80, 27); text = new Text(shell, SWT.BORDER); text.setBounds(116, 45, 141, 23); text_1 = new Text(shell, SWT.BORDER); text_1.setBounds(116, 83, 141, 23); text_3 = new Text(shell, SWT.BORDER); text_3.setBounds(116, 163, 141, 23

21、); text_4 = new Text(shell, SWT.BORDER); text_4.setBounds(116, 198, 141, 23); text_5 = new Text(shell, SWT.BORDER); text_5.setBounds(116, 242, 141, 23); text_2 = new Text(shell, SWT.BORDER); text_2.setBounds(116, 120, 141, 23); package .cxsw.utils;import java.sql.Connection;import java.sql.DriverMan

22、ager;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.ResultSetMetaData;import java.sql.SQLException;import java.sql.Statement;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;public class DbUtil private Connection conn =null;

23、private Statement stmt=null; private PreparedStatement ps=null; private ResultSet rs = null; private String url=jdbc:mysql:/localhost:3306/bjw; private String password=123456; private String user=root; /*加载驱动*/ static try Class.forName(com.mysql.jdbc.Driver); catch (ClassNotFoundException e) System.

24、out.println(加载驱动出现异常!); e.printStackTrace(); /*获取连接*/ private Connection getConn() try conn=DriverManager.getConnection(url, user, password); catch (SQLException e) System.out.println(获取连接出现异常!); e.printStackTrace(); return conn; /*提供更新方法*/ public int update(String sql,Object pars ) try ps=getConn()

25、.prepareStatement(sql); for(int i=0;ipars.length;i+) ps.setObject(i+1, parsi); return ps.executeUpdate(); catch (SQLException e) System.out.println(执行更新语句出现异常!); e.printStackTrace(); finally release(); return -1; private void release() if(rs!=null) try rs.close(); catch (SQLException e) System.out.p

26、rintln( 关闭结果集出现错误!); e.printStackTrace(); if(ps!=null) try ps.close(); catch (SQLException e) System.out.println( 关闭预处理出现错误!); e.printStackTrace(); if(stmt!=null) try stmt.close(); catch (SQLException e) System.out.println( 关闭语句对象集出现错误!); e.printStackTrace(); if(conn!=null) try conn.close(); catch (

27、SQLException e) System.out.println( 关闭结连接出现错误!); e.printStackTrace(); public int update(String sql) return update(sql,new Object); /*查询方法*/ public ListMap query(String sql) return query(sql,new Object ); public ListMap query(String sql,Object pars) ListMap list=new ArrayListMap(); try ps=getConn().prepareStatement(sql); for(int i=0;ipars.length;i+) ps.setObject(i+1, parsi); rs= ps.executeQuery(); ResultSetMetaData rsmd = rs.getMetaData(); while(rs.next() /*将当前数据转化到map中*/ Map map=new HashMap(); for(int i=1;i=rsmd.ge

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

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