學(xué)生綜合測(cè)評(píng)系統(tǒng)(Java)_第1頁(yè)
學(xué)生綜合測(cè)評(píng)系統(tǒng)(Java)_第2頁(yè)
學(xué)生綜合測(cè)評(píng)系統(tǒng)(Java)_第3頁(yè)
學(xué)生綜合測(cè)評(píng)系統(tǒng)(Java)_第4頁(yè)
學(xué)生綜合測(cè)評(píng)系統(tǒng)(Java)_第5頁(yè)
已閱讀5頁(yè),還剩50頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、共享知識(shí)分享快樂(lè) 學(xué)生綜合測(cè)評(píng)系統(tǒng) 目錄 1. 需求分析2 2. 概要設(shè)計(jì)3 3. 詳細(xì)設(shè)計(jì)4 4. 用戶(hù)使用手冊(cè)8 4.1環(huán)境設(shè)置8 4.2操作步驟9 5. 程序創(chuàng)新點(diǎn)16 6. 使用的主要技術(shù) 16 7. 總結(jié)16 附錄16 卑微如螻蟻、堅(jiān)強(qiáng)似大象 1需求分析 隨著軟件的發(fā)展,學(xué)生的信息如今都是存儲(chǔ)在電腦的數(shù)據(jù)庫(kù)當(dāng)中的, 依靠電 腦軟件的學(xué)生綜合測(cè)評(píng)系統(tǒng)可以大大節(jié)約教師們的工作時(shí)間, 所以我們編寫(xiě)了學(xué) 生綜合測(cè)評(píng)系統(tǒng)。綜合測(cè)評(píng)系統(tǒng)能實(shí)時(shí)反應(yīng)數(shù)據(jù)庫(kù)中同學(xué)的信息記錄和信息處 理。 9考試平均成績(jī) 10. 考試名次 11. 同學(xué)互評(píng)分 12. 品德成績(jī) 13. 任課老師評(píng)分 14. 綜合測(cè)評(píng)總分

2、 15. 綜合測(cè)評(píng)名次 每條信息記錄要求包含: 1學(xué)號(hào) 2 姓名 3 性別 4 .家庭地址 5 聯(lián)系電話 6 高等數(shù)學(xué) 7 物理 8 英語(yǔ) 系統(tǒng)功能包括: 1查詢(xún)學(xué)生信息 2 .添加學(xué)生信息 3 刪除學(xué)生信息 4 .修改學(xué)生信息 5 .顯示所有學(xué)生信息 6查詢(xún)學(xué)生成績(jī) 7 添加學(xué)生成績(jī) 8 .修改學(xué)生成績(jī) 9 .顯示所有學(xué)生成績(jī) 10. 顯示所有信息(按考試名次排序、按綜合測(cè)名名次排序) 11. 退出 2.概要設(shè)計(jì) 孑件成緘胃殲 臨加學(xué)葉廉綃 A詢(xún)學(xué)牛岳U 學(xué)住綜介測(cè)評(píng)系統(tǒng)縞捌學(xué)4加處 一 74伽偕腳K餘學(xué)牛 1J 烤住學(xué)唯船馬 個(gè)冊(cè)畀小 、一 顯賦所柿們息J 根據(jù)需求分析中的描述,我們把學(xué)生

3、的信息都存入數(shù)據(jù)庫(kù)中,在數(shù)據(jù)庫(kù)中單 個(gè)學(xué)生內(nèi)包含信息如下: 學(xué)號(hào):sno 短文本 姓名:sname 短文本 性別:sex 短文本 家庭地址:add 長(zhǎng)文本 聯(lián)系電話:tel 短文本 咼等數(shù)學(xué):math數(shù)子(Double) 物理:physics 數(shù)字(Double) 英語(yǔ):english 數(shù)字(Double) 考試平均成績(jī): score_ave 數(shù)字(Double) 考試名次:no_ test 數(shù)字(Integer ) 同學(xué)互評(píng)分:score_tog 數(shù)字(Double) 品德成績(jī):score_pol 數(shù)字(Double) 任課教師評(píng)分: score_tea 數(shù)字(Double) 綜合測(cè)試綜合:

