java学生信息管理系统Word格式.docx
《java学生信息管理系统Word格式.docx》由会员分享,可在线阅读,更多相关《java学生信息管理系统Word格式.docx(38页珍藏版)》请在冰豆网上搜索。
壬朝
1S90-01-12
男
钦件。
9斗1
Q941H
張飞
蓉
斑牛09斗1
(3)成绩信息表创建:
createtable成绩信息表(
学号varchar(15),
计算机网络varchar(8),
计算机专业英语smallint,
计算机信息技术基础smallint,
Java程序设计smallint,
数据库应用实训教程smallint,
高等数学smallint,
Xmlsmallint,)
取-<
«
t>
QP_q阳ax叩卜i百岸硏昭_aco才*甘百屈釈:
raise▼八
学弓
计芟机幽
计算机寺业英诬
计蛙机信良拄…
Ed程序设讨
09^10i
90
7D
80
77
73
094102
7S
7B
93
07
37
*
/MLA£
AU1
flULL
也
概要结构分析:
学生成绩管理系
教师登录学生登录
仃
1
V
1r
I
添加学生
修改学生
删除学生
查
看学生
1.登录界面和主界面
import.*;
classmyConnection{ResultSetre;
publicmyConnection(){}
publicResultSetgetResult(Stringsql){
try{("
"
);
Connectionconn=("
jdbc:
odbc:
学生成绩管理系统"
,"
ww"
"
123"
Statementstmt=,;
ResultSetre=(sql);
returnre;
}
catch(Exceptione){
getResult——"
+());
returnnull;
}}
publicbooleanexecuteSql(Stringsql){
Statementstmt=();
(sql);
();
returntrue;
executeSql----"
returnfalse;
}}}
classstuMainFrameextendsJFrameimplementsActionListener
{JMenuBarjmb=newJMenuBar();
JMenuMessage=newJMenu("
信息"
JMenuScore=newJMenu("
查询"
JMenuItemItem1=newJMenuItem("
添加学生信息"
JMenuItemmNam=enewJMenuItem("
学生成绩查询"
JMenuItemmScore=newJMenuItem("
按成绩查询"
JMenuItemmNam=1newJMenuItem("
查询学生信息"
JLabellabel=newJLabel();
src/images/"
);
publicstuMainFrame(){ImageIconicon=newImageIcon(
(icon);
(0,0,(),());
add(label);
setSize(),());
(jmb);
(Message);
(Score);
(Item1);
(mNam)1;
(mNam)e;
(mScore);
(this);
}
publicvoidactionPerformed(ActionEvente)
{if()==Item1)
{newaddForm().setVisible(true);
elseif()==mNam)e
{dispose。
;
newScore1().setVisible(true);
elseif()==mScore)
{newscoreQueryForm().setVisible(true);
elseif()==mNam)1
{dispose。
;
newSerch1().setVisible(true);
classmainFrameextendsJFrameimplementsActionListener{
JLabellabel=newJLabel();
JMenuBarmBar=newJMenuBar();
JPanelp=newJPanel();
privateJMenumSystem,mOperate,mQuery,mHelp,myMenuUser
privateJMenultem
mFile,mNewmOpenmExit,mAddmDel,mModify,mNamjemiShow,mScore,mAbout,miUser,mAddSc
publicmainFrame()
{(mBar);
Imagelconicon=newImagelcon("
(icon);
(0,0,(),());
myMenuUse=newJMenu("
用户”);
miUser=newJMenultem("
编辑用户”);
(miUser);
mSystem=newJMenu("
系统"
);
mOperate=newJMenu("
数据操作”);
mQuery=newJMenu("
mHelp=newJMenu("
帮助"
(mSystem);
(mOperate);
(mQuery);
(mHelp);
(myMenuUser);
mFile=newJMenuItem("
文件"
mNew=newJMenuItem("
新建"
mOpen=newJMenuItem("
打开"
mExit=newJMenuItem("
退出"
(mFile);
(mNew);
(mOpen);
(mExit);
mAdd=newJMenuItem("
添加基本信息"
mAddSc=newJMenuItem("
添加成绩信息"
mDel=newJMenuItem("
删除"
mModify=newJMenuItem("
修改"
(mAdd);
(mAddSc);
(mDel);
(mModify);
mNam=enewJMenuItem("
查询学生信息"
mScore=newJMenuItem("
查询学生成绩"
miShow=newJMenuItem("
全部显示"
(miShow);
mAbout=newJMenuItem("
软件信息"
(mAbout);
(this);
publicvoidactionPerformed(ActionEvente){
if()==mExit){
dispose();
newCJ().setVisible(true);
elseif()==mAbout){
(this,"
学生成绩管理系统\n\n电信学院\n\n2012年3月"
"
软件信息"
;
}elseif()==mAdd){
newaddForm().setVisible(true);
elseif()==mAddSc){dispose();
true);
newaddScore().setVisible(elseif()==mDe){
dispose。
newdeleteForm().setVisible(true);
elseif()==mName
newSerch().setVisible(true);
elseif()==mScore){
newScore().setVisible(true);
elseif()==mModify){
newmodifyForm().setVisible(true);
elseif()==miUser){
newuserFrame().setVisible(true);
elseif()==miShow){
newfreshTable().setVisible(true);
}}}
classCJextendsJFrameimplementsActionListener{
JLabelt1=newJLabel("
ID号:
“);
JLabelt3=newJLabel("
密码:
publicStringzh=null;
JTextFieldt2=newJTextField(null,15);
JTextFieldt4=newJPasswordField(null,15);
JRadioButtonb=newJRadioButton("
教师"
JRadioButtonb1=newJRadioButton("
学生"
JButtonjB1=newJButton("
登录"
JButtonjB2=newJButton("
取消”);
publicCJ(){super("
学生生成绩管理系统"
setLayout(null);
(110,170,60,20);
add(jB1);
(210,170,60,20);
add(jB2);
(90,50,80,35);
add(t1);
(120,50,150,35);
add(t2);
(90,100,80,35);
add(t3);
(120,100,150,35);
add(t4);
(200,20,70,30);
(120,20,70,30);
ButtonGroupbg=newButtonGroup();
(false);
(true);
add(b);
(b);
add(b1);
(b1);
ImageIconicon=newImageIcon("
setResizable(false);
setVisible(true);
setLocation(300,300);
setDefaultCloseOperation;
publicvoidactionPerformed(ActionEvente){
if()==jB2){
(0);
elseif()==jB1){
Stringusername,password;
username=();
password=();
if()){
if().equals("
)){
(null,"
请输入用户名"
温馨提示"
;
elseif().equals("
请输入密码"
}else{
myConnectionconn=newmyConnection();
ResultSetrs;
Stringsql="
select*from教师信息表where教师
ID='
+()+"
'
and登录密码='
;
try{
rs=(sql);
if()==1)
{setVisible(false);
while()){
sql="
select*from学籍信息表"
mainFramemf=newmainFrame();
(null);
(300,300);
("
学生成绩管理系统:
教师登录界面"
(newWindowAdapter(){
publicvoidwindowClosing(WindowEvente){
});
(null,("
教师姓名"
)+"
老师!
您好!
欢迎登录学生成绩管理系统!
else{
用户名或密码错误"
登录失败
catch(Exceptioner){
学号
select*from学籍信息表where
='
+().toString()+"
select*from学籍信息表"
stuMainFramesmf=newstuMainFrame();
(500,400);
(false);
(newWindowAdapter(){
(null,("
学生姓名“)+"
同学!
欢迎登录学生成绩管理系统!
}}
(null,"
用户名或密码错误"
"
登录失败"
;
}}}}}publicstaticvoidmain(String[]args){
());
catch(Exceptione){}
CJframe=newCJ();
newmainFrame();
stuMainFramestu=newstuMainFrame();
慕坊數据舉作査询帮助BP
1J李世老師<盪妊?
欢迎登录学生成赣管理聚统*
诵走
2.添加学生基本信息
import
*■
publicclassaddFormextendsJFrameimplementsActionListener
{JLabel
labell=newJLabel("
添加基本信息"
;
JLabel
labxuehao=newJLabel("
学号:
labyear=newJLabel("
年龄:
labName=newJLabel("
姓名:
”,;
labDate=newJLabel("
岀生日期:
”,;
labclass=newJLabel("
班级:
,;
labzy=newJLabel("
专业:
labmz=newJLabel("
民族:
“,;
labsex=newJLabel("
性别:
”,;
JTextField
txtName=newJTextField(20);
txtDate=newJTextField(18);
txtXueHao=newJTextField(20);
txtYear=newJTextField(20);
txtClass=newJTextField(20);
txtZY=newJTextField(20);
txtMZ=newJTextField(20);
ButtonGroupbgp=newButtonGroup();
JRadioButtonman=newJRadioButton("
男"
JRadioButtonwomenFnewJRadioButton("
女"
JButton
btnAdd=newJButton("
添加”);
btnCancel=newJButton("
返回”);
btnReset=newJButton("
重置"
JPanel
jpl=newJPanel();
etVisible(true);
if()==btnAdd)
)){
{if().toString().equals(
请输入学号"
温馨提示
}elseif
().toString().equals(
(null
请输入姓名"
温馨提示"
请输入年龄"
出生日期"
请输入专业"
请输入民族"
请输入班级"
Stringsex;
if())
{sex="
男"
else
try
{("
catch(ClassNotFoundExceptionce)
{(null,());
Connectioncon=("
Statementstmt=();
inta=("
insertinto
学籍信息表(学号,登录密码,姓名,年龄,出生日
期,性别,班级,专业,民
+()+
IIIIII
+()+"
)"
族)values('
'
+00000+"
+sex+"
if(a==1)
{(null,"
已成功添加"
温馨提示"
else{(null,"
添加失败"
();
catch(SQLExceptionse){(null,());
else{("
publicstaticvoidmain(String[]args)
{addFormamg=newaddForm();
3.添加学生成绩
publicclassaddScoreextendsJFrameimplementsActionListener
{staticaddScoress;
JLabel[]label={newJL