资源描述:
《教室管理系统的源代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、1.创建数据库CreatedatebaseclassManager;createtableClassInfo(教室编号varchar(10)primarykey,教室设备varchar(100)notnull,教室容纳人数intnotnull,教室管理员编号varchar(10)notnull);createtableTeacherInfo(教师编号varchar(10)primarykey,教师姓名varchar(20)notnull,教授课程varchar(50),教师职称varchar(2
2、0)notnull);createtableClassRoomInfo(教室编号varchar(10),上课开始时间dateTimenotnull,结束时间dateTimenotnull,教师编号varchar(10),Foreignkey(教室编号)referencesClassInfo(教室编号),Foreignkey(教师编号)referencesTeacherInfo(教师编号));createtablemanager(usernamevarchar(10)notnull,userpsw
3、varchar(10)notnull);向其中插入数据。insertClassInfovalues('4101','投影仪','40','01')insertClassInfovalues('4102','电脑','50','02')insertTeacherInfovalues('0A','李萍','计算机系统分','讲师')insertTeacherInfovalues('0B','李明','C语言','教授')insertClassRoomInfovalues('4101','8:00',
4、'10:00','0A')insertClassRoomInfovalues('4102','10:00','12:00','0B')insertmanagervalues('jack','20120521')2.创建登录界面packagedev.chall.otherinterface;importjava.awt.Cursor;importjava.awt.FlowLayout;importjava.awt.Frame;importjava.awt.GridLayout;importjava
5、.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.awt.event.WindowEvent;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.PreparedStatement;importjava.sql.ResultSet;importjava.sql.SQLException;importjavax.swing
6、.JButton;importjavax.swing.JDialog;importjavax.swing.JLabel;importjavax.swing.JPanel;importjavax.swing.JPasswordField;importjavax.swing.JTextField;publicclassLoginextendsJDialogimplementsActionListener{privateJLabelname;privateJLabelpsw;privateJTextF
7、ieldnameV;privateJPasswordFieldpswV;privateJButtonlogin,quit;privateJPaneltop;privateJPanelcenter;privateJPanelbottom;privateJLabelprompt;publicstaticStringloginName;publicLogin(Frameowner,Stringtitle,booleanmodal){super(owner,title,modal);init();}pr
8、ivatevoidinit(){name=newJLabel("登录名:");nameV=newJTextField(10);top=newJPanel();top.add(name);top.add(nameV);this.add(top);psw=newJLabel("密码:");pswV=newJPasswordField(10);center=newJPanel();center.add(psw);center.add(pswV);this.add(center);login=newJB