资源描述:
《学生信息管理系统+SQL数据库.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、本人亲自做的,不需要做任何修改即可顺利运行,sql表也与程序无缝连接,没有未识别部分。Sql表如下:CREATETABLESTU(学号varchar(14)PRIMARYKEY,姓名varchar(8)NOTNULL,密码varchar(8)NOTNULL,班级varchar(14)NOTNULL,性别varchar(2),学校varchar(14)NOTNULL);CREATETABLETCH(用户名varchar(8)NOTNULL,密码varchar(8)NOTNULL);CREATETABLE成绩表(学号varchar(14)PRIMARYKEY,计算机网络var
2、char(8)NOTNULL,汽车概论varchar(8)NOTNULL,初级日语varchar(8)NOTNULL,接口技术varchar(8)NOTNULL,ava程序设计varchar(8)NOTNULL,数据库varchar(8)NOTNULL,大学物理varchar(8)NOTNULL);源程序代码:importjava.awt.*;importjavax.swing.*;importjava.awt.event.*;importjava.sql.*;publicclasssystemsextendsJFrameimplementsActionListener{
3、staticsystemsss;JPanelpanel=newJPanel();JLabellabel1=newJLabel("输入姓名:");JTextFieldname=newJTextField();JLabellabel2=newJLabel("密码:");JPasswordFieldpwd=newJPasswordField();JButtonEnter=newJButton("登录");JButtonExit=newJButton("退出");Stringurl="D:\Systems\title.jpg";ButtonGroupbgp=newButton
4、Group();JRadioButtonstu=newJRadioButton("学生");JRadioButtontch=newJRadioButton("教师");publicsystems(){super("登录系统");this.setResizable(false);JLabelimg=newJLabel(newImageIcon(url));img.setBounds(0,0,500,100);panel.add(img);stu.setBounds(165,210,70,20);tch.setBounds(265,210,70,20);bgp.add(stu
5、);bgp.add(tch);panel.add(stu);panel.add(tch);Enter.setBounds(150,250,80,20);Exit.setBounds(270,250,80,20);Enter.addActionListener(this);Exit.addActionListener(this);panel.add(Enter);panel.add(Exit);panel.setLayout(null);this.add(panel);label1.setBounds(135,130,100,25);panel.add(label1);na
6、me.setBounds(265,130,100,25);panel.add(name);label2.setBounds(135,165,100,25);panel.add(label2);pwd.setBounds(265,165,100,25);panel.add(pwd);this.setBounds(100,100,500,350);this.setVisible(true);this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);}publicvoidactionPerformed(ActionEvente){i
7、f(e.getSource()==Enter){Stringusername,password;username=name.getText();password=pwd.getText();try{Class.forName("oracle.jdbc.driver.OracleDriver");}catch(ClassNotFoundExceptionce){JOptionPane.showMessageDialog(ss,ce.getMessage());}if(stu.isSelected()){try{Connectio