4、 score_s yn 數(shù)字(Double) 綜合測(cè)試名次: no_syn 數(shù)字( Integer ) 在此程序中所運(yùn)用的函數(shù)全部為構(gòu)造函數(shù)的功能 AddStudentFrm_info.class/ 按信息添加界面 AddStudentFrm_score.class/ 按成績(jī)添加界面 DeleteStudentFrm_info.class/ 刪除界面 DispStudentFrm_info.class/ 按信息顯示全部界面 DispStudentFrm_score.class/ 按成績(jī)顯示全部界面 EnterStudentFrm_delete_info.class/ 進(jìn)入刪除信息界面 Ente

5、rStudentFrm_disp_info.class/ 進(jìn)入顯示信息界面 EnterStudentFrm_disp_score.class/ 進(jìn)入顯示成績(jī)界面 EnterStudentFrm_modify_info.class/ 進(jìn)入修改信息界面 EnterStudentFrm_modify_score.class/ 進(jìn)入修改成績(jī)界面 MainFrm.class/ 主界面 ModifyStudentFrm_info.class/ 按信息修改界面 ModifyStudentFrm_score.class/ 按成績(jī)修改界面 StudentDao.class/ 操作函數(shù) StudentFrm_al

6、l.class/ 顯示全部信息界面 StudentFrm_info_all.class/ 顯示信息界面 StudentFrm_score_all.class/ 顯示成績(jī)界面 3 詳細(xì)設(shè)計(jì) * 查詢(xún)學(xué)生信息: 1) 輸入要查詢(xún)學(xué)生的學(xué)號(hào) public EnterStudentFrm_disp_info() 2) 查詢(xún)學(xué)生信息界面 public DispStudentFrm_info(String sno) 3) 查詢(xún)信息的函數(shù) public String queryStudents_info_one(String sno) private void executeUpdate(String sq

7、l) * 查詢(xún)學(xué)生成績(jī): 1) 輸入要查詢(xún)學(xué)生的學(xué)號(hào) public EnterStudentFrm_disp_score() 2) 查詢(xún)學(xué)生成績(jī)界面 public DispStudentFrm_score(String sno) 3) 查詢(xún)成績(jī)的函數(shù) public String queryStudents_score_one(String sno) private void executeUpdate(String sql) * 添加學(xué)生信息: 1) 添加學(xué)生信息界面 public AddStudentFrm_info() 2) 添加學(xué)生信息的函數(shù) public boolean addStud

8、ent_info(String sno, String sname, String sex, String add ,String tel) private void executeUpdate(String sql) * 添加學(xué)生成績(jī): 1) 添加學(xué)生成績(jī)界面 public AddStudentFrm_score() 2) 添加學(xué)生成績(jī)的函數(shù) public int addStudent_score(String sno,double math,double physics,double english,double score_ave,double score_tog,double scor

9、e_pol,double score_tea,double score_syn) public void orderStudent_no_test() public void orderStudent_no_syn() private void executeUpdate(String sql) * 刪除學(xué)生: 1) 輸入要?jiǎng)h除學(xué)生的學(xué)號(hào) public EnterStudentFrm_delete_info() 2) 刪除學(xué)生界面 public DeleteStudentFrm_info(String sno) 3) 刪除的函數(shù) public void deleteStudent_sno(St

10、ring sno) public void orderStudent_no_test() public void orderStudent_no_syn() private void executeUpdate(String sql) * 修改學(xué)生信息: 1) 輸入要修改學(xué)生的學(xué)號(hào) public EnterStudentFrm_modify_info() 2) 修改學(xué)生信息界面 public ModifyStudentFrm_info(String sno) 3) 修改信息的函數(shù) public boolean modifyStudent_info(String sno, String snam

11、e, String sex, String add ,String tel) private void executeUpdate(String sql) * 修改學(xué)生成績(jī): 1) 輸入要修改學(xué)生的學(xué)號(hào) public EnterStudentFrm_modify_score() 2) 修改學(xué)生成績(jī)界面 public ModifyStudentFrm_score(String sno) 3) 修改成績(jī)的函數(shù) public boolean modifyStudent_score(String sno,double math,double physics,double english,double

12、score_ave,double score_tog,double score_pol,double score_tea,double score_syn) public void orderStudent_no_test() public void orderStudent_no_syn() private void executeUpdate(String sql) * 顯示所有學(xué)生信息: 1) 顯示信息界面: private void initTable() private void updateTable() public StudentFrm_info_all() 2) 顯示的函數(shù)

