• 大小: 236KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-18
  • 语言: Java
  • 标签: java  sqlserver  

资源简介

分为多个角色:管理员,学生和教师。每类用户可实现不同的功能,学生可以查询自己的成绩与所选的课程,进行选课。教师可以查询学生与课程信息,并录入成绩,管理员设计系统的权限,可修改学生和教师信息。

资源截图

代码片段和文件信息

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
public class admin extends Jframe{
    int WIDTH=768;
    int HEIGHT=522;
    private JTextField studentID;//查询学生信息
    private JTextField student_name;
    private JComboBox student_sex;
    private JTextField student_age;
    private JComboBox student_college;
    private JTextArea student_display;
    private JTextField s_number;
    
    private JTextField cstudentID;//修改学生信息
    private JTextField cstudent_name;
    private JComboBox cstudent_sex;
    private JTextField cstudent_age;
    private JComboBox cstudent_college;
    
    private JTextField teacherID;
    private JTextField teacher_name;
    private JComboBox teacher_sex;
    private JTextField teacher_age;
    private JComboBox teacher_college;
    private JTextField teacher_salary;
    private JTextArea teacher_display;
    private JTextField t_number;
    
    private JTextField cteacherID;
    private JTextField cteacher_name;
    private JComboBox cteacher_sex;
    private JTextField cteacher_age;
    private JComboBox cteacher_college;
    private JTextField cteacher_salary;

    private JTextField course_number;
    private JTextField course_name;
    private JTextField course_pre_number;
    private JTextField course_credit;
    private JTextArea course_display;
    private JTextField c_number;
    private JTextField course_teacher;
    
    
    private JTextField change_course_number;
    private JTextField change_course_name;
    private JTextField change_course_pre_number;
    private JTextField change_course_credit;
    //private JTextField change_course_teacher;
    private JTextField add_course_number;
    private JTextField add_course_teacher;
    
    String driverName = “sun.jdbc.odbc.JdbcOdbcDriver“; // 加载JDBC驱动
String dbURL = “jdbc:odbc:stu“; // 连接服务器和数据库sample
String userName = “sa“; // 默认用户名
String userPwd = “weier“; // 密码
java.sql.Connection connection;
static java.sql.Statement s;
ResultSet result=null;
admin(){
super();

try {
Class.forName(driverName);
connection = DriverManager.getConnection(dbURL userName userPwd);
System.out.println(“Connection Successful!“); // 如果连接成功
s = connection.createStatement();
} catch (Exception e) {
e.printStackTrace();
}
JTabbedPane operatePane=new JTabbedPane(JTabbedPane.LEFT);


JPanel studentPane=new JPanel();//管理学生信息
operatePane.add(“管理学生信息“studentPane);

JPanel stu=new JPanel();
studentPane.add(stu);
JTabbedPane studentChoice=new JTabbedPane(JTabbedPane.TOP);

JPanel studentSelect=new JPanel();
studentChoice.add(“查询信息“studentSelect);

JPanel messageInput=new JPanel();
messageInput.setLayout(new BoxLayout(messageInputBoxLayout.Y_AXIS));

      JLabel a=new JLabel(“输入查询条件                                                                                      “);
messageInput.add(a);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        383  2009-05-09 20:25  student\.project

     文件        226  2009-05-09 20:25  student\.classpath

     文件      13512  2009-07-12 10:10  student\log.java

     文件      14529  2008-05-02 20:34  student\picture\bear.jpg

     文件     768054  2009-05-21 11:50  student\picture\a.jpg

     文件      55355  2009-05-21 00:35  student\admin.java

     文件        288  2009-05-11 22:41  student\WindowDestroyer.java

     文件      16664  2009-05-21 00:25  student\student.java

     文件      23915  2009-05-21 00:48  student\teacher.java

     文件       1463  2009-05-20 20:48  student\welcome.java

     文件        570  2009-11-06 22:19  student\welcome$Listener.class

     文件       2360  2009-11-06 22:19  student\welcome.class

     文件       7673  2009-11-06 22:19  student\teacher$teacherListener.class

     文件      14232  2009-11-06 22:19  student\teacher.class

     文件      10926  2009-11-06 22:19  student\student.class

     文件       5948  2009-11-06 22:19  student\student$studentListener.class

     文件       7481  2009-11-06 22:19  student\log.class

     文件       6714  2009-11-06 22:19  student\log$regit.class

     文件      22392  2009-11-06 22:19  student\admin.class

     文件       9042  2009-11-06 22:19  student\admin$courseListener.class

     文件       7613  2009-11-06 22:19  student\admin$teacherListener.class

     文件       7035  2009-11-06 22:19  student\admin$studentListener.class

     文件        694  2009-11-06 22:19  student\WindowDestroyer.class

     目录          0  2009-05-09 20:31  student\picture

     目录          0  2009-05-09 20:25  student

----------- ---------  ---------- -----  ----

               997069                    25


评论

共有 条评论