《奖学金评定管理系统设计.doc》由会员分享,可免费在线阅读全文,更多与《(奖学金评定管理系统设计)(最终版)》相关文档资源请在帮帮文库(www.woc88.com)数亿文档库存里搜索。
1、quot重查quot);JTabletable;DefaultTableModeldtm;Stringcolumns[]={quot学号quot,quot姓名quot,quot专业班级quot,quot基础分quot,quot任职分quot,quot集体荣誉分quot,quot运动会分quot,quot校园文化分quot,quot公益活动分quot,quot等级考试分quot,quot辅修加分quot,quot学术加分quot,quot德育总分quot};Objectbody[][]=newObject[][];Connectioncon;Statementstmt;ResultSetrs;ublicStudentMoralEdiccationScore(){setTitle(quot德育成绩查询系统quot);setSize(,);table=newJTable(body,columns);表格JScrollPanesl=newJScrollPane(table);Containerc=getContentPane();csetLayout(null);xsetBounds(,,,);xsetFont(newFont(quot华文行楷quot,FontBOLD,));cadd(x);Fontf=newFont(quot楷体quot,FontPLAIN,);x[]setBounds(,,,);x[]setBounds(,,,);x[]setBounds(,,,);x[]setBounds(,,,);x
2、t(s);}ublicvoidactionPerformed(ActionEventevt){try{ClassforName(quotsunjdbcodbcJdbcOdbcDriverquot);Connectioncon=DriverManagergetConnection(quotjdbc:odbc:studentquot);stmt=concreateStatement(ResultSetTYPE_SCROLL_SENSITIVE,ResultSetCONCUR_UPDATABLE);rs=stmtexecuteQuery(quotselect*frommoralediccationscorewhere专业班级='quot+y[]getText()+quot'ORDERBY德育总分DESCquot);for(inti=;iltbodylength;i++){stmtexecuteUdate(quotudatemoralediccationscoreset德育总分=(基础分+任职分+集体荣誉分+运动会分+校园文化分+公益活动分+等级考试分+辅修加分+学术加分)where学号='quot+body[i][]+quot'quot);}}catch(Excetione){Systemerrrintln(egetMessage());}if(evtgetSource()==button){y[]setText(null);y[]setText(null);y[]setText(null);}if(evt
3、=stmtexecuteQuery(quotselect*fromcoursescorewhere专业班级='quot+y[]getText()+quot'quot);while(rsnext()){body[i][]=rsgetString(quot学号quot);body[i][]=rsgetString(quot姓名quot);body[i][]=rsgetString(quot专业班级quot);body[i][]=rsgetString(quot经济法概论quot);body[i][]=rsgetString(quot电子支付quot);body[i][]=rsgetString(quotJavaquot);body[i][]=rsgetString(quotWebquot);body[i][]=rsgetString(quot财务管理quot);body[i][]=rsgetString(quot电商管理quot);body[i][]=rsgetString(quot客户关系quot);body[i][]=rsgetString(quot生产与运作quot);body[i][]=rsgetString(quot形势政策quot);body[i][]=rsgetString(quot学科总分quot);i++;}thisreaint();tablevalidate();}catch(SQLExcetionex){Systemerrrintln(exgetMessage());}}}*ubli
4、[]setBounds(,,,);y[]setBounds(,,,);x[]setBounds(,,,);y[]setBounds(,,,);x[]setBounds(,,,);y[]setBounds(,,,);for(inti=;ilt;i++){x[i]setFont(f);cadd(x[i]);}for(intj=;jlt;j++){y[j]setFont(f);cadd(y[j]);}yaddItem(quot所有班级quot);yaddItem(quot电商班quot);yaddItem(quot电商班quot);yaddItem(quot电商班quot);yaddItem(quot电商班quot);yaddItemListener(this);ysetBounds(,,,);ysetFont(f);cadd(y);buttonsetBounds(,,,);buttonsetFont(f);cadd(button);buttonaddActionListener(this);buttonsetBounds(,,,);buttonsetFont(f);cadd(button);buttonaddActionListener(this);slsetBounds(,,,);cadd(sl);setVisible(true);}ublicvoiditemStateChanged(ItemEvente){Strings=(ygetSelectedItem())toString();y[]setTex
5、;elsetry{ClassforName(quotsunjdbcodbcJdbcOdbcDriverquot);con=DriverManagergetConnection(quotjdbc:odbc:studentquot);stmt=concreateStatement(ResultSetTYPE_SCROLL_SENSITIVE,ResultSetCONCUR_UPDATABLE);获取数据库rs=stmtexecuteQuery(quotselect*fromcoursescorewhere学号='quot+agetText()+quot'quot);}catch(Excetione){Systemerrrintln(egetMessage());}try{while(rsnext()){d[]setText(rsgetString(quot学号quot));d[]setText(rsgetString(quot姓名quot));d[]setText(rsgetString(quot专业班级quot));d[]setText(rsgetString(quot经济法概论quot));d[]setText(rsgetString(quot电子支付quot));d[]setText(rsgetString(quotJavaquot));d[]setText(rsgetString(quotWebquot));d[]setText(rsgetString(quot财务管理quot));d[]setT
6、bel(quot专业班级:quot);JTextFieldsetstudentID=newJTextField();JComboBoxsetstudentClass=newJComboBox();JTextFieldsetstudentName=newJTextField();JTextFieldgetclass=newJTextField();JButtonbtn=newJButton(quot查询quot);JButtonbtn=newJButton(quot重查quot);JTabletable;DefaultTableModeldtm;Stringcolumns[]={quot学号quot,quot姓名quot,quot专业班级quot,quot学科成绩quot,quot德育成绩quot,quot综合成绩quot,quot奖学金等级quot};Objectbody[][]=newObject[][];Connectioncon;Statementstmt;ResultSetrs;ublicScholarshiSelectSystem(){setTitle(quot奖学金评定信息查询quot);table=newJTable(body,columns);表格JScrollPanesl=newJScrollPane(table);滚动条getContentPane()setLayout(null);lbsetBounds(,,,);lbsetFont(newFont(quot华文行楷quot,Fo
7、,quotquot,quot客户关系quot,quotquot,quotstmtexecuteUdate(quotudatecoursescoreset经济法概论='quot+d[]getText()+quot',电子支付='quot+d[]getText()+quot',Java='quot+d[]getText()+quot',Web='quot+d[]getText()+quot',财务管理='quot+d[]getText()+quot',电商管理='quot+d[]getText()+quot',客户关系='quot+d[]getText()+quot',生产与运作='quot+d[]getText()+quot',形势政策='quot+d[]getText()+quot'where学号='quot+agetText()+quot'quot);newJOtionPane()showMessageDialog(null,quot学生学科成绩修改成功!quot);}catch(SQLExcetione){Systemerrrintln(egetMessage());}}});clearsetBounds(,,,);cadd(clear);clearaddActionListener(newActionListener(){ublicvoidactionPerformed(ActionEventarg){if(d[]getText()equals(quotquot)amamd[]getText()
8、;body[i][]=rsgetString(quot任职分quot);body[i][]=rsgetString(quot集体荣誉分quot);body[i][]=rsgetString(quot运动会分quot);body[i][]=rsgetString(quot校园文化分quot);body[i][]=rsgetString(quot公益活动分quot);body[i][]=rsgetString(quot等级考试分quot);body[i][]=rsgetString(quot辅修加分quot);body[i][]=rsgetString(quot学术加分quot);body[i][]=rsgetString(quot德育总分quot);i++;}thisreaint();tablereaint();表格刷新}catch(SQLExcetionex){Systemerrrintln(exgetMessage());}}}}(六)奖学金评定系统综合管理界面imortjavaawt*;imortjavaxswing*;classScholarshiSelectSystemextendsJFrameimlementsActionListener,ItemListener{JLabellb=newJLabel(quot奖学金信息查询quot);JLabellb=newJLabel(quot学号:quot);JLabellb=newJLabel(quot姓名:quot);JLabellb=newJLa
9、ext(rsgetString(quot电商管理quot));d[]setText(rsgetString(quot客户关系quot));d[]setText(rsgetString(quot生产与运作quot));d[]setText(rsgetString(quot形势政策quot));}}catch(SQLExcetione){Systemerrrintln(egetMessage());}}});savesetBounds(,,,);cadd(save);saveaddActionListener(newActionListener(){ublicvoidactionPerformed(ActionEventarg){try{ClassforName(quotsunjdbcodbcJdbcOdbcDriverquot);con=DriverManagergetConnection(quotjdbc:odbc:studentquot);stmt=concreateStatement(ResultSetTYPE_SCROLL_SENSITIVE,ResultSetCONCUR_UPDATABLE);获取数据库表rs=stmtexecuteQuery(quotselect*fromcoursescorequot);}catch(Excetione){Systemerrrintln(egetMessage());}try{quot,quotquot,quotquot,quotquot,quotquot
10、cstaticvoidmain(String[]args){JFrameframe=newStudentCourseScore();framesetDefaultCloseOeration(JFrameEXIT_ON_CLOSE);frameshow();framesetVisible(true);}*(五)学生德育成绩imortjavaawt*;imortjavaxswing*;ublicclassStudentMoralEdiccationScoreextendsJFrameimlementsActionListener,ItemListener{rivateJLabelx=newJLabel(quot学生德育成绩查询quot);rivateJLabelx[]={newJLabel(quot学院:quot),newJLabel(quot信息学院quot),newJLabel(quot系别:quot),newJLabel(quot电子商务系quot),newJLabel(quot学号:quot),newJLabel(quot姓名:quot),newJLabel(quot班级:quot)};rivateJTextFieldy[]={newJTextField(),newJTextField(),newJTextField()};JComboBoxy=newJComboBox();JButtonbutton=newJButton(quot查询quot);JButtonbutton=newJButton(
11、equals(quotquot)amamd[]getText()equals(quotquot)amamd[]getText()equals(quotquot)amamd[]getText()equals(quotquot)amamd[]getText()equals(quotquot)amamd[]getText()equals(quotquot)amamd[]getText()equals(quotquot)amamd[]getText()equals(quotquot)amamd[]getText()equals(quotquot))newJOtionPane()showMessageDialog(null,quot以上信息不能为空!quot);elsetry{asetText(null);d[]setText(null);d[]setText(null);d[]setText(null);d[]setText(null);d[]setText(null);d[]setText(null);d[]setText(null);d[]setText(null);d[]setText(null);d[]setText(null);d[]setText(null);d[]setText(null);}catch(Excetione){Systemerrrintln(egetMessage());}}});setVisible(true);}}]=null;body[x][]=null;}inti=;rs
12、getSource()==button){if(y[]getText()equals(quotquot)amamy[]getText()equals(quotquot)amamy[]getText()equals(quotquot))newJOtionPane()showMessageDialog(null,quot无效查询条件!quot);消息对话框try{for(intx=;xltbodylength;x++){body[x][]=null;body[x][]=null;body[x][]=null;body[x][]=null;body[x][]=null;body[x][]=null;body[x][]=null;body[x][]=null;body[x][]=null;body[x][]=null;body[x][]=null;body[x][]=null;body[x][]=null;}inti=;rs=stmtexecuteQuery(quotselect*frommoralediccationscorewhere专业班级='quot+y[]getText()+quot'quot);while(rsnext()){body[i][]=rsgetString(quot学号quot);body[i][]=rsgetString(quot姓名quot);body[i][]=rsgetString(quot专业班级quot);body[i][]=rsgetString(quot基础分quot)