13、public String queryStudents_info_all() private void executeUpdate(String sql) * 顯示所有學(xué)生信息: 1) 顯示信息界面: private void initTable() private void updateTable() public StudentFrm_score_all() 2) 顯示的函數(shù) public String queryStudents_score_all() private void executeUpdate(String sql) * 顯示所有信息: 1) 顯示信息界面: private

14、void initTable() private void updateTable() public Stude ntFrm_all() 2)顯示的函數(shù) public Stri ng queryStude nts_all() private void executeUpdate(Stri ng sql) * 4. 用戶(hù)使用手冊(cè) 4.1環(huán)境設(shè)置 1.在Eclipse中創(chuàng)建一個(gè)Java工程和使用的類(lèi),如圖所示 Jl MiJ,Fiv.|sa xM SnjdwjnMXiJH. a r-i Qav4 rpdip-白 E1F Eriil FWjta-Hv 呂2強(qiáng)E*1*! 誠(chéng)疋m腎 HoU-f 葉rh E

15、c 蜀仙“ 匕申 QiirkfeMin| 曲宰曲 .1* 3p-| T?J| 3Fl*a r;r li MiSJiA#叫Xsjfrw* :-AxU liaccvl| * b :加 Drirl5udnf in_riii4i 1 OiipM止HEjr如 j*va Iti 0? sp-Sti _ra rr.i - -血dr4fF=vch jmi 理Sfcri*rtDojiw I 5耐|4 ii j ynj :- 曲 -xd mfrm.nrJD.j L| 科I莊如rim 1_ Kw;j 1; mwzrznvx 十臺(tái) m NmiEMi:-fTBii|-)j Mha *WHU E E-Mi: 4,* S

16、) J MW H#TUtMI:-|B39Xad- ww tenubMC-ri); EH- EM- 1 r*W 5 nn km wLL 3m aU Irw bL4 非 E Hl? “R bLS rn h2L Me離 rw k23 iItm dl - HhuCemi-jhiikv-: i PrettaMi: 9 JMdoc tj. ItelMiifi* 曰二sw * i hct NhnriunN:養(yǎng) .c閃=T : I linrrHAvd-* MiirTV 巾 |I. fxSMrisr 追 rww AnicwLk 電 iw ArtxMUE ii rww rCtR3GH * Sird*TnTi_dl

17、 _O 54iTtfrm_REC9 3l f kiMlk SipeS Lqonr K 匚 目Wl 人中 Cwtwi: Wf jZjUSEilv- |Uw udf Jhfd 4LM 4ach-EUtCSfl刖 E.3* lUV it 2 : K 上疳電?iR 10000022 TO 71 74. W TD S ,30L3L9W 胃 丄牌電:n字涯 3WQIH3 時(shí) 怖幹 和 _M 2DL3L3tX7 S 上疽電力學(xué)牌 沖網(wǎng)斶 ae 731 S3 72 M .ZDL3LUM 胃 丄牌電T*K jQO:flK3 57 T3L W TJ 1 2DLSL304 3? 上旳電力學(xué)瞬 iamtai LOB

18、LM.M 100 L ?ni ni nin- as -左 mnonnPT H5 # T3L 0 _ .TB. F 丁 Hl: H w I rr.ff A: e I- F ! H F 9 4.2操作步驟 0 編譯MainFrm.java的文件,如果有編譯錯(cuò)誤,則根據(jù)提示修改,否則編譯成 功。最后編譯、連接和運(yùn)行測(cè)試程序文件,如圖所示。 ir IHW bFidor 加鼻 pfOfecr- MytdipFWWflrktw?nh grajKl Myfdipu Mabiii-啟 s yid: 字主鞅IK理 aHHV -Q ErttfShrie如m杯用o宅ji .Irtwr 卅.lA.i!l E9 prc

