您的位置:首页 > 健康 > 养生 > 深圳定制建站网站建设_新品发布会流程策划方案_长沙网红打卡景点排行榜_百度 营销推广是做什么的

深圳定制建站网站建设_新品发布会流程策划方案_长沙网红打卡景点排行榜_百度 营销推广是做什么的

2024/12/23 22:11:34 来源:https://blog.csdn.net/m0_73739654/article/details/144027586  浏览:    关键词:深圳定制建站网站建设_新品发布会流程策划方案_长沙网红打卡景点排行榜_百度 营销推广是做什么的
深圳定制建站网站建设_新品发布会流程策划方案_长沙网红打卡景点排行榜_百度 营销推广是做什么的

第一章:系统功能分析

1.1、系统简介与开发背景

学生信息管理系统是在信息化时代,特别是在教育领域中产生的。随着学校规模的不断扩大和信息化技术的不断发展,传统的纸质档案管理方式已经无法满足学校对学生信息管理的需求,因此需要开发一种电子化的管理系统来提高学生信息管理的效率和准确性。

该系统的出现还有以下几个方面的原因:

教育体制改革的推进:随着教育体制改革的不断深入,学校需要更加高效、准确地管理学生信息,以便更好地服务于学生和教师。

信息化技术的发展:信息技术的发展为开发学生信息管理系统提供了技术保障。例如,数据库技术可以用于存储和检索学生信息,网络技术可以用于实现远程访问和管理,人工智能技术可以用于提高学生信息管理的智能化水平。

学校管理的需求:学校管理需要一个能够快速、准确地处理大量学生信息的系统,以便更好地为学生和教师提供服务,同时也可以提高学校的管理效率和办学水平。

总之,学生信息管理系统的出现是教育体制改革和信息化技术发展的必然结果,它的出现为学校管理带来了很大的便利,同时也提高了学校对学生信息管理的效率和准确性。

1.2、功能分析

学生管理模块:

(1)增删改查学生信息,当学生还有学习的学员时,不能删除学生信息;

(2)按学生查询选择课程信息,支持名称模糊查询;

学员管理模块:

(1)增删改查学员信息;

(2)按学员名查询学员信息,支持学员名模糊查询和分页显示;

总体来说,学生管理系统通过对学生和学员信息的管理,实现了对学生的全面监管与管理。同时,该系统还具有高效智能的数据管理和分析功能,可以提高管理效率,同时也为各方提供了更加精准的信息支持。

1.3、功能模块图及简要说明

  管理员新增学生信息时填写对应的信息,如姓名、课程号等。后台代码将在页面创建的信息提交到控制层进行数据验证,如果信息填写符合规则且数据唯一,则该数据将存储到本地数据库中,否则添加失败。管理员进行登录时首先点击跳转到管理员登录界面按钮,输入相应的信息点击登录。登录界面流程图如图4-1所示,添加学生功能流程图如图4-2所示。

 

图4-1 登录界面流程图

                                

4-2 添加学生功能流程图

管理员修改学生职位信息时可以从快速搜索区,输入学生名称进行查询。按要求填写信息后保存,第一条数据为新添加的数据;管理员修改部门信息时,依次填写好对应的信息,后台代码将信息提交到控制层进行数据验证,验证通过则修改成功,数据存储到本地数据库里,否则失败。职位修改功能流程图如图4-3所示,添加部门功能流程图如图4-4所示。

        ​​​​​​​        ​​​​​​​        ​​​​​​​

   4-3 学生信息修改流程图

        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        

4-4 添加学生功能流程图

学生信息管理系统的主要模块包括增加、删除、修改和查询等操作,以下是这些操作的简单描述:

增加模块:该模块允许管理员将新的学生信息添加到系统中。这通常涉及到填写一个包含各种字段(例如姓名、性别、出生日期、学号、班级等)的表单。系统将检查输入的数据是否有效,例如,学号是否唯一,然后将其添加到数据库中。

删除模块:在此模块中,管理员可以选择并删除系统中的学生信息。例如,当一个学生转学或退学时,管理员可能需要从系统中删除他们的记录。

