java数据库管理系统课程设计学生信息管理系统 .doc
《java数据库管理系统课程设计学生信息管理系统 .doc》由会员分享,可在线阅读,更多相关《java数据库管理系统课程设计学生信息管理系统 .doc(16页珍藏版)》请在三一办公上搜索。
1、Java课程设计姓 名:学 号:班 级:学 院:指导教师:目录1. 题目简介2. 程序概要.3. 程序函数简介.4. 源代码5. 运行截图.6. 心得体会.1题目简介题目简介:要求基于数据库管理系统,建立一个学生信息管理系统,有简单的显示、更新、插入等基本功能。还有程序需有窗口,也就是运行界面中要含有窗口。程序尽量简单,但功能得全面,界面做到尽善尽美!2.程序概要程序概要:本程序中含有一个public类,三个一般类。其主函数在public类中,一般类中每个类实现一个功能。在主函数中调用一般类中的函数,实现不同的功能。每个一般类也是建立在窗口上的,其中运用了窗口,组件,按钮,布局等多种知识。3.
2、程序函数简介public static void main(String args ).主函数class DatabaseWin extends JFrame implements ActionListener该类实现主要窗口的建立DatabaseWin().建立窗口,添加窗口组件public void actionPerformed(ActionEvent e).实现监视class InsertRecord extends JDialog implements ActionListener负责插入的类InsertRecord(String s)实现插入功能class ShowRecord e
3、xtends JDialog implements ActionListener负责显示的类ShowRecord(String title).实现显示功能class ModifyRecord extends JDialog implements ActionListener.责更新的类ModifyRecord(String s).实现更新功能4.源代码import javax.swing.*; import java.awt.*;import java.awt.event.*;import java.sql.*;import javax.swing.border.*;public class
4、Mykcsj public static void main(String args ) try Class.forName(sun.jdbc.odbc.JdbcOdbcDriver); catch(ClassNotFoundException e) System.out.println(+e); DatabaseWin win=new DatabaseWin(); class DatabaseWin extends JFrame implements ActionListener/主窗口 JMenuBar menubar; JMenu menu; JMenuItem itemShow,ite
5、mUpdate,itemInsert; ShowRecord showRecord; ModifyRecord modifyRecord; InsertRecord insertRecord; DatabaseWin() menubar=new JMenuBar(); menu=new JMenu(操作数据库); itemShow=new JMenuItem(显示记录); itemUpdate=new JMenuItem(更新记录); itemInsert=new JMenuItem(插入记录); itemShow.addActionListener(this); itemUpdate.add
6、ActionListener(this); itemInsert.addActionListener(this); menu.add(itemShow); menu.add(itemUpdate); menu.add(itemInsert); menubar.add(menu); showRecord=new ShowRecord(显示记录对话框); modifyRecord=new ModifyRecord(修改记录对话框); insertRecord=new InsertRecord(插入记录对话框); setJMenuBar(menubar); setBounds(100,100,370
7、,250); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); public void actionPerformed(ActionEvent e) if(e.getSource()=itemShow) showRecord.setVisible(true); else if(e.getSource()=itemUpdate) modifyRecord.setVisible(true); else if(e.getSource()=itemInsert) insertRecord.setVisible(true)
8、; class InsertRecord extends JDialog implements ActionListener /负责插入记录的类 JLabel hintLabel; Object name=学号,姓名,出生日期,身高; Object a=new Object14; JTable table; JButton enterInsert; Connection con; Statement sql; ResultSet rs; String num; InsertRecord(String s) setTitle(s); hintLabel=new JLabel(输入新记录:); t
9、able=new JTable(a,name); enterInsert=new JButton(插入新记录); setLayout(null); Box baseBox=Box.createHorizontalBox(); baseBox.add(hintLabel); baseBox.add(new JScrollPane(table); baseBox.add(enterInsert); add(baseBox); baseBox.setBounds(10,40,600,38); enterInsert.addActionListener(this); setBounds(120,160
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java数据库管理系统课程设计学生信息管理系统 java 数据库 管理 系统 课程设计 学生 信息管理

链接地址:https://www.31ppt.com/p-2386912.html