19、jea -jl iifludvnrrTvi1!口 jiAM 同卅Fr甌皇口厲嶺 I Q OiHMeEwditTifwnJrAoJa-Bi -2| J OHIudMrtfrmCDrvjBv ,1 ErtwrSliKtartfrni_drirtiJr,fc Q EriMi$lurihMFrM_dk_Rilaj* - 他 (rnaJnAabj J E rriM rSluda rtfTm_mcd Fp _usr jl MflviFnnjMJi p JZi import javax.swi ng.*; import iava.awt.*; import java.awt.eve nt.*; public

20、 class MainFrm exte nds JFrame private void in itMe nu() JMe nuBar bar =new JMen uBar(); JMenu m1 = new JMenu(學(xué)生信息管理); JMenu m2 = new JMenu( 學(xué)生成績(jī)管理 ); JMenu m3 = new JMenu( 顯示所有信息 ); JMenuItem m11 = JMenuItem m12 = JMenuItem m13 = JMenuItem m14 = JMenuItem m15 = JMenuItem m16 = JMenuItem m21 = JMenu

21、Item m22 = JMenuItem m23 = JMenuItem m24 = JMenuItem m31 = new JMenuItem( new JMenuItem( new JMenuItem( new JMenuItem( new JMenuItem( new JMenuItem( new JMenuItem( new JMenuItem( new JMenuItem( new JMenuItem( new JMenuItem( 查詢(xún)學(xué)生信息 ); 添加學(xué)生信息 ); 刪除學(xué)生信息 ); 修改學(xué)生信息 ); 顯示所有學(xué)生信息 退出 ); 查詢(xún)學(xué)生成績(jī) ); 添加學(xué)生成績(jī) ); 修

22、改學(xué)生成績(jī) ); 顯示所有學(xué)生成績(jī) 顯示所有信息 ); ); ); m11.addActionListener( new ActionListener() public void actionPerformed(ActionEvent e) StudentFrm_info_Clicked(); ); m12.addActionListener( new ActionListener() public void actionPerformed(ActionEvent e) AddStudent_info_Clicked(); ); m13.addActionListener( new Actio

23、nListener() public void actionPerformed(ActionEvent e) DeleteStudent_info_Clicked(); ); m14.addActionListener( new ActionListener() public void actionPerformed(ActionEvent e) ModifyStudent_info_Clicked(); ); m15.addActionListener( new ActionListener() public void actionPerformed(ActionEvent e) Stude

24、ntFrm_info_all_Clicked(); ); m16.addActionListener( new ActionListener() public void actionPerformed(ActionEvent e) exit_Clicked(); ); m21.addActionListener( new ActionListener() public void actionPerformed(ActionEvent e) StudentFrm_score_Clicked(); ); m22.addActionListener( new ActionListener() pub

25、lic void actionPerformed(ActionEvent e) AddStudent_score_Clicked(); ); m23.addActionListener( new ActionListener() public void actionPerformed(ActionEvent e) ModifyStudent_score_Clicked(); ); m24.addActionListener( new ActionListener() public void actionPerformed(ActionEvent e) StudentFrm_score_all_

26、Clicked(); ); m31.addActionListener( new ActionListener() public void actionPerformed(ActionEvent e) StudentFrm_all_Clicked(); ); m1.add(m11); m1.add(m12); m1.add(m13); m1.add(m14); m1.add(m15); m1.addSeparator(); m1.add(m16); m2.add(m21); m2.add(m22); m2.add(m23); m2.add(m24); m3.add(m31); bar.add(

27、m1); bar.add(m2); bar.add(m3); this .setJMenuBar(bar); protected void StudentFrm_all_Clicked() new StudentFrm_all(); protected void StudentFrm_score_all_Clicked() new StudentFrm_score_all(); protected void ModifyStudent_score_Clicked() new EnterStudentFrm_modify_score(); protected void AddStudent_sc

28、ore_Clicked() new AddStudentFrm_score(); protected void StudentFrm_score_Clicked() new EnterStudentFrm_disp_score(); protected void StudentFrm_info_Clicked() new EnterStudentFrm_disp_info(); protected void ModifyStudent_info_Clicked() new EnterStudentFrm_modify_info(); protected void StudentFrm_info

29、_all_Clicked() new StudentFrm_info_all(); private void DeleteStudent_info_Clicked() new EnterStudentFrm_delete_info(); private void AddStudent_info_Clicked() new AddStudentFrm_info(); private void exit_Clicked() if (JOptionPane. showConfirmDialog (this , 確認(rèn)退出? , 退出系統(tǒng) , JOptionPane. YES_NO_OPTION, JO

30、ptionPane.QUESTION_MESSAGE) = JOptionPane. YES_OPTION) System. exit (0); public Mai nF rm() JPanel jp =_(JPanel)this .getContentPane(); ini tMe nu(); this .setTitle( 學(xué)生綜合測(cè)評(píng)系統(tǒng)“); this .setSize(1000, 600); this .setVisible( true ); this .setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); public static vo