修改模块:此模块允许管理员更新系统中已有的学生信息。例如,如果学生的家庭地址发生变化,管理员可以通过此模块更新学生的家庭地址信息。在修改数据时,管理员需要确保数据的完整性和准确性。

查询模块:此模块允许管理员和学生查询系统中的学生信息。管理员可以查看学生的全部信息,而学生通常只能查看与他们自己相关的信息,例如他们的成绩、等。

第二章:概要设计

2.1、数据库设计

2.1.1  创建表单

CREATE TABLE `admin` (

  `Aid` int(11) NOT NULL,

  `Aname` varchar(30) NOT NULL,

  `Apwd` varchar(10) NOT NULL,

  PRIMARY KEY (`Aid`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;  PRIMARY KEY (`id`) USING BTREE

) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = CREATE TABLE `course` (

  `Cnum` int(11) NOT NULL AUTO_INCREMENT,

  `Cno` int(11) NOT NULL,

  `Cname` varchar(20) NOT NULL,

  `Ctime` int(11) NOT NULL,

  `Ccredit` int(11) NOT NULL,

  PRIMARY KEY (`Cnum`,`Cno`),

  KEY `Cname` (`Cname`),

  KEY `Cno` (`Cno`)

CREATE TABLE `score` (

  `Sno` int(11) NOT NULL,

  `Sname` varchar(20) NOT NULL,

  `Cno` int(11) NOT NULL,

  `Cname` varchar(20) DEFAULT NULL,

  `Sscore` decimal(10,0) DEFAULT '0',

  `Rescore` decimal(10,0) DEFAULT '0',

  PRIMARY KEY (`Sno`,`Cno`),

  KEY `Cname` (`Cname`),

  KEY `Cno` (`Cno`),

  KEY `Sname` (`Sname`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

-- Table structure for user_train_re   //学生,用户联系表

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

CREATE TABLE `student` (

  `Sno` int(11) NOT NULL,

  `Sname` varchar(30) NOT NULL,

  `Sgender` char(2) NOT NULL,

  `Sage` int(11) NOT NULL,

  `Sbirthday` datetime DEFAULT '1999-01-01 00:00:00' ON UPDATE CURRENT_TIMESTAMP,

  `Sclass` varchar(10) NOT NULL,

  `Smajor` varchar(20) NOT NULL,

  `Sdept` varchar(20) NOT NULL,

  `Spwd` varchar(10) NOT NULL DEFAULT '123',

  PRIMARY KEY (`Sno`),

  KEY `Sname` (`Sname`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

2.2、后台管理界面设计

2.1  管理员登陆界面图

2.2  管理员功能界面

2.3  学生信息管理界面图

2.4  课程信息管理界面图

2.5  课程添加管理界面图

2.6  学生成绩管理界面图

2.8  添加学生信息管理界面图

2.9  添加学生成绩管理界面图

2.10  删除成绩管理界面图

2.11  课程管理页面图

第三章:详细设计

3.1.2数据库配置文件

package com.system.utils;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

public class DB {

        // 数据库地址

        private String Driver_name = "jdbc:mysql://localhost:3306/student_a?serverTimezone=Asia/Shanghai&useSSL=false";

        // 数据库用户名

        private String USER = "root"; // 这里需要修改为自己的用户名和密码

        // 数据库密码

        private String PASS = "123456";

        // 数据库连接

        public static Connection con;

        // 构造方法

        public DB() {

                 try {

                         // 加载驱动

                         Class.forName("com.mysql.cj.jdbc.Driver"); // 这个驱动是mysql8版本的

                         // 获取连接

                        con = DriverManager.getConnection(Driver_name, USER, PASS);

                 } catch (Exception e) {

                         e.printStackTrace();

                 }

        }

        // 获取连接

        public static Connection getConnection() {

                 if (con == null) {

                         new DB();

                 }

                 return con;

        }

        // 释放连接

        public static void close(ResultSet resultSet, Statement statement, Connection connection) {

                 if (resultSet != null) {

                         try {

                                  resultSet.close();

                         } catch (SQLException e) {

                                  e.printStackTrace();

                         }

                 }

                 if (statement != null) {

                         try {

                                  statement.close();

                         } catch (SQLException e) {

                                  e.printStackTrace();

                         }

                 }

                 if (connection != null) {

                         try {

                                  connection.close();

                         } catch (SQLException e) {

                                  e.printStackTrace();

                         }

                 }

        }

        // 释放连接

        public static void close(Statement statement, Connection connection) {

                 if (statement != null) {

                         try {

                                  statement.close();

                         } catch (SQLException e) {

                                  e.printStackTrace();

                         }

                 }

                 if (connection != null) {

                         try {

                                  connection.close();

                         } catch (SQLException e) {

                                  e.printStackTrace();

                         }

                 }

        }

        // 释放连接

        public static void close(Connection connection) {

                 if (connection != null) {

                         try {

                                  connection.close();

                         } catch (SQLException e) {

                                  e.printStackTrace();

                         }

                 }

        }

}

StudentDao:

package com.system.dao;

import java.sql.Connection;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

import java.util.ArrayList;

import java.util.List;

import com.system.entity.Student;

import com.system.utils.DB;

public class StudentDao {

       Connection conn = null;

       DB dataBase = new DB();

       //学生登录

       public boolean LoginCheck(String Sno, String Spwd) throws SQLException {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     ResultSet rs = null;

                     stat = conn.createStatement();

                     String sql = "SELECT * FROM student WHERE Sno ='"+Sno+"' and Spwd = '"+Spwd+"'";

                     rs = stat.executeQuery(sql);

                     if (rs.next()){

                            return true;

                     }else{

                            return false;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return false;

       }

      

       //注册

       public boolean Register(String Sno ,String Spwd) throws SQLException {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     ResultSet rs = null;

                     stat = conn.createStatement();

                     String sql = "SELECT * FROM student WHERE Sno ='" + Sno + "' ";

                     rs = stat.executeQuery(sql);

                     if (rs.next()){

                            return false;

                     }else{

                            sql = "INSERT INTO student VALUES ('" + Sno + "', '" + Spwd + "')";

                            stat.executeUpdate(sql);

                     }           

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return true;

       }

      

       //返回学生信息对象

       public List<Student> res() throws Exception {

              List<Student> students = new ArrayList<>();

              Student student;

              conn = dataBase.getConnection();

              Statement stat = null;

              ResultSet rs = null;

              stat = conn.createStatement();

              String sql = "SELECT * FROM student";

              rs = stat.executeQuery(sql);

              while (true) {

            if ( rs.next() ) {

                            student = new Student();

                student.setSno( rs.getInt("Sno") );

                student.setName( rs.getString("Sname") );

                student.setGender( rs.getString("Sgender") );

                student.setAge( rs.getInt("Sage") );

                student.setClas( rs.getString("Sclass") );

                student.setMajor(rs.getString("Smajor"));

                student.setDept( rs.getString("Sdept") );

                students.add(student);

            }else

                break;

        }

              conn.close();

              return students;

       }

      

}

3.1.3 StudentAdd

public void actionPerformed(ActionEvent e) {

String sno = snoField.getText();

String sname = snameField.getText();

String sage = sageField.getText();

String sclass = sclassField.getText();

String smajor = smajorField.getText();

String sdept = sdeptField.getText();

String sex = (String) comboBox.getSelectedItem();

if (sno.equals("") || sname.equals("") || sage.equals("") || sclass.equals("") || smajor.equals("")

|| sdept.equals("") || sex.equals("")) {

JOptionPane.showMessageDialog(null, "信息不完整,请填写完整!");

} else {

UserDao userDao = new UserDao();

try {

boolean istrue = userDao.insert(sno, sname, sex, sage, sclass, smajor, sdept);

if (istrue) {

JOptionPane.showMessageDialog(null, "学生信息录入成功!");

} else{

JOptionPane.showMessageDialog(null, "学生录入失败,此学号已存在!");

}

} catch (SQLException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

}

}

});

btnNewButton.setFont(new Font("微软雅黑", Font.BOLD, 14));

btnNewButton.setBounds(201, 427, 93, 30);

panel.add(btnNewButton);

JButton btnNewButton_1 = new JButton("重置");

btnNewButton_1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

snoField.setText("");

snameField.setText("");

sageField.setText("");

sclassField.setText("");

smajorField.setText("");

sdeptField.setText("");

}

});

btnNewButton_1.setFont(new Font("微软雅黑", Font.BOLD, 14));

btnNewButton_1.setBounds(390, 427, 93, 30);

panel.add(btnNewButton_1);

String[] a = new String[] { "男", "女" };

comboBox = new JComboBox(a);

comboBox.setBounds(267, 381, 194, 27);

panel.add(comboBox);

}

}

CourseDao:

package com.system.dao;

import java.sql.Connection;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

import java.util.ArrayList;

import java.util.List;

import com.system.entity.Course;

import com.system.utils.DB;

public class CourseDao {

       Connection conn = null;

       DB dataBase = new DB();

      

       // 按照课程号进行查询

       public Course selectByCno(int cno) throws SQLException {

              conn = dataBase.getConnection();

              Statement stat = null;

              ResultSet rs = null;

              String sql = "SELECT * FROM course where Cno = " + cno;

              stat = conn.createStatement();

              rs = stat.executeQuery(sql);

              Course course = new Course();

              while (true) {

                     if (rs.next()) {

                            course.setCnum(rs.getString("Cnum"));

                            course.setCno(rs.getString("Cno"));

                            course.setCname(rs.getString("Cname"));

                            course.setCcredit(rs.getString("Ccredit"));

                            course.setCtime(rs.getString("Ctime"));

                     } else

                            break;

              }

              conn.close();

              return course;

       }

       //课程信息

       public List<Course> courseRes() throws Exception {

              List<Course> courses = new ArrayList<>();

              Course course;

              conn = dataBase.getConnection();

              Statement stat = null;

              ResultSet rs = null;

              stat = conn.createStatement();

              String sql = "SELECT * FROM course";

              rs = stat.executeQuery(sql);

              while (true) {

            if ( rs.next() ) {

                            course = new Course();

                course.setCnum( rs.getString("Cnum") );

                course.setCno( rs.getString("Cno") );

                course.setCname( rs.getString("Cname") );

                course.setCcredit( rs.getString("Ccredit") );

                course.setCtime( rs.getString("Ctime") );

                courses.add(course);

            }else

                break;

        }

              conn.close();

              return courses;

       }

      

       //增加课程

       public boolean insert(String cno, String cname, String ccredit, String ctime) throws SQLException {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     String sql = "SELECT * FROM course WHERE cno = '"+cno+"'";

                     if ( stat.executeQuery(sql).next() ) {

                            return false;

                     }

                     sql = "INSERT INTO course (cno,cname,ccredit,ctime)"

                             + " VALUES ( '"+cno+"','"+cname+"', '"+ccredit+"' ,'"+ctime+"')";

                     if ( stat.executeUpdate(sql)==1 ){

                            return true;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return false;

       }

      

       //ɾ删除课程

       public boolean delete(String cno) throws SQLException  {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     String sql = "DELETE FROM course WHERE cno = '"+cno+"' ";        

                     if ( stat.executeUpdate(sql)==1 ){

                            return true;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return false;

       }

      

       //查询课程

       public Course select(String cno) throws SQLException  {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     ResultSet rs = null;

                     Course course = null;

                     String sql = "SELECT * FROM course WHERE cno = '"+cno+"' ";        

                     rs = stat.executeQuery(sql);

                     if ( rs.next() ){                  

                            course = new Course();

                            course.setCno( rs.getString("Cno") );

                            course.setCname( rs.getString("Cname") );

                            course.setCcredit( rs.getString("Ccredit") );

                            course.setCtime( rs.getString("Ctime") );

                            return course;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return null;

       }

      

       //更新课程

       public boolean update(String cno, String cname, String ccredit, String ctime) throws SQLException  {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     String sql = "UPDATE course SET Cno = '"+cno+"', Cname = '"+cname+"', Ccredit = '"+ccredit+"', Ctime = '"+ctime+"' "

                                   + "WHERE Cno = '"+cno+"' ";            

                     if ( stat.executeUpdate(sql)==1 ){

                            return true;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return false;

       }

      

      

}

UserDAO

package com.system.dao;

import java.sql.Connection;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

import java.util.ArrayList;

import java.util.List;

import com.system.entity.Student;

import com.system.utils.DB;

public class UserDao {

       Connection conn = null;

       DB dataBase = new DB();

       //管理员登录

       public boolean LoginCheck(String id, String pwd) throws SQLException {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     ResultSet rs = null;

                     stat = conn.createStatement();

                     String sql = "SELECT * FROM admin WHERE Aid ='" + id + "' and Apwd = '" + pwd + "'";

                     rs = stat.executeQuery(sql);

                     if (rs.next()){

                            return true;

                     }else{

                            return false;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return false;

       }

      

       //管理员注册

       public boolean Register(String id, String name ,String pwd) throws SQLException {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     ResultSet rs = null;

                     stat = conn.createStatement();

                     String sql = "SELECT * FROM admin WHERE Aid ='" + id + "' and Apwd = '" + pwd + "'";

                     rs = stat.executeQuery(sql);

                     if (rs.next()){

                            return false;

                     }else{

                            sql = "INSERT INTO admin VALUES ('" + id + "','" + name + "','" + pwd + "')";

                            stat.executeUpdate(sql);

                     }           

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return true;

       }

      

       //返回学生信息对象列表

       public List<Student> res() throws Exception {

              List<Student> students = new ArrayList<>();

              Student student;

              conn = dataBase.getConnection();

              Statement stat = null;

              ResultSet rs = null;

              stat = conn.createStatement();

              String sql = "SELECT * FROM student";

              rs = stat.executeQuery(sql);

              while (true) {

            if ( rs.next() ) {

                            student = new Student();

                student.setSno( rs.getInt("Sno") );

                student.setName( rs.getString("Sname") );

                student.setGender( rs.getString("Sgender") );

                student.setAge( rs.getInt("Sage") );

                student.setClas( rs.getString("Sclass") );

                student.setMajor(rs.getString("Smajor"));

                student.setDept( rs.getString("Sdept") );

                students.add(student);

            }else

                break;

        }

              conn.close();

              return students;

       }

      

       //返回指定学生的信息

       public List<Student> Select(String sno, String name) throws Exception {

              List<Student> students = new ArrayList<>();

              Student student;

              conn = dataBase.getConnection();

              Statement stat = null;

              ResultSet rs = null;

              stat = conn.createStatement();

              String sql = "SELECT * FROM student WHERE Sno ='"+sno+"' OR Sname = '"+name+"'";

              rs = stat.executeQuery(sql);

              while (true) {

            if ( rs.next() ) {

                            student = new Student();

                student.setSno( rs.getInt("Sno") );

                student.setName( rs.getString("Sname") );

                student.setGender( rs.getString("Sgender") );

                student.setAge( rs.getInt("Sage") );

                student.setClas( rs.getString("Sclass") );

                student.setMajor(rs.getString("Smajor"));

                student.setDept( rs.getString("Sdept") );

                students.add(student);

            }else

                break;

        }

              conn.close();

              return students;

       }

      

       //录入学生信息

       public boolean insert(String sno, String name, String gender, String age, String clas , String major, String dept) throws SQLException {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     String sql = "INSERT INTO student (sno,sname,sgender,sage,sclass,smajor,sdept)"

                                   + " VALUES ( '"+sno+"','"+name+"', '"+gender+"' ,'"+age+"' ,'"+clas+"' ,'"+major+"' ,'"+dept+"')";

                     if (stat.executeUpdate(sql) == 1) {

                            return true;

                     }

              } catch (Exception e) {

              }

              conn.close();

              return false;

       }

      

       //删除学生信息

       public boolean delete(String sno) throws SQLException  {

              int key = Integer.parseInt(sno);

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     String sql = "DELETE FROM student WHERE sno = " + key;

                     System.out.println(sql);

                     if ( stat.executeUpdate(sql)==1 ){

                            return true;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return false;

       }

      

       //根据学号查询单个学生

       public Student select(String sno) throws SQLException {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     ResultSet rs = null;

                     Student stu = null;

                     String sql = "SELECT * FROM student WHERE sno = '"+sno+"' ";         

                     rs = stat.executeQuery(sql);

                     if ( rs.next() ){                  

                            stu = new Student();

                            stu.setSno( rs.getInt("Sno") );

                            stu.setName( rs.getString("Sname") );

                            stu.setGender( rs.getString("Sgender") );

                            stu.setAge( rs.getInt("Sage") );

                            stu.setClas( rs.getString("Sclass") );

                            stu.setMajor(rs.getString("Smajor"));

                            stu.setDept( rs.getString("Sdept") );

                            return stu;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return null;

       }

      

       //更新学生信息

       public boolean update(String sno, String name, String gender, String age, String clas , String major, String dept) throws SQLException  {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     String sql = "UPDATE student SET sno = '"+sno+"', sname = '"+name+"', sgender = '"+gender+"', sage = '"+age+"',"

                                   + "sclass = '"+clas+"', smajor = '"+major+"', sdept = '"+dept+"' WHERE sno = '"+sno+"' ";          

                     if ( stat.executeUpdate(sql)==1 ){

                            return true;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return false;

       }

      

}

3.1.4  SCOREdao

package com.system.dao;

import java.sql.Connection;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

import java.util.ArrayList;

import java.util.List;

import com.system.entity.Score;

import com.system.utils.DB;

public class ScoreDao {

       Connection conn = null;

       DB dataBase = new DB();

      

       //成绩信息

       public List<Score> scoreRes(String key) throws Exception {

              List<Score> scores = new ArrayList<>();

              int k = 0;

              if (!key.equals("")) {

                     k = Integer.parseInt(key);

              }

              Score score;

              conn = dataBase.getConnection();

              Statement stat = null;

              ResultSet rs = null;

              stat = conn.createStatement();

              String sql = "SELECT * FROM score";

              if (!key.equals("")) {

                     sql = sql + " where Sno = " + k;

              }

              rs = stat.executeQuery(sql);

              while (true) {

            if ( rs.next() ) {

                            score = new Score();

                score.setSno( rs.getString("Sno") );

                score.setSname( rs.getString("Sname") );

                score.setCno( rs.getString("Cno") );

                score.setCname( rs.getString("Cname") );

                score.setSscore( rs.getString("Sscore") );

                score.setRescore( rs.getString("Rescore") );

                scores.add(score);

            }else

                break;

        }

              conn.close();

              return scores;

       }

      

       //某个学生的所有成绩

       public List<Score> scoreOwnRes(String id) throws Exception {

              List<Score> scores = new ArrayList<>();

              Score score;

              conn = dataBase.getConnection();

              Statement stat = null;

              ResultSet rs = null;

              stat = conn.createStatement();

             String sql = "SELECT * FROM score WHERE sno = '"+id+"'";

              rs = stat.executeQuery(sql);

              while (true) {

            if ( rs.next() ) {

                            score = new Score();

                score.setSno( rs.getString("Sno") );

                score.setSname( rs.getString("Sname") );

                score.setCno( rs.getString("Cno") );

                score.setCname( rs.getString("Cname") );

                score.setSscore( rs.getString("Sscore") );

                score.setRescore( rs.getString("Rescore") );

                scores.add(score);

            }else

                break;

        }

              conn.close();

              return scores;

       }

      

       //录入成绩

       public boolean insert(String sno, String cno, String sscore) throws SQLException {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     String sql = "SELECT Sname FROM student WHERE sno = '"+sno+"' ";

                     String sql_2 = "SELECT cname FROM course WHERE cno = '"+cno+"' ";            

                     ResultSet rs = null;

                     ResultSet rs_2 = null;

                     String sname =null;

                     String cname = null;

                     rs = stat.executeQuery(sql);

                     if(rs.next())

                            sname = rs.getString("Sname");

                     rs_2 = stat.executeQuery(sql_2);

                     if ( rs_2.next() )

                            cname = rs_2.getString("Cname");

                     else {

                            return false;

                     }

                     String sql_3 = "INSERT INTO score (sno,sname,cno,cname,sscore) VALUES ( '"+sno+"', '"+sname+"','"+cno+"', '"+cname+"','"+sscore+"' )";

                     if ( stat.executeUpdate(sql_3)==1 ){

                            return true;

                     }

              } catch (Exception e) {

              }

              conn.close();

              return false;

       }

      

       //删除成绩

       public boolean delete(String sno, String cno) throws SQLException  {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     String sql = "DELETE FROM score WHERE sno = '"+sno+"' AND cno = '"+cno+"' ";        

                     if ( stat.executeUpdate(sql)==1 ){

                            return true;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return false;

       }

      

       //查询成绩

       public Score select(String sno, String cno) throws SQLException {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     ResultSet rs = null;

                     Score sc = null;

                     String sql = "SELECT * FROM score WHERE sno = '"+sno+"' AND cno = '"+cno+"'";         

                     rs = stat.executeQuery(sql);

                     if ( rs.next() ){                  

                            sc = new Score();

                            sc.setSno( rs.getString("Sno") );

                            sc.setSname( rs.getString("Sname") );

                            sc.setCno( rs.getString("Cno") );

                            sc.setCname( rs.getString("Cname") );

                            sc.setSscore( rs.getString("Sscore") );

                            sc.setRescore(rs.getString("Rescore"));

                            return sc;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return null;

       }

      

       //删除某门课程的成绩

       public boolean update(String sno, String cno, String sscore, String rescore) throws SQLException  {

              try {

                     conn = dataBase.getConnection();

                     Statement stat = null;

                     stat = conn.createStatement();

                     String sql = "UPDATE score SET Sscore = '"+sscore+"', Rescore = '"+rescore+"'  WHERE sno = '"+sno+"' AND cno ='"+cno+"' ";      

                     if ( stat.executeUpdate(sql)==1 ){

                            return true;

                     }

              } catch (Exception e) {

                     e.printStackTrace();

              }

              conn.close();

              return false;

       }

      

      

}

第四章:个人总结

学生管理系统是一个以信息技术为基础,对学生数据进行集中收集、处理和存储的综合性系统。它能够有效地提高学校管理学生的效率和精确性,同时能够更好地发掘学生数据中隐藏的信息,为学校的各项决策提供可靠的数据支持。

在设计和实现学生管理系统时,应以数据库为中心,利用各种编程语言和技术对系统进行开发。系统的基本架构应分为前端和后端两个部分,前端负责数据的录入、数据的展示以及简单的数据处理,而后端则负责数据的处理、存储和保护。

在实现系统时,应注重系统的可维护性和可扩展性。对于可维护性,要尽可能地减少代码的复杂性,增加注释,同时要进行有效的异常处理,以帮助维护人员快速定位问题并进行修复。对于可扩展性,要采用模块化的开发方式,将各个功能模块化,这样在需要增加新的功能时,只需要增加新的模块即可,不需要对整个系统进行重构。

同时,系统的安全性也是必须要考虑的一个问题。要采用各种安全措施,如数据加密、身份验证等,以保护学生数据的安全,防止数据泄露。

在实现学生管理系统之后,需要进行充分的测试,包括单元测试、集成测试和系统测试。只有经过严格的测试,才能够保证系统的稳定性和可靠性。

最后,系统的维护和更新也是必须要考虑的一个问题。要定期对系统进行检查和更新,以保证系统的正常运行。同时,也要考虑数据的备份和恢复,以防止数据丢失。

总之,学生管理系统是一个复杂的系统,需要综合考虑多方面的因素,包括功能、架构、数据库设计、界面设计、安全性、测试和维护等。只有对这些方面进行全面的考虑和实现,才能够开发出一套高效、可靠的学生管理系统ZT276899

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com