• 大小: 3.67MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-17
  • 语言: 其他
  • 标签: jsp  MySQL  

资源简介

学生信息和教师信息管理、教学内容记录、教学计划管理、学生考勤记录、试题管理、自动生成试卷,自动生成要求按照规定的格式生成。其余内容要求适合于教师教学,实用性强,真正能为教师服务

资源截图

代码片段和文件信息

package controller;

import java.sql.SQLException;
import java.util.List;

import javax.swing.JOptionPane;

import model.Student;

import dao.JdbcUtils;
import dao.StudentDAO;

public class AdminstudentAction extends baseAction
{

    private StudentDAO studentdao = new StudentDAO();    //用户DAO
    private Student student;                      //图书
    
    public void setStudent( Student student )
    {
        this.student = student;
    }
    
    /**
     * 保存用户:更新、创建
     */
    public void save()
    {
        try{
            if( student.getId()==null )
            {
             studentdao.create(student);
                JOptionPane.showMessageDialog(null“用户添加成功!“);
            }
            else
            {
             studentdao.update(student);
             JOptionPane.showMessageDialog(null“信息已更新!“);
            }
            
            JdbcUtils.commitTransaction();              //提交事务
        }
        catch( SQLException e )
        {
            e.printStackTrace();
            JdbcUtils.rollbackTransaction();            //事务回滚

        }
        finally
        {
            JdbcUtils.closeCurrentConnection();         //关闭Connection
        }
    }
    public void updatepsw()
    {
        try
        {
            if( student.getId()!=null )
            {
             studentdao.updatepsw(student);
                request.setAttribute(“student“ student);
            }
            JOptionPane.showMessageDialog(null“密码修改成功!“);
            JdbcUtils.commitTransaction();              //提交事务
        }
        catch( SQLException e )
        {
            e.printStackTrace();
            JdbcUtils.rollbackTransaction();            //事务回滚
            JOptionPane.showMessageDialog(null“修改信息失败!“);
        }
        finally
        {
            JdbcUtils.closeCurrentConnection();         //关闭Connection
        }
    }
    
    /**
     * 编辑用户:进入更新页面
     */
    public void edit()
    {
        try
        {
            if( student.getId()!=null )
            {
             student = studentdao.findById(student.getId());
                request.setAttribute(“student“ student);
            }
            else
            {
                request.setAttribute(“student“ student);
            }
            
            JdbcUtils.commitTransaction();              //提交事务
        }
        catch( SQLException e )
        {
            e.printStackTrace();
            JdbcUtils.rollbackTransaction();            //事务回滚
            JOptionPane.showMessageDialog(null“编辑信息失败!“);
        }
        finally
        {
            JdbcUtils.closeCurrentConnection();         //关闭Connection
        }
    }
    
    /**
     * 删除用户
     */
    public void delete()
    {
        try{
            if( student.getId()!=null )
            {
             studentdao.delete(student.getId());
             JOptionPane.showMessageDialog(nul

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-05-29 21:16  teacher\
     文件        1557  2012-06-24 21:44  teacher\.classpath
     文件        6148  2013-05-29 21:16  teacher\.DS_Store
     目录           0  2013-05-29 21:21  __MACOSX\
     目录           0  2013-05-29 21:21  __MACOSX\teacher\
     文件          82  2013-05-29 21:16  __MACOSX\teacher\._.DS_Store
     目录           0  2012-06-24 21:31  teacher\.myeclipse\
     文件         294  2012-06-24 21:44  teacher\.mymetadata
     文件        1225  2012-06-24 18:36  teacher\.project
     目录           0  2012-06-24 21:33  teacher\.settings\
     文件          89  2012-06-24 18:36  teacher\.settings\org.eclipse.core.resources.prefs
     目录           0  2012-06-24 21:33  teacher\src\
     目录           0  2012-06-24 21:33  teacher\src\controller\
     文件        4927  2012-06-24 18:36  teacher\src\controller\AdminstudentAction.java
     文件        4228  2012-06-24 18:36  teacher\src\controller\AdminuserAction.java
     文件        3938  2012-06-24 18:36  teacher\src\controller\AttendanceAction.java
     文件        1549  2012-06-24 18:36  teacher\src\controller\baseAction.java
     文件        3839  2012-06-24 18:36  teacher\src\controller\ContentAction.java
     文件        3882  2012-06-24 18:36  teacher\src\controller\CourseAction.java
     文件         920  2012-06-24 18:36  teacher\src\controller\PaperAction.java
     文件        3868  2012-06-24 18:36  teacher\src\controller\QuestionAction.java
     文件        2443  2012-06-24 18:36  teacher\src\controller\StudentAction.java
     文件        3134  2012-06-24 18:36  teacher\src\controller\TeacherAction.java
     文件        3919  2012-06-24 18:36  teacher\src\controller\TeachPlanAction.java
     目录           0  2012-06-24 21:33  teacher\src\dao\
     文件        2897  2012-06-24 18:36  teacher\src\dao\AdminDAO.java
     文件        5993  2012-06-24 18:36  teacher\src\dao\AttendanceDAO.java
     文件         677  2012-06-24 18:36  teacher\src\dao\baseDAO.java
     文件        6532  2012-06-24 18:36  teacher\src\dao\ContentDAO.java
     文件        4074  2012-06-24 18:36  teacher\src\dao\CourseDAO.java
     文件        4929  2012-06-24 18:36  teacher\src\dao\JdbcUtils.java
............此处省略155个文件信息

评论

共有 条评论