31、id main( Str in g args) new Mai nFrm(); package project; import j import java.sql.*; public class Stude ntDao private Stri ng driver = su n.jdbc.odbc.JdbcOdbcDriver private Stri ng url = jdbc:odbc:mydb; private void executeUpdate (Stri ng sql) try Class. forName ( driver ); Connection con = DriverMa

32、nager.getConnection(url ); Stateme nt cmd = con. createStateme nt(); cmd.executeUpdate(sql); con. close(); catch (Exception ex) ex.pri ntStackTrace(); publicboolea n modifyStude nt_in fo(Stri ng sno, Stri ng sn ame, String sex, Str ing add ,Str ing tel) +sn ame+ ,sex String sql = update stu_pro set

33、sno = +sno+ ,sname =+sex+ ,add = +add +,tel = +tel+ where sno = +sno+ ; executeUpdate(sql); orderStude nt_no _test(); orderStude nt_no_syn(); return true ; public boolean modifyStudent_score(String sno, physics, double english, double score_ave, double score_tog, double score_pol, score_syn) String

34、sql =update stu_pro set math = double math, double double score_tea, double +math+ ,physics = +score_tog+ +,score_ave = ,score_pol = +,score_tea = +score_ave+ +score_pol +score_tea+ ,score_tog = ,score_syn = +score_syn+ +physics+ ,english = +english where sno = +sno+ executeUpdate(sql); orderStudent

35、_no_test(); orderStudent_no_syn(); return true public void orderStudent_no_syn() String rows = null ; int rowcount=0; try Class. forName ( driver ); Connection con = DriverManager.getConnection (url ); Statement cmd = con.createStatement(); String sql =select count(*) from stu_pro; ResultSet rs = cm

