freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java課程設(shè)計——學(xué)生信息管理系統(tǒng)-在線瀏覽

2025-05-25 06:04本頁面
  

【正文】 d=false。 try { pst = (select * from teacher where tname=? and password=?)。 (2,password)。 if(()) isfound=true。 } (isfound)。 } public static void main(String[] args) { }}(3)ScoreDao類:此類中有四個方法,queryScore,queryScore1,addScore,deleteScor作用分別是為教師用戶提供查詢學(xué)生成績信息功能,為學(xué)生用戶提供詢本人成績信息功能,添加成績信息,刪除成績信息。若查詢成功,則返回一個ArrayList類的對象lis(表格),否則,異常處理queryScore1()方法中,有一個參數(shù),傳給傳給select語句中的sname(學(xué)生姓名),這個sname的學(xué)生用戶登錄時輸入的姓名。若查詢成功,則返回一個ArrayList類的對象lis(表格),否則,異常處理addScore()方法中,有五個參數(shù),分別傳給insert語句中的num(學(xué)號),sname(學(xué)生姓名),course(課程名稱),score(成績),credit(學(xué)分)。若插入成功返回true,否則返 回falsedeleteScore()方法中,有一個參數(shù),傳給delete語句中的sname(學(xué)生姓名),利用delete語句,把score表中相關(guān)學(xué)生信息刪除。import 。import 。import 。import 。import 。public class ScoreDao { public ArrayList queryScore(String key) { ArrayList lis = new ArrayList()。 Statement stm。 String sql = select * from score where sname like 39。 。 ResultSet rs = (sql)。 (score)。 } return lis。 Connection con = ()。 try { stm = ()。% + + %39。 (sql)。 while (()) { Score score = new Score((1), (2), rs .getString(3), (4), (5))。 } } catch (SQLException e) { ()。 } public boolean addScore(int num, String sname, String course, int score, int credit) { Connection con = ()。 try { pst = (insert into score values(?,?,?,?,?))。 (2, sname)。 (4, score)。 int count = ()。 else return false。 } return false。 Statement stm。 String sql = delete from score where sname like 39。 。 int count = (sql)。 else return false。 } return false。String sname。int score。十個成員方法,分別獲取和設(shè)置這五個變量,即為score表中五個屬性的記錄值,均為getXXX()setXXX()方法,還有一個構(gòu)造方法,用于調(diào)用其對象時對成員變量賦值Score類源代碼:package model。 String sname。 int score。 public int getNum() { return num。 } public String getSname() { return sname。 } public String getCourse() { return course。 } public int getScore() { return score。 } public int getCredit() { return credit。 } public Score(int num, String sname, String course, int score,int credit) { super()。 = sname。 = score。}}(2)Student類:此類中有五個成員變量,int num。String sex。String dept。public class Student { int num。 String sex。 String dept。 } public void setNum(int num) { = num。 } public void setSname(String sname) { = sname。 } public void setSex(String sex) { = sex。 } public void setAge(int age) { = age。 } public void setDept(String dept) { = dept。 = num。 = sex。 = dept。給這兩個按鈕注冊事件addActionListener,分別在內(nèi)部類TeacherLoginActionListene和StudentLoginActionListener中的默認(rèn)方法actionPerformed()中創(chuàng)建TeacherLoginUI類和StudentLoginUI類的對象,即打開教師登陸界面和學(xué)生登錄界面,并將原登陸界面關(guān)閉。import .*。import .*。 JButton bt1, bt2。 public LoginUI() { l1 = new JLabel(請選擇用戶類型)。 bt2 = new JButton(學(xué)生)。 (null)。 (l1)。 (bt1)。 (bt2)。//注冊事件 (new StudentLoginActionListener())。 (200, 200, (), ())。 (用戶登錄界面)。 (true)。 } })。 dispose()。 dispose()。 }}執(zhí)行截圖如下:(2)StudentLoginUI類:此類為學(xué)生登陸界面,在這個界面上有兩個文本框,分別輸入學(xué)生姓名和登錄密碼,還有兩個按鈕,登陸和退出。若存在,則創(chuàng)建StudentScoreUI類的對象,即打開學(xué)生成績界面,顯示此登陸學(xué)生的成績信息,若不存在,則提示密碼錯誤。import .*。import .*。public class StudentLoginUI extends JFrame{ JLabel l1, l2。 JPasswordField t2。 Container cp。 public String st2。 l2 = new JLabel(密碼)。 t2 = new JPasswordField(12)。 bt2 = new JButton(退出)。 (null)。 (l1)。 (t1)。 (l2)。 (t2)。 (bt1)。 (bt2)。//注冊事件 (new ExitActionListener())。 (200, 200, (), ())。 (學(xué)生登錄界面)。 (true)。 } })。 st2 = ()。 boolean isSuccess = (st1, st2)。 dispose()。 } } class ExitActionListener implements ActionListener { public void actionPerformed(ActionEvent e) { (0)。 }}執(zhí)行截圖如下:(3)StudentScoreUI類:此類為學(xué)生成績界面,此類中有一個標(biāo)簽和一個表格。表格中為此學(xué)生的成績。StudentScoreUI類源代碼:package ui。import .*。import .*。import 。import 。 JLabel selectionLabel。 Container container。 JScrollPane bookScrollPane。 public StudentScoreUI(){ container = ()。 topPanel = new JPanel()。 (selectionLabel)。 table = new JTable()。 (, bookScrollPane)。 (, bottomPanel)。 (600, 450)。 ScoreDao oneScore=new ScoreDao()。 VectorString head = new Vector()。 (姓名)。 (成績)。 VectorVector content = new Vector()。 i ()。 Score oneScore1 = (Score) (i)。 (())。 (())。 (row)。 (model)。 }}執(zhí)行截圖如下:(4)TeacherLoginUI類:此類為教師登陸界面,在這個界面上有兩個文本框,分別輸入教師姓名和登錄密碼,還有兩個按鈕,登陸和退出。若存在創(chuàng)建TeacherMainUI類的對象,即打開教師主界面,若不存在,則提示密碼錯誤。import .*。import .*。public class TeacherLoginUI extends JFrame { JLabel l1, l2。 JPasswordField t2。 Container cp。 l2 = new JLabel(密碼)。 t2 = new JPasswordField(12)。 bt2 = new JButton(退出)。 (null)。 (l1)。 (t1)。 (l2)。 (t2)。 (bt1)。 (bt2)。//注冊事件 (new ExitActionListener())。 (200, 200, (), ())。 (教師登錄界面)。 (true)。 } })。 String st2 = ()。 boolean isSuccess = (st1, st2)。 dispose()。 } } class ExitActionListener implements ActionListener { public void actionPerformed(ActionEvent e) { (0)。 }}執(zhí)行截圖如下:(5)TeacherMainUI類:此類為教師主界面類,在此界面上有一個菜單欄,三個菜單:文件,查詢,修改。“查詢”菜單中有“學(xué)生基本信息”和“學(xué)生成績信息”兩個菜單項:當(dāng)點擊“學(xué)生基本信息”時,通過注冊事件,創(chuàng)建InformationQueryUI類的對象,即打開查詢學(xué)生基本信息的窗口,當(dāng)點擊“學(xué)生成績信息”時,通過注冊事件,創(chuàng)建ScoreQueryUI類的對象,即打開查詢學(xué)生成績信息的窗口。TeacherMainUI類源代碼:package ui。import .*。public class TeacherMainUI extends JFrame{Container ctp。 (歡迎進入學(xué)生管理系統(tǒng)!)。 JMenuBar menuBar = new JMenuBar()。 (menuBar)。 (true)。 JMenuItem exitMenuItem=new JMenuItem(退出)。//注冊事件 (exitMenuItem)。 JMenu queryMenu=new JMenu(查詢)。 JMenuItem queryScoreMenuItem=new JMenuItem(學(xué)生成績查詢)。//注冊事件 (new QueryScoreActionListener())。 (queryScoreMenuItem)。 JMenu changeMenu=new JMenu(修改)。 JMenuItem deleteMenuItem=new JMenuItem(刪除畢業(yè)生信息)。 JMenuItem deleteScoreMenuItem=new JMenuItem(刪除成績信
點擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1