java学生信息管理系统实验报告内容摘要:

, 30)。 (150, 200, 200, 30)。 (100, 300, 100, 60)。 (200, 300, 100, 60)。 (new ActionListener() { public void actionPerformed(ActionEvent event) { String name=()。 String password=()。 try { .. ()。 } catch(ClassNotFoundException e) { ( + e)。 } try { Connection con。 Statement sql。 ResultSet rs。 con=(jdbc:odbc:pan,)。 sql=()。 rs=(SELECT sname,sphone FROM student where sname=39。 +name+39。 AND sphone=39。 +password+39。 )。 if(()) { JOptionPane a=new JOptionPane()。 (null,登 陆成功.. ,消息对话框 ,)。 ()。 } else { ()。 ()。 JOptionPane a=new JOptionPane()。 (null,您的账户名 或 密 码 有 误 , 消 息 对 话 框 ,)。 } ()。 } catch(SQLException e) { (e)。 } } })。 .. (new ActionListener() { public void actionPerformed(ActionEvent event) { ()。 } })。 } } 普通学生登陆与权限 .. class ShowStu .. { void ShowStu() { JFrame frame1=new JFrame(学生信息窗口 )。 (300,300,500,400)。 (2)。 JTable table。 Object a[][]=null。 Object name[]={学号 ,姓名 ,年龄 ,性别 ,籍贯,电话 }。 Connection con。 Statement st。 ResultSet rs。 try { ()。 } catch(ClassNotFoundException e) { .. ( + e)。 } try { con=(jdbc:odbc:pan,)。 st=(VE,)。 rs=(SELECT * FROM student)。 ()。 int lastnumber=()。 a=new Object[lastnumber][6]。 int i=0。 ()。 while(()) { a[i][0]=(1)。 a[i][1]=(2)。 a[i][2]=(3)。 .. a[i][3]=(4)。 a[i][4]=(5)。 a[i][5]=(6)。 i++。 } ()。 } catch(SQLException e) { (e)。 } table=new JTable(a,name)。 (new BorderLayout())。 (new JScrollPane(table),)。 (true)。 ()。 } } .. class AlterStu { void AlterStu() { JFrame deleteframe=new JFrame(更改学生信息 )。 (null)。 JLabel label=new JLabel( 需 要 修 改 的 学 生 学 号,)。 (true)。 (350,350,450,350)。 JButton btn=new JButton(确定 )。 (label)。 .. ()。 final JTextField text=new JTextField(10)。 (100,60)。 (text)。 (btn)。 (150, 50, 150, 20)。 (150, 100, 100, 20)。 (150, 150, 100, 20)。 (new ActionListener() { public void actionPerformed(ActionEvent event) { String sno=()。 Connection con。 Statement st。 ResultSet rs。 try { ()。 } .. catch(ClassNotFoundException e) { (e)。 } try { con=(jdbc:odbc:pan,)。 st=()。 rs=(SELECT * FROM student WHERE sno=+39。 +sno+39。 )。 if(rs==null) { JOptionPane b=new JOptionPane()。 (null,该学生不存在 ,消息对话框 ,)。 } else { ()。 final String no1=(1)。 .. final String name1=(2)。 final String age1=(3)。 final String sex1=(4)。 final String address1=(5)。 final String phone1=(6)。 JFrame addframe=new JFrame(修改学生信息)。 (2)。 (400,200,450,600)。 (true)。 (true)。 ()。 (new BorderLayout())。 Box basebox,box1,box2,box3,box4。 basebox=()。 box1=()。 box2=()。 box3=()。 box4=()。 JLabel no=new JLabel(学号 )。 JLabel name=new JLabel(姓名 )。 .. JLabel age=new JLabel(年龄 )。 ((90))。 (no)。 ((90))。 (name)。 ((90))。 (age)。 JLabel sex=new JLabel(性别 )。 JLabel address =new JLabel(籍贯 )。 JLabel phone=new JLabel(电话 )。 ((90))。 (sex)。 ((90))。 (address)。 ((90))。 (phone)。 final JTextField notext=new JTextField(15)。 final JTextField nametext=new JTextField(15)。 final JTextField agetext=new JTextField(15)。 .. final JTextField sextext=new JTextField(15)。 final JTextField addresstext=new JTextField(15)。 final JTextField phoext=new JTextField(15)。 ((90))。 (notext)。 ((90))。 (nametext)。 ((90))。 (agetext)。 ((90))。 (sextext)。 ((90))。 (addresstext)。 ((90))。 (phoext)。 (box1)。 (box2)。 (box3)。 (box4)。 .. JLabel title=new JLabel(所要修改学生的基本信息 ,)。 JButton addbtn=new JButton(修改 )。 (title,)。 (basebox,)。 (addbtn,)。 (no1)。 (name1)。 (age1)。 (sex1)。 (address1)。 (phone1)。 (new ActionListener() { public void actionPerformed(ActionEvent event) { Connection con。 .. Statement st。 ResultSet rs。 String no2=()。 String name2=()。 String age2=()。 String sex2=()。 String address2=()。 String phone2=()。 try { ()。 } catch(ClassNotFoundException e) { (e)。 } try { .. con=(jdbc:odbc:pan,)。 st=()。 int ok=(UPDATE student SET sno=39。 +no2+39。 ,sname=39。 +name2+39。 ,ssex=39。 +sex2+39。 ,sage=39。 +age2+39。 ,saddress=39。 +address2+39。 ,sphone=39。 +phone2+39。 WHERE sno=39。 +no1+39。 )。 if(ok==1) { JOptionPane。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。