36、d.executeQuery(sql); rs.next(); rowcount = rs.getInt(1); rows = new Stringrowcount3; sql = select * from stu_pro order by score_syn desc ; rs = cmd.executeQuery(sql); rowcount = 0; while (rs.next() rowsrowcount0 = rs.getString(1); rowsrowcount1 = rs.getString(15); rowsrowcount2 = String. valueOf (ro

37、wcount+1); rowcount+; con.close(); catch (Exception ex) ex.printStackTrace(); for ( int i=0;irows. length ;i+) executeUpdate( update stu_pro set no_syn = +rowsi2+ where sno= +rowsi0+ ); 共享知識(shí) 分享快樂(lè) public void orderStudent_no_test() String rows = null ; int rowcount=0; try Class. forName ( driver ); C

38、onnection con = DriverManager. getConnection (url ); Statement cmd = con.createStatement(); String sql =select count(*) from stu_pro; ResultSet rs = cmd.executeQuery(sql); rs.next(); rowcount = rs.getInt(1); rows = new Stringrowcount3; sql = select * from stu_pro order by score_ave desc rs = cmd.exe

39、cuteQuery(sql); rowcount = 0; valueOf (rowcount+1); while (rs.next() rowsrowcount0 = rs.getString(1); rowsrowcount1 = rs.getString(9); rowsrowcount2 = String. rowcount+; sno= +rowsi0+ con.close(); catch (Exception ex) ex.printStackTrace(); for ( int i=0;irows. executeUpdate( ); length ;i+) update st

40、u_pro set no_test +rowsi2+ where public boolean add ,String tel) int addStudent_info(String sno, String sname, String sex, String try flag=-1; Class. forName ( driver ); Connection con = DriverManager. Statement cmd = con.createStatement(); String sql =select count(sno) from stu_pro where sno = getC

41、onnection (url ); +sno+ I! 卑微如螻蟻、堅(jiān)強(qiáng)似大象 ResultSet rs = cmd.executeQuery(sql); 共享知識(shí)分享快樂(lè) rs.next(); flag=rs.getInt(1); con.close(); catch (Exception ex) ex.printStackTrace(); if (flag=0) String sql = insert into stu_pro(sno,sname,sex,add,tel) values( +sno+ , +sname+ , +sex+ , +add+ , +tel+ ) ; executeU

42、pdate(sql); return true ; else return false ; public int addStudent_score(String sno, double math, double physics, double english, double score_ave, double score_tog, double score_pol, double score_tea, double score_syn) intflag=-1; StudentDao studentDao = new StudentDao(); try Class. forName ( driv

43、er ); Connection con = DriverManager. getConnection (url ); Statement cmd = con.createStatement(); String sql = select count(sno) from stu_pro where sno = +sno+ I!. ) ResultSet rs = cmd.executeQuery(sql); rs.next(); flag=rs.getInt(1); con.close(); catch (Exception ex) ex.printStackTrace(); String te

44、mp_info=studentDao.queryStudents_info_one(sno); String temp_score=studentDao.queryStudents_score_one(sno); if (flag!=0) for ( int i=1;itemp_info. (temp_infoi= flag=1; return l null flag; ength ) ;i+) if for ( int i=2;itemp_score. length ;i+) if (temp_scorei!= null ) flag=2; return flag; 卑微如螻蟻、堅(jiān)強(qiáng)似大象

45、Ill III update stu_pro set math = +english III String sql = +physics+ ,english = +,score_ave = +score_tog+ ,score_pol = +score_pol +math+ ,physics = +score_ave+ ,score_tog = +,score_tea = +score_tea+ ,score_syn = +score_syn+ where sno = +sno+ ; executeUpdate(sql); orderStudent_no_test(); orderStuden

46、t_no_syn(); return flag=3; return flag; public void deleteStudent_sno(String sno) + sno + I! String sql = delete from stu_pro where sno= executeUpdate(sql); orderStudent_no_test(); orderStudent_no_syn(); public String queryStudents_all() String rows =null ; try Class. forName ( driver ); Connection

47、con = DriverManager.getConnection (url ); Statement cmd = con.createStatement(); String sql =select count(*) from stu_pro ; ResultSet rs = cmd.executeQuery(sql); rs.next(); int rowcount = rs.getInt(1); rows = new Stringrowcount15; sql = select * from stu_pro order by sno asc; rs = cmd.executeQuery(s

48、ql); rowcount = 0; while (rs.next() for ( int i = 1; i = 15; i+) rowsrowcounti - 1 = rs.getString(i); rowcount+; con.close(); (url ); (url ); catch (Exception ex) ex.printStackTrace(); return rows; public String queryStudents_info_all() String rows = null ; try Class. forName ( driver ); Connection

49、con = DriverManager. getConnection Statement cmd = con.createStatement(); String sql =select count(*) from stu_pro ResultSet rs = cmd.executeQuery(sql); rs.next(); int rowcount = rs.getInt(1); rows = new Stringrowcount5; sql = select * from stu_pro order by sno asc rs = cmd.executeQuery(sql); rowcou

50、nt = 0; while (rs.next() for ( int i = 1; i = 5; i+) rowsrowcounti - 1 = rs.getString(i); rowcount+; con.close(); catch (Exception ex) ex.printStackTrace(); return rows; public String queryStudents_score_all( int t) String rows = null ; try Class. forName ( driver ); Connection con = DriverManager.

51、getConnection Statement cmd = con.createStatement(); String sql =select count(*) from stu_pro ResultSet rs = cmd.executeQuery(sql); rs.next(); int rowcount = rs.getInt(1); rows = new Stringrowcount12; switch (t) case 0:sql =select * from stu_pro order by sno asc; break ; case 1:sql =select * from st

52、u_pro order by no_test asc; break case 2:sql =select * from stu_pro order by no_syn asc; break rs = cmd.executeQuery(sql); rowcount = 0; while (rs.next() rowsrowcount0 = rs.getString(1); rowsrowcount1 = rs.getString(2); for ( int i = 6; i = 15; i+) rowsrowcounti - 4 = rs.getString(i); rowcount+; con

53、.close(); catch (Exception ex) ex.printStackTrace(); return rows; public String queryStudents_score_one(String sno) String rows =null ; try Class. forName ( driver ); Connection con = DriverManager.getConnection (url ); Statement cmd = con.createStatement(); String sql =select * from stu_pro where s

54、no = +sno+ ; ResultSet rs = cmd.executeQuery(sql); rs.next(); rows = new String12; rows0 = rs.getString(1); rows1 = rs.getString(2); for ( int i = 6; i = 15; i+) rowsi - 4 = rs.getString(i); con.close(); catch (Exception ex) ex.printStackTrace(); return rows; public String queryStudents_info_one(Str

55、ing sno) String rows =null ; try Class. forName ( driver ); Connection con = DriverManager.getConnection(url ); Stateme nt cmd = con. createStateme nt(); Stri ng sql = select * from stu_pro where sno = +sno+ ; ResultSet rs = cmd.executeQuery(sql); rs.n ext(); rows = new Strin g5; for ( int i = 1; i

56、= 5; i+) rowsi-1 = rs.getStri ng(i); con. close(); catch (Exception ex) ex.pri ntStackTrace(); return rows; publicboolea n isExist(Stri ng sno) int flag=0; try Class. forName ( driver ); Connection con = DriverManager.getConnection(url ); Stateme nt cmd = con. createStateme nt(); String sql = select

57、 cou nt(s no) from stu_pro where sno = +sno+ I!. J ResultSet rs = cmd.executeQuery(sql); rs.n ext(); flag=rs.get In t(1); con. close(); catch (Exception ex) ex.pri ntStackTrace(); if (flag=1) return true ; else return false ; package project; import javax.swi ng.*; import java.awt.*; import java.awt

58、.eve nt.*; public class AddStuden tFr mnfoexte nds JFrame impleme ntsActi on Liste ner Stude ntDaostude ntDao= new Stude ntDao(); JButtonbtn_add = new JButton( 確定); JButton btn_del JLabellb_s no= JLabellb_s name JLabellb_sex= JLabellb_add= JLabellb_tel= =new JButton( 取消); new JLabel(學(xué)號(hào)); =new JLabel

59、(姓名); new JLabel(性別); new JLabel(家庭地址) new JLabel(聯(lián)系電話) JTextField txt_ .sno JTextField txt_ .sn ame JComboBox cmb _sex = JTextField txt_ .add JTextField txt_ .tel =new JTextField(); =new JTextField(); new JComboBox(); =new JTextField(); =new JTextField(); publicAddStude ntFrm_i nfo() JPanel jp = (J

60、Pa nel)this .getC onten tPa ne() JPanel jp1 =new JPan el(); jp1.setLayout(new GridLayout(6, 2, 5, 10); jp1.add( lb_sno ); jp1.add( txt_s no ); jp1.add( lb_sname ); jp1.add( txt_sname ); jp1.add( lb_sex ); jp1.add( cmb_sex); cmb sex .addItem(男上 cmb sex .addltem(女); jp1.add( lb_add ); jp1.add( txt_add

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論