![數(shù)據(jù)庫課程設(shè)計教務管理系統(tǒng)_第1頁](http://file1.renrendoc.com/fileroot_temp2/2020-10/10/803fb977-d9ef-40e6-bf69-1cbf08485603/803fb977-d9ef-40e6-bf69-1cbf084856031.gif)
![數(shù)據(jù)庫課程設(shè)計教務管理系統(tǒng)_第2頁](http://file1.renrendoc.com/fileroot_temp2/2020-10/10/803fb977-d9ef-40e6-bf69-1cbf08485603/803fb977-d9ef-40e6-bf69-1cbf084856032.gif)
![數(shù)據(jù)庫課程設(shè)計教務管理系統(tǒng)_第3頁](http://file1.renrendoc.com/fileroot_temp2/2020-10/10/803fb977-d9ef-40e6-bf69-1cbf08485603/803fb977-d9ef-40e6-bf69-1cbf084856033.gif)
![數(shù)據(jù)庫課程設(shè)計教務管理系統(tǒng)_第4頁](http://file1.renrendoc.com/fileroot_temp2/2020-10/10/803fb977-d9ef-40e6-bf69-1cbf08485603/803fb977-d9ef-40e6-bf69-1cbf084856034.gif)
![數(shù)據(jù)庫課程設(shè)計教務管理系統(tǒng)_第5頁](http://file1.renrendoc.com/fileroot_temp2/2020-10/10/803fb977-d9ef-40e6-bf69-1cbf08485603/803fb977-d9ef-40e6-bf69-1cbf084856035.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、洛 陽 理 工 學 院課 程 設(shè) 計 報 告 課程名稱 數(shù)據(jù)庫課程設(shè)計 設(shè)計題目 教務管理系統(tǒng) 專 業(yè) 計算機科學與技術(shù) 班 級 學 號 姓 名 完成日期 課 程 設(shè) 計 任 務 書設(shè)計題目: 教務管理系統(tǒng) 設(shè)計內(nèi)容與要求:設(shè)計教務管理系統(tǒng),類似于我校教務管理系統(tǒng),有四類用戶:教務員、學生、教師、管理員教務員可以輸入學生、教師、班級、課程信息。一個班級只屬于一個專業(yè),一個學生只屬于一個班級。教務員負責輸入每個專業(yè)、每個班級需要學習哪些課程,指定課程的任課教師。教師可以查看學習該課程的學生名單。課程結(jié)束后,教師可以錄入課程成績。一個教師可以教授多個班的多門課程,每門課由多位老師講授。課程分兩類,
2、必修課和選修課。系統(tǒng)要記錄每個學生學習各門必修課的成績,還要記錄學生選修了哪些選修課以及課程成績。學生可以查看自己各門課程的成績。學生還可以進行評教,給老師打分。管理員可以輸入教室信息,并結(jié)合班級、課程、教室信息實現(xiàn)自動排課。要求: 1.完成本系統(tǒng)的需求分析,寫出功能需求和數(shù)據(jù)需求描述; 2.完成數(shù)據(jù)庫的概念結(jié)構(gòu)設(shè)計、邏輯結(jié)構(gòu)設(shè)計、物理結(jié)構(gòu)設(shè)計; 3.完成本系統(tǒng)的部分功能模塊的程序界面設(shè)計。 指導教師: 2017 年 12 月 29 日課 程 設(shè) 計 評 語 成績: 指導教師:_ 年 月 日目錄1、 概述 .21.1、本設(shè)計的目的與意義.21.2、數(shù)據(jù)庫開發(fā)工具和應用程序開發(fā)工具.22、 需求
3、分析.22.1功能需求.22.2數(shù)據(jù)需求.23、 概念結(jié)構(gòu)設(shè)計.23.1、E-R模型設(shè)計.23.2、總體E-R圖描述.44、 邏輯結(jié)構(gòu)設(shè)計.44.1、關(guān)系模型.44.2、關(guān)系模式的優(yōu)化與說明.45、 物理結(jié)構(gòu)設(shè)計.55.1建立數(shù)據(jù)庫.55.2表與表結(jié)構(gòu).56、 應用程序設(shè)計.66.1、系統(tǒng)總體結(jié)構(gòu).66.2、系統(tǒng)界面與源代碼.76.2.1、界面.86.2.2、功能描述.96.2.3、程序源代碼.10七、設(shè)計總結(jié).23一、 概述 本系統(tǒng)后臺數(shù)據(jù)庫采用Microsoft SQL Server 數(shù)據(jù)庫,該數(shù)據(jù)庫系統(tǒng)在安全性、準確性和運行速度方面有絕對的優(yōu)勢,并且處理數(shù)據(jù)量大,效率高;前臺采用Micr
4、osoft 公司的Visual Studio 2010作為主要開發(fā)工具,可與SQL Server 2008數(shù)據(jù)庫無縫鏈接。2、 需求分析2.1、功能需求 本系統(tǒng)的功能如下:1)學生信息查詢:學生可以根據(jù)學號、姓名、專業(yè)進行查詢.2)學生信息管理:主要是用于學生信息更新、插入、刪除;3)學生成績錄入:用于學生成績管理,錄入學生成績,也可以更新;2.2、數(shù)據(jù)需求 本系統(tǒng)需要的數(shù)據(jù)如下:學生:學號、姓名、性別、年齡教師:工號、姓名、性別、年齡班級:班號、班名、人數(shù)、課程:課程號、課程名、上課時間、上課地點專業(yè):專業(yè)號、專業(yè)名3、 概念結(jié)構(gòu)設(shè)計3.1、E-R模型設(shè)計(E-R圖)學生和教師實體及其屬性E
5、-R圖教師與課程E-R圖部分實體的E-R圖總體E-R圖3.2、總體E-R圖描述 學生與班級之間的聯(lián)系是所屬關(guān)系(一對多關(guān)系)班級與專業(yè)之間的聯(lián)系是所屬關(guān)系(一對多關(guān)系)班級與課程之間的聯(lián)系是學習關(guān)系(多對多關(guān)系)學生選修一門選修課(一對多關(guān)系)學生評教老師所教課程(多對多關(guān)系)老師教授課程(多對多關(guān)系)四、邏輯結(jié)構(gòu)設(shè)計4.1、關(guān)系模型 學生(學號、姓名、性別、年齡、班號、選修課程號、分數(shù))教師(工號、姓名、性別、年齡)班級(班號、班名、人數(shù)、專業(yè)名)課程(課程號、課程名)成績(必修課程號、班號、學號、分數(shù))評教(學號、工號、課程號、評分)教授(工號、課程號)課程表(課程號、工號、上課時間 、上
6、課地點)(實現(xiàn)排課功能)用戶(用戶名、密碼、用戶類型)(存儲登陸查詢系統(tǒng)的人員信息)加粗表示外鍵、加下劃線表示主碼4.2、關(guān)系模式的優(yōu)化與說明例如:教授關(guān)系的依賴關(guān)系如下:(工號、課程號)工號、課程號所以教授關(guān)系模式屬于第三范式教師關(guān)系的依賴關(guān)系如下:工號工號、姓名、性別、年齡因為沒有非主屬性對碼的部分函數(shù)依賴,也沒有非主屬性對碼的傳遞函數(shù)依賴所以教師關(guān)系模式屬于第三范式五、物理結(jié)構(gòu)設(shè)計5.1、數(shù)據(jù)庫的建立5.2、表與表結(jié)構(gòu)班級(Class)表的結(jié)構(gòu)課程(Course)表的結(jié)構(gòu)學生(Student)表的結(jié)構(gòu)教師(Teacher)表的結(jié)構(gòu)評教(Judge)表的結(jié)構(gòu)教授(Teach)表的結(jié)構(gòu)成績(
7、Grade)表的結(jié)構(gòu) 管理員(admin)表的結(jié)構(gòu)六、應用程序設(shè)計6.1、系統(tǒng)總體結(jié)構(gòu)1)主界面:登陸界面,通過選擇用戶類型,輸入用戶名密碼,點擊登錄進入不同界面。2)子界面:不同用戶類型的界面不相同,學生可以查詢成績,管理員可以添加學生信息以及查詢刪除學生信息。6.2、系統(tǒng)界面與源代碼6.2.1、界面登陸界面學生界面管理員界面6.2.2、功能描述 1)學生查詢學習課程的成績 2)管理員管理學生信息 4)管理員添加學生信息 5)管理員刪除學生信息5)刪除學號為1的觸發(fā)觸發(fā)器功能6.2.3、程序源代碼管理員實現(xiàn)查詢、刪除功能的代碼(刪除學號為1的用到了觸發(fā)器):package Manager.z
8、hen;import java.awt.*;import java.awt.EventQueue;import javax.swing.JInternalFrame;import javax.swing.JPanel;import javax.swing.border.EmptyBorder;import javax.swing.table.DefaultTableModel;import javax.swing.ComboBoxModel;import javax.swing.GroupLayout;import javax.swing.GroupLayout.Alignment;impor
9、t javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JTextField;import javax.swing.LayoutStyle.ComponentPlacement;import javax.swing.JButton;import javax.swing.JTable;import javax.swing.JComboBox;import javax.swing.JDesktopPane;import java.awt.event.ActionEvent;import java.awt.even
10、t.ActionListener;import java.sql.*;import java.util.Vector;import javax.swing.DefaultComboBoxModel;import javax.swing.JScrollPane;import javax.swing.ScrollPaneConstants;import java.awt.event.MouseAdapter;import java.awt.event.MouseEvent;public class Form_edit extends JInternalFrame private JDesktopP
11、ane Desktop;private DbUtil dbUtil = new DbUtil();private JPanel contentPane;private JTextField txt_sno;private JTable table;private JTextField txtsname;private JTextField txtcno;private JTextField txtgrade;private JTextField txtsno;/* * Launch the application. */public static void main(String args)
12、EventQueue.invokeLater(new Runnable() public void run() try Form_bookedit frame = new Form_bookedit();frame.setVisible(true); catch (Exception e) e.printStackTrace(););/* * Create the frame. */public Form_edit() setEnabled(false);setClosable(true);setTitle(u67E5u8BE2u6210u7EE9);/setDefaultCloseOpera
13、tion(JFrame.EXIT_ON_CLOSE);setBounds(100, 100, 487, 412);contentPane = new JPanel();contentPane.setBorder(new EmptyBorder(5, 5, 5, 5);setContentPane(contentPane);JLabel lblNewLabel = new JLabel(u8F93u5165u4F60u7684u5B66u53F7uFF1A);txt_sno = new JTextField();txt_sno.setColumns(10);JButton btn_searchg
14、rade = new JButton(u67E5u8BE2u6210u7EE9);btn_searchgrade.addActionListener(new ActionListener() public void actionPerformed(ActionEvent arg0) SearchActionPerformed(arg0););JLabel lblNewLabel_2 = new JLabel(u6210u7EE9u5982u4E0BuFF1A);JScrollPane scrollPane = new JScrollPane();scrollPane.addMouseListe
15、ner(new MouseAdapter() Overridepublic void mousePressed(MouseEvent e) mousePressed(e););JLabel lblNewLabel_1 = new JLabel(u5B66 u53F7);JLabel lblNewLabel_3 = new JLabel(u59D3 u540D);JLabel lblNewLabel_4 = new JLabel(u73ED u7EA7);JLabel lblNewLabel_5 = new JLabel(u6210 u7EE9);txtsname = new JTextFiel
16、d();txtsname.setColumns(10);txtcno = new JTextField();txtcno.setColumns(10);txtgrade = new JTextField();txtgrade.setColumns(10);JButton btnalter = new JButton(u4FEEu6539);btnalter.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) ModifyActionPerformed(e););JButton btn
17、delete = new JButton(u5220u9664);btndelete.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) DelActionPerformed(e););JComboBox usertype = new JComboBox();txtsno = new JTextField();txtsno.setColumns(10);GroupLayout gl_contentPane = new GroupLayout(contentPane);gl_conte
18、ntPane.setHorizontalGroup(gl_contentPane.createParallelGroup(Alignment.LEADING).addGroup(gl_contentPane.createSequentialGroup().addContainerGap().addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING).addGroup(gl_contentPane.createSequentialGroup().addComponent(lblNewLabel).addPreferredGap(
19、ComponentPlacement.RELATED).addComponent(txt_sno, GroupLayout.PREFERRED_SIZE, 125, GroupLayout.PREFERRED_SIZE).addPreferredGap(ComponentPlacement.RELATED, 89, Short.MAX_VALUE).addComponent(btn_searchgrade).addGap(29).addGroup(gl_contentPane.createSequentialGroup().addComponent(lblNewLabel_2).addCont
20、ainerGap(372, Short.MAX_VALUE).addGroup(gl_contentPane.createSequentialGroup().addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE).addContainerGap().addGroup(gl_contentPane.createSequentialGroup().addGap(46).addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false).a
21、ddGroup(gl_contentPane.createSequentialGroup().addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING, false).addComponent(lblNewLabel_1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(lblNewLabel_3, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short
22、.MAX_VALUE).addPreferredGap(ComponentPlacement.RELATED).addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING).addComponent(txtsname, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addComponent(txtsno, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, G
23、roupLayout.PREFERRED_SIZE).addGap(41).addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING, false).addComponent(lblNewLabel_4, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(lblNewLabel_5, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALU
24、E).addPreferredGap(ComponentPlacement.RELATED).addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING).addComponent(txtcno, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addComponent(txtgrade, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayou
25、t.PREFERRED_SIZE).addGap(32).addGroup(gl_contentPane.createSequentialGroup().addGap(10).addComponent(btnalter).addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(btndelete).addGap(62);gl_contentPane.setVerticalGroup(gl_contentPane.createParallelGroup(
26、Alignment.LEADING).addGroup(gl_contentPane.createSequentialGroup().addContainerGap().addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE).addComponent(lblNewLabel).addComponent(txt_sno, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addComponent(btn_sear
27、chgrade).addPreferredGap(ComponentPlacement.RELATED).addComponent(lblNewLabel_2).addGap(18).addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 139, GroupLayout.PREFERRED_SIZE).addGap(18).addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE).addComponent(lblNewLabel_1).addComponent(lblNew
28、Label_4).addComponent(txtcno, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addComponent(txtsno, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(ComponentPlacement.UNRELATED).addGroup(gl_contentPane.createParallelG
29、roup(Alignment.LEADING).addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE).addComponent(lblNewLabel_3).addComponent(txtsname, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE).addComponent(lb
30、lNewLabel_5).addComponent(txtgrade, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(ComponentPlacement.RELATED).addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING).addComponent(btnalter).addComponent(btndelete).addContainerGap(31, Short.MA
31、X_VALUE);table = new JTable();table.setModel(new DefaultTableModel(new Object ,new String u5B66u53F7, u59D3u540D, u73EDu7EA7, u6210u7EE9);scrollPane.setColumnHeaderView(table);scrollPane.setViewportView(table); / 讓表列標題顯示出來contentPane.setLayout(gl_contentPane);public Form_edit(JDesktopPane table1) th
32、is();this.Desktop=table1;/設(shè)置窗體居中顯示this.setLocation(table1.getWidth()-this.getWidth()/2,(table1.getHeight()-this.getHeight()/2);private void fillTable(String Sno) / TODO Auto-generated method stubDefaultTableModel dtm= (DefaultTableModel)table.getModel();dtm.setRowCount(0);/清空原來的記錄/連接數(shù)據(jù)庫Connection co
33、n=null;try/數(shù)據(jù)庫查詢,并填充到JTABLEcon=dbUtil.getCon();/下面可以寫數(shù)據(jù)庫訪問語句,并執(zhí)行。 Statement stmt = con.createStatement();/ 創(chuàng)建SQL命令對象 String sql = select Sno,Sname,Cno,Sgrade from student where Sno like %+Sno.trim() +%; / 定義查詢語句 PreparedStatement pstm=con.prepareStatement(sql);ResultSet rs=pstm.executeQuery();/JOpti
34、onPane.showMessageDialog(null, 查詢成功!);while(rs.next()Vector v=new Vector();v.add(rs.getString(Sno);v.add(rs.getString(Sname);v.add(rs.getString(Cno);v.add(rs.getString(Sgrade);dtm.addRow(v); / 數(shù)據(jù)庫查詢結(jié)束,最后關(guān)閉連接stmt.close();/ 關(guān)閉命令對象連接 catch(Exception e1) e1.printStackTrace(); / finally/ /try /dbUtil.clo
35、seCon(con);/ catch (Exception e1) / TODO Auto-generated catch block/e1.printStackTrace();/ private void ModifyActionPerformed(ActionEvent evt) if (txtsname.getText().isEmpty()JOptionPane.showMessageDialog(null, 請選擇一條要修改的記錄!);return;Connection conn=null;String sql=update 圖書 set 書名=?,作者=? where 書號=? ;
36、try conn=dbUtil.getCon();PreparedStatement pstm=conn.prepareStatement(sql);pstm.setString(1, txtcno.getText();pstm.setString(2, txtsname.getText();pstm.setString(3, txtgrade.getText();int count=pstm.executeUpdate();if (count=0)JOptionPane.showMessageDialog(null, 修改失敗!);elseJOptionPane.showMessageDia
37、log(null, 修改成功!);fillTable(); catch (Exception e) / TODO Auto-generated catch blocke.printStackTrace();finallytry if (conn!=null)dbUtil.closeCon(conn); catch (Exception e) / TODO Auto-generated catch blocke.printStackTrace();private void DelActionPerformed(ActionEvent evt) if (txtsno.getText().isEmpty()JOptionPane.showMessageDialog(null, 請選擇一條要刪除的記錄!);return;Connection conn=null;/int count=0;String sno=txtsno.getText().toString();String sql=delete from Student where Sno=?;/try conn=dbUtil.getCon();Prepar
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 生態(tài)經(jīng)濟在農(nóng)業(yè)現(xiàn)代化的作用
- 現(xiàn)代文閱讀教學策略研究進展匯報-探索教育新紀元
- 生產(chǎn)現(xiàn)場的人性化管理與實踐
- 現(xiàn)代辦公環(huán)境下的金融服務優(yōu)化
- 公路交通安全設(shè)施施工方案
- 2023三年級數(shù)學下冊 六 認識分數(shù)第4課時 分一分(二)(2)說課稿 北師大版
- 2024年九年級語文下冊 第三單元 第11課 送東陽馬生序說課稿 新人教版001
- 2023四年級數(shù)學上冊 一 認識更大的數(shù)第4課時 國土面積說課稿 北師大版001
- Unit 2 Lesson 4 Againplease(說課稿)-2024-2025學年魯科版(五四學制)(三起)英語五年級上冊001
- 《2 叢林之美-電子相冊制作》說課稿-2023-2024學年清華版(2012)信息技術(shù)六年級上冊
- 每個孩子都能像花兒一樣開放
- 2023年廣東省深圳市八年級下學期物理期中考試試卷
- 《詩詞寫作常識 詩詞中國普及讀物 》讀書筆記思維導圖
- YS/T 34.1-2011高純砷化學分析方法電感耦合等離子體質(zhì)譜法(ICP-MS)測定高純砷中雜質(zhì)含量
- LY/T 2016-2012陸生野生動物廊道設(shè)計技術(shù)規(guī)程
- 松下panasonic-視覺說明書pv200培訓
- 單縣煙草專賣局QC課題多維度降低行政處罰文書出錯率
- 健康養(yǎng)生課件
- 混雜控制系統(tǒng)課件
- 運動技能學習原理課件
- 《QHSE體系培訓》課件
評論
0/150
提交評論