• jsp公务员考试系统myeclipse开发Mysql数据库web结构java编程计算机网页项目


    一、源码特点
      JSP 公务员考试系统 是一套完善的web设计系统,对理解JSP java编程开发语言有帮助,系统采用serlvet+dao+bean 模式开发,系统具有完整的源代码和数据库,系统主要采用B/S模式开
    发。开发环境为TOMCAT7.0,Myeclipse8.5开发,数据库为Mysql,使用java语言开发

    jsp公务员考试系统myeclipse开发Mysql数据库w

    二、功能介绍
    系统主要的角色 包括 用户和管理员
    后台主要功能:
    (1)用户管理:对用户信息进行添加、删除、修改和查看
    (2)章节管理:对章节信息进行添加、删除、修改和查看
    (3)试题管理:对试题信息进行添加、删除、修改和查看、导入
    (4)试卷管理:对试卷信息进行添加、删除、修改和查看
    (5)组卷管理:对组卷信息进行添加、删除、修改和查看
    (6)成绩管理:对成绩信息进行查看
    (7)留言管理:对出库信息进行添加、删除、修改和查看
    (8)用户登录、个人信息修改
    前台主要功能:
    (1)系统首页查看未过期的试卷
    (2)用户注册、登录
    (3)试卷学习,练习,随机练习
    (4)留言
    (5)我的成绩
    (6)章节练习情况
    (7)错题库
    (8)错题练习
    (9)错题练习情况
    (10)个人信息

    成绩处理方法类

    1. package com.servlet;
    2. import java.io.IOException;
    3. import java.io.PrintWriter;
    4. import javax.servlet.ServletException;
    5. import javax.servlet.http.HttpServlet;
    6. import javax.servlet.http.HttpServletRequest;
    7. import javax.servlet.http.HttpServletResponse;
    8. import javax.servlet.http.HttpSession;
    9. import com.bean.chengji;
    10. import com.dao.chengjiDao;
    11. import java.util.List;
    12. import java.sql.ResultSet;
    13. public class chengjiServlet extends HttpServlet {
    14. public void service(HttpServletRequest request, HttpServletResponse response)
    15. throws ServletException, IOException {
    16. request.setCharacterEncoding("gb2312");
    17. System.out.println("method"+request.getParameter("method"));
    18. String method=(String)request.getParameter("method");
    19. if(method.equals("insert")){//成绩添加
    20. insertM(request, response);
    21. }else if(method.equals("list")){//成绩列表
    22. ListM(request, response);
    23. }else if(method.equals("delete")){//成绩删除
    24. deleteM(request, response);
    25. }else if(method.equals("modifyindex")){//成绩修改页面
    26. modifyIndex(request, response);
    27. }
    28. else if(method.equals("modify")){//成绩修改
    29. modifyM(request, response);
    30. }else if(method.equals("detail")){//成绩详细信息
    31. detailM(request, response);
    32. }else if(method.equals("Plist")){//成绩列表信息
    33. PListM(request, response);
    34. }
    35. }
    36. private void insertM(HttpServletRequest request, HttpServletResponse response){//成绩添加
    37. chengjiDao dao=new chengjiDao();
    38. chengji chengji=new chengji();
    39. chengji.setCjid((String)request.getParameter("keyid"));
    40. chengji.setSj((String)request.getParameter("sj"));
    41. chengji.setKssj((String)request.getParameter("kssj"));
    42. chengji.setCj((String)request.getParameter("cj"));
    43. chengji.setYh((String)request.getParameter("yh"));
    44. response.setCharacterEncoding("gb2312");
    45. try {
    46. dao.insert(chengji);
    47. request.setAttribute("flag", "操作成功");
    48. request.getRequestDispatcher("chengji/chengjiadd.jsp").forward(request, response);
    49. } catch (Exception e) {
    50. e.printStackTrace();
    51. }
    52. }
    53. private void ListM(HttpServletRequest request, HttpServletResponse response){//成绩信息列表
    54. ResultSet rs=null;
    55. chengjiDao dao = new chengjiDao();
    56. System.out.println("alist");
    57. String sql="";
    58. response.setCharacterEncoding("gb2312");
    59. try{
    60. rs=dao.qlist(sql);
    61. PrintWriter out = response.getWriter();
    62. request.setAttribute("rs", rs);
    63. request.getRequestDispatcher("chengji/chengjilist.jsp").forward(request, response);
    64. }catch(Exception e){
    65. e.toString();
    66. e.printStackTrace();
    67. }
    68. }
    69. private void PListM(HttpServletRequest request, HttpServletResponse response){//测试信息列表
    70. ResultSet rs=null;
    71. chengjiDao dao = new chengjiDao();
    72. String str=(String)request.getParameter("Page");
    73. String sql="";
    74. response.setCharacterEncoding("gb2312");
    75. try{
    76. if(str==null){
    77. str="0";
    78. }
    79. rs=dao.qlist(sql);
    80. PrintWriter out = response.getWriter();
    81. request.setAttribute("rs", rs);
    82. request.getRequestDispatcher("chengji/chengjiPlist.jsp?Page=1").forward(request, response);
    83. }catch(Exception e){
    84. e.toString();
    85. e.printStackTrace();
    86. }
    87. }
    88. private void modifyIndex(HttpServletRequest request, HttpServletResponse response){//成绩修改首页
    89. ResultSet rs=null;
    90. response.setCharacterEncoding("gb2312");
    91. chengjiDao dao = new chengjiDao();
    92. String keyid=(String)request.getParameter("keyid");
    93. String sql="";
    94. if(keyid!=null&&!keyid.equals("")){
    95. sql+=" and cjid='"+keyid+"'";
    96. }
    97. try{
    98. rs=dao.qlist(sql);
    99. PrintWriter out = response.getWriter();
    100. request.setAttribute("rs", rs);
    101. request.getRequestDispatcher("chengji/chengjimodify.jsp").forward(request, response);
    102. //response.sendRedirect("chengji/chengjimodify.jsp");
    103. }catch(Exception e){
    104. e.toString();
    105. e.printStackTrace();
    106. }
    107. }
    108. private void detailM(HttpServletRequest request, HttpServletResponse response){//成绩详细信息页面
    109. ResultSet rs=null;
    110. response.setCharacterEncoding("gb2312");
    111. chengjiDao dao = new chengjiDao();
    112. String keyid=(String)request.getParameter("keyid");
    113. String sql="";
    114. if(keyid!=null&&!keyid.equals("")){
    115. sql+=" and cjid='"+keyid+"'";
    116. }
    117. try{
    118. rs=dao.qlist(sql);
    119. request.setAttribute("rs", rs);
    120. request.getRequestDispatcher("chengji/chengjidetail.jsp").forward(request, response);
    121. }catch(Exception e){
    122. e.toString();
    123. e.printStackTrace();
    124. }
    125. }
    126. private void deleteM(HttpServletRequest request, HttpServletResponse response){//成绩删除
    127. ResultSet lst=null;
    128. chengjiDao dao = new chengjiDao();
    129. response.setCharacterEncoding("gb2312");
    130. String keyid=(String)request.getParameter("keyid");
    131. try{
    132. dao.delete(keyid);
    133. request.setAttribute("flag", "删除成功");
    134. request.getRequestDispatcher("chengjiServlet?method=list").forward(request, response);
    135. //response.sendRedirect("chengjiServlet?method=list");
    136. }catch(Exception e){
    137. e.toString();
    138. e.printStackTrace();
    139. }
    140. }
    141. private void modifyM(HttpServletRequest request, HttpServletResponse response){//成绩修改功能
    142. chengjiDao dao=new chengjiDao();
    143. chengji chengji=new chengji();
    144. chengji.setCjid((String)request.getParameter("keyid"));
    145. chengji.setSj((String)request.getParameter("sj"));
    146. chengji.setKssj((String)request.getParameter("kssj"));
    147. chengji.setCj((String)request.getParameter("cj"));
    148. chengji.setYh((String)request.getParameter("yh"));
    149. response.setCharacterEncoding("gb2312");
    150. try {
    151. dao.modify(chengji);
    152. PrintWriter out = response.getWriter();
    153. request.setAttribute("flag", "操作成功");
    154. request.getRequestDispatcher("chengjiServlet?method=list").forward(request, response);
    155. //response.sendRedirect("chengjiServlet?method=list");
    156. } catch (Exception e) {
    157. e.printStackTrace();
    158. }
    159. }
    160. }


    三、注意事项
    1、管理员账号:admin 密码:admin 数据库配置文件DBO.java ,权限包括管理员 和用户
    2、开发环境为TOMCAT7.0,Myeclipse8.5开发,数据库为Mysql,使用java语言开发。
    3、数据库文件名是jspgwyzxks 系统名称gwyzxks
    4、地址:http://127.0.0.1:8080/gwyzxks/shouye.jsp

    系统实现

     

     

     

     

     

     

     

  • 相关阅读:
    计算机网络第4章-网络层(1)
    这或许是全网最全时间序列特征工程构造的文章了
    Java项目:物资发放管理系统(java+Springboot+HTML+layui+Mysql)
    C++设计模式之Strategy策略模式
    SQL语句中 LEFT JOIN 后 ON 和 WHERE 的区别
    Fast Unsupervised Projection for Large-Scale Data
    【Matlab代码】基于遗传算法和蚂蚁优化算法的路径优化问题
    解决vue ui无法远程访问的问题
    技术债务(Technical Debt)
    品牌线上打假,应防微杜渐
  • 原文地址:https://blog.csdn.net/qq_41221322/article/details/127644888