1. 程式人生 > >學生管理系統開發程式碼分析筆記:jsp+java bean+servlet技術

學生管理系統開發程式碼分析筆記:jsp+java bean+servlet技術

1 序言

學習java web的時候很渴望有一份完整的專案給我閱讀,而網上的大部分專案拿過來都無法直接用,好不容易找到了一個學生管理系統也是漏洞百出。在此,我將邊修改邊學習這份程式碼,並且加上完全的註釋,以便日後查閱。

2 專案說明

該專案為常見的學生管理系統,系統用例就不再說明。

《待補充》

3 程式碼分析

1 登入功能

1 首頁 index.jsp

<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
  </head>
  
  <body>
    <% response.sendRedirect("user/index.jsp"); %>
    <%--script跳轉有的瀏覽器不識別,比如火狐,應該使用response.sendRedict()方式更為正確,
        之後好多這種情況這種情況,不再一一說明 --%>
  </body>
</html>



2  user/index.jsp

<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>歡迎登陸</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="img/css.css">

  </head>
  <%--呼叫js進行前臺檢查,經常用到的這一段程式碼,複用率相當高 --%>
  <script language="JavaScript">
		function login11()
			{
				
				if (document.form1.name.value == "" ) 
				{
					alert("請輸入使用者名稱!");
					document.form1.name.focus();
					return false;
				}
				if (document.form1.pwd.value == ""  )  
				{
					alert("請輸入密碼!");
					document.form1.pwd.focus();
					return false;
				}
			}
</script>
  <STYLE>
.input7 {
	BORDER-BOTTOM-WIDTH: 0px; WIDTH: 120px; COLOR: #000000; HEIGHT: 20px; BORDER-RIGHT-WIDTH: 0px
}
</STYLE>
<%--本頁面為真正登陸頁面,因此會有兩種狀態,1.登陸成功跳轉到下一個頁面,2是登陸失敗重新登入,因此要接受登陸狀態引數"error" --%>
<%
String error = (String)request.getAttribute("error");
if(error != null && error.equals("1")){
%><script>alert('使用者名稱或密碼錯誤!')</script><%
}
 %>
  <body bgcolor="#94E6FF"><%--將表單提交到servlet/user/UserLoginServlet中 --%>
    <form action="servlet/user/UserLoginServlet" name="form1" method="post" onSubmit="return login11()">
    <div align="center">
    <p>inxi </p>
	<p> </p>
	<p> </p>
    <table border="0" width="612" background="img/backPic1.gif" height="264" style="border: 3px double #9B9B9B">
		<tr>
			<td colspan="2" align="center"><font face="華文隸書" size="5">研究生工程實踐管理系統<br></font><font face="華文隸書" size="3"></font></td>
		</tr>
		<tr>
			<td width="292" align="right">用 戶 名:</td>
			<td width="310"><input type="text" name="name" maxlength="16"  class="input7"/></td>
		</tr>
		<tr>
			<td width="292" align="right">登入密碼:</td>
			<td width="310"><input type="password" name="pwd" maxlength="16"  class="input7"/></td>
		</tr>
		<tr>
			<td width="292" align="right">請選擇登入身份:</td>
			<td width="310">
			<select name= "station">
			<option value="學生">研究生</option>
			<option value="指導老師">企業導師</option>
			</select>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center"><input type="submit" value="登陸">    <input type="Reset" value="重置"></td>
		</tr>
	</table>
    </div>
    </form>
   </body>
</html>

3 UserLonginBean

這個工程中的Bean總共四個,用到的時候陸續貼出來

package bean;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.*;
import util.*;

public class UserLoginBean {
    Connection conn = null;
    Statement st = null;
    ResultSet rs = null;
    ArrayList al = new ArrayList();//容器的方式來接受出巡出來的結果,每個物件是查詢結果的每一列,這裡都是String物件
    
    public int login(String name,String pwd,String station){//返回值int,代表查詢狀態,這裡也可以自定義異常處理,複用率更高
        int temp = 0;
        conn = DBConn.getConn();//util類bean 這裡就不貼了,只有get和close的功能
        try {
            st = conn.createStatement();
            if(station.equals("學生")){//若身份為學生,則查詢學生表,若是老師查詢老師表
                rs = st.executeQuery("select * from student where name='"+name+"'");
            }
            if(station.equals("指導老師")){//老師分為指導老師和其他老師,這裡只查詢指導老師,功能待擴充
                rs = st.executeQuery("select * from teacher where name='"+name+"' and station='"+station+"'");
            }
        
            if(rs.next()){//若查詢到有結果,則證明有該使用者
                String id = rs.getString("id");
                String tname = rs.getString("name");
                String tpwd = rs.getString("pwd");
                String truename = rs.getString("truename");
                String stations = rs.getString("station");
                if(pwd.equals(tpwd)){//取出密碼欄位匹配,匹配成功取出資訊,放入容器
                    temp = 1;//1狀態代表查詢成功
                    al.add(id);
                    al.add(tname);
                    al.add(tpwd);
                    al.add(stations);
                    al.add(truename);
                }else{
                    temp = 2;//2 代表密碼不匹配
                }
            }else{
                temp = 3;//3代表沒有該使用者名稱
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally{
            DBConn.close(conn,st,rs);//最後關閉開啟的物件,利用bean關閉
        }
        return temp;//返回登入狀態
    }
    
    public ArrayList getArrayLst(){
        return al;//返回登入查詢到的結果
    }

}



4  servlet/user/UserLoginServlet

package servlet.user;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import util.Validate;
import bean.UserLoginBean;

public class UserLoginServlet extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public UserLoginServlet() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}
//由於表單是post過來的,這裡要將post轉到get
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		Validate vd = new Validate();//字元轉換類,不再貼了
		String name = vd.getUnicode(request.getParameter("name"));
		String pwd = vd.getUnicode(request.getParameter("pwd"));
		String station = vd.getUnicode(request.getParameter("station"));
		UserLoginBean lb = new UserLoginBean();//建立UserLoginBean物件,所有的使用者操作都用得上,所以封裝為Bean
		int flag = lb.login(name,pwd,station);//將表單傳遞過來的引數登入
		ArrayList al = lb.getArrayLst();//獲取登入結果,若沒有登入成功則為null
		HttpSession session = request.getSession();
		session.setAttribute("login", al);//建立session,將login設為登入成功的返回容器
		String str = "";
		if(flag == 2 || flag == 3){//2 3都代表登入失敗
			str = "/user/index.jsp";
			request.setAttribute("error", "1");//設定error為登入失敗狀態
		}else{
			if(al.get(3).equals("學生"))//若是學生返回,轉發至/user/student_list_3.jsp,老師則/user/student_list_2.jsp
			    str = "/user/student_list_3.jsp";
			else str = "/user/student_list_2.jsp";
		}
		RequestDispatcher rd=request.getRequestDispatcher(str);
        rd.forward(request,response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request,response);
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occure
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}
至此,登陸功能已經完成,接下來是選課功能

2 選課功能

1 SelectBean

package bean;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import util.DBConn;

public class SelectBean {
	
	Connection conn = null;
	Statement st = null;
	ResultSet rs = null;
	
	public ArrayList select(String sql,String[] args){
		ArrayList al = new ArrayList();
		conn = DBConn.getConn();
		try {
			st = conn.createStatement();
			rs = st.executeQuery(sql);
			while(rs.next()){
				ArrayList alRow = new ArrayList();
				for(int i = 0;i < args.length;i++){
					alRow.add(rs.getString(args[i]));
				}
				al.add(alRow);//按語句查詢後,依次將查詢到的結果裝入容器
			}
		} catch (SQLException e) {
			// TODO 自動生成 catch 塊
			e.printStackTrace();
		} finally{
			DBConn.close(conn,st,rs);
		}
		return al;//返回查詢結果容器
	}

}

2 ListServlet

將需要列出來的結果都查詢出來先

package servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import util.Validate;

import bean.SelectBean;

public class ListServlet extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public ListServlet() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		SelectBean sb = new SelectBean();
		
		String sql1 = "select * from teacher where station='指導老師'";
		String[] args1 = {"id","name","pwd","truename","sex","age","phone","addr","station"};
		ArrayList al1 = sb.select(sql1, args1);
		request.setAttribute("tutor", al1);//將指導老師查詢結果裝入al1
		
		String sql2 = "select * from teacher where station='指導班主任'";
		String[] args2 = {"id","name","pwd","truename","sex","age","phone","addr","station"};
		ArrayList al2 = sb.select(sql2, args2);
		request.setAttribute("mostly", al2);//將班主任查詢結果裝入al2
		
		String sql3 = "select * from projectbase";
		String[] args3 = {"baseid","basename","contacts","baseaddress","basephone","baseemail","baseintroduction"};
		ArrayList al3 = sb.select(sql3, args3);
		request.setAttribute("captain", al3);//將專案資訊裝入al3
		
	
		
		String sql4 = "select * from school";
		String[] args4 = {"id","name","pwd","truename","addr","station"};
		ArrayList al4 = sb.select(sql4, args4);
		request.setAttribute("school", al4);//將學校資訊裝入al4
		
		String sql5 = "select * from student";
		String[] args5 = {"id","name","pwd","truename","sex","age","phone","addr","station"};
		ArrayList al5 = sb.select(sql5, args5);
		request.setAttribute("student", al5);//將學生資訊裝入al5
		
		String sql11 = "select * from project,projectbase where project.baseid = projectbase.baseid";
        String[] args11 = {"projectid","projectname","basename","projectinfo","state"};
        ArrayList al11 = sb.select(sql11, args11);
        request.setAttribute("project", al11);//關聯兩表,查詢學生申請的專案資訊,裝入al11
		
		String sql6 = "select * from course";
		String[] args6 = {"id","name","times","student"};
		ArrayList al6 = sb.select(sql6, args6);
		request.setAttribute("course", al6);//成績資訊裝入al6
		
		Validate vd = new Validate();
        String baseid = vd.getUnicode(request.getParameter("baseid"));
		String sql7 = "select * from project where baseid="+baseid;
		String[] args7 = {"projectid","projectname","baseid","projectinfo","state"};
		ArrayList al7 = sb.select(sql7, args7);
		request.setAttribute("studentleave", al7);//根據傳遞過來的引數,查詢學生申請情況,裝入al7
		

        String sql12 = "select * from resource where baseid="+baseid;
        String[] args12 = {"resourcename","resourcenumber","resourceinfor","resourcestate","baseid","teacherid","resourceid"};
        ArrayList al12 = sb.select(sql12, args12);
        request.setAttribute("resources", al12);//根據傳遞過來的引數,查詢與專案相關的指定專案的資源資訊,轉入al12
       
/*		
		HttpSession session = request.getSession();
		ArrayList adminlogin = (ArrayList)session.getAttribute("adminlogin");
		if(!adminlogin.get(3).equals(1))
	{
		ArrayList login = (ArrayList)session.getAttribute("login");
		String sql12 = "select project.projectid,projectname,projectinfo,teacherproject.state from teacherproject,project,teacher where project.projectid = teacherproject.projectid and teacherproject.id=teacher.id and teacherproject.id="+login.get(0);
        String[] args12 = {"projectid","projectname","projectinfo","state"};
        ArrayList al12 = sb.select(sql12, args12);
        request.setAttribute("teacherlookapply", al12);

//		HttpSession session = request.getSession();
        ArrayList login1 = (ArrayList)session.getAttribute("login");
        String sql13 = "select project.projectid,projectname,projectinfo,studentproject.state from studentproject,project,student where project.projectid = studentproject.projectid and studentproject.id=student.id and studentproject.id="+login1.get(0);
        String[] args13 = {"projectid","projectname","projectinfo","state"};
        ArrayList al13 = sb.select(sql13, args13);
        request.setAttribute("studentlookapply", al13);
	}
*/
		
		String sql8 = "select * from teacherleave";
		String[] args8 = {"id","teacherid","teacher","title","content","times"};
		ArrayList al8 = sb.select(sql8, args8);
		request.setAttribute("teacherleave", al8);//查詢老師留言,裝入al8
		
		String sql9 = "select * from grade";
		String[] args9 = {"id","studentd","coursety","gradentn"};
		ArrayList al9 = sb.select(sql9, args9);
		request.setAttribute("grade", al9);//查詢年級資訊裝入al9
		
		String sql10 = "select * from taste";
		String[] args10 = {"id","student","title","content","times"};
		ArrayList al10 = sb.select(sql10, args10);
		request.setAttribute("taste", al10);//查詢學生留言
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request,response);
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occure
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}

3 SessLoginServlet

檢查session,檢查是否登陸成功

package servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class SessLoginServlet extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public SessLoginServlet() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		PrintWriter pw = response.getWriter();
		if(request.getSession().getAttribute("login") == null || request.getSession().getAttribute("login").equals("")){
			pw.write("<script>alert('您還沒有登入!');window.navigate('../user/index.jsp');</script>");
		}
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request,response);
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occure
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}


3 user/top.jsp

頁面的擡頭分離寫出來,別的頁面時用include指令包含進來

<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>研究生工程實踐管理系統</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="img/css.css">
	

  </head>
  <jsp:include flush="true" page="/servlet/SessLoginServlet"></jsp:include>
  	
  <body>
	<div align="center">
	<table style="border-style: dotted; border-width: 1px">
	<tr><td width="800" height="100" style="font-family: 華文行楷; font-size: 70px; border-style: ridge; border-width: 1px; color:#332590; font-style:italic" bgcolor="#C0C0C0" align="center">
		研究生工程實踐管理系統</td></tr>
  <tr>
  <td align="center" valign="top">
  <table width="100%">
  <tr><td align="center" height="30" background="img/bg222.gif">
  <table>
  <tr>
<%-- 
  <td><a href="user/course_list.jsp">課程安排|</a></td>
  <td><a href="user/studentleave.jsp">學生留言|</a></td>
  <td><a href="user/teacherleave.jsp">老師留言|</a></td> 
  <td><a href="user/grade_list.jsp">學生成績釋出|</a></td>
--%> 

  <td><a href="user/student_list_2.jsp">工程實踐專案管理|</a></td>
  <%//檢查login是否登陸成功,顯示教學資源管理連結
  if(request.getSession().getAttribute("login") != null && !request.getSession().getAttribute("login").equals("")){
  	ArrayList al = (ArrayList)session.getAttribute("login");
	  if(al.get(3).equals("指導老師")){	  
	%><td><a href="user/teacher_resource.jsp">實踐教學資源管理|</a></td><%
  }}
   %>
<%--   <td><a href="">實踐教學資源管理|</a></td>--%>
  <td><a href="servlet/UserShowServlet">個人資訊管理|</a></td>
  <td><a href="user/modifypwd.jsp">修改密碼|</a></td>
 <%--  <td><a href="servlet/CopyOfUserShowServlet">個人資訊管理|</a></td>--%>
  <td><a href="servlet/RemoveServlet?login=1">登出退出</a></td> 
  </tr>
  </table>
  </td></tr>
  </table>
  </td>
  </tr>
  </table>
  	</div>
  </body>
</html>

4 StudentSelectServlet

package servlet.user;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.SelectBean;

import util.Validate;

public class StudentSelectServlet_1 extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public StudentSelectServlet_1() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		Validate vd = new Validate();
		String projectname = vd.getUnicode(request.getParameter("projectname_1"));
		SelectBean sb = new SelectBean();
		String sql = "select * from project,projectbase ";
		String[] args = {"projectid","projectname","basename","projectinfo","state"};
		sql += "where project.baseid = projectbase.baseid and projectname like '%"+projectname+"%'";
		ArrayList al = sb.select(sql, args);
		request.setAttribute("students", al);
		RequestDispatcher rd=request.getRequestDispatcher("/user/student_list_3.jsp");
		rd.forward(request,response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request,response);
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occure
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}


相關推薦

學生管理系統開發程式碼分析筆記jsp+java bean+servlet技術

1 序言 學習java web的時候很渴望有一份完整的專案給我閱讀,而網上的大部分專案拿過來都無法直接用,好不容易找到了一個學生管理系統也是漏洞百出。在此,我將邊修改邊學習這份程式碼,並且加上完全的註釋,以便日後查閱。 2 專案說明 該專案為常見的學生管理系統,系統用例就

React共享單車後臺管理系統開發(記錄筆記5)——5.1 From元件登入頁面

5.1 From元件登入頁面 具有資料收集、校驗和提交功能的表單,包含複選框、單選框、輸入框、下拉選擇框等元素。 文章目錄 5.1 From元件登入頁面 @[toc] 一.內聯表單(基礎表單) 二

React共享單車後臺管理系統開發(記錄筆記4)——4.7 Carousel輪播圖

4.7 Carousel輪播圖 Carousel走馬燈 文章目錄 4.7 Carousel輪播圖 @[toc] 一.文字背景輪播 二.圖片輪播 API Carou

React共享單車後臺管理系統開發(記錄筆記4)——4.6 gallery圖片畫廊

4.6 gallery圖片畫廊 實現類似照片牆的效果 文章目錄 4.6 gallery圖片畫廊 @[toc] map舉例 一.Tabs元件 二.例項一

React共享單車後臺管理系統開發(記錄筆記4)——4.5 Tabs標籤頁

4.5 Tabs標籤頁 選項卡切換元件。 文章目錄 4.5 Tabs標籤頁 一.Tabs元件 二.基本例項 三. Tab帶圖示頁籤 四. Tab可關閉卡片式頁籤 API[#](https://an

React共享單車後臺管理系統開發(記錄筆記2)——主頁面架構設計

本文基於React共享單車後臺管理系統的開發進行學習記錄,內含React生態系統的整體介紹及相關內容,最終成果物程式碼請參見最後一章。 一.基礎外掛安裝,Less檔案載入配置 安裝React-Router:yarn add react-router

CMS內容管理系統開發-需求分析

第一天:關於CMS內容管理系統-需求分析說明書        首先來介紹一下什麼是CMS內容管理系統(Content Management System)。網站內容管理系統具有許多基於模板的優秀設計,可以加快網站開發的速度和減少開發的成本。 網站內容管理系統的功能並不只限

後端管理系統開發(一)登入篇

作為後端程式設計師,想寫一個數據展示的系統,主要用於資料查詢、資料展示,當然也有登入功能了,有沒有比較快的方式呢,於此,Vue-A

Python小專案快速開發出一個簡單的學生管理系統

本文根據實際專案中的一部分api 設計抽象出來,例項化成一個簡單小例子,暫且叫作「學生管理系統」。     這個系統主要完成下面增刪改查的功能: 包括: 學校資訊的管理 教師資訊的管理 學生資訊的管理 根據Api請求的動作:

基於struts2框架開發學生管理系統

vpd peid esc png 頁面 介紹 pass 面數據 分享 學生管理系統采用struts2框架作為後臺開發框架,jsp實現頁面數據的展示,數據庫采用mysql。功能介紹:包含學生信息管理,班級信息管理,年級信息管理,系統信息管理等功能。數據庫模型設置如下:CREA

java學生管理系統

要求:1、新增學生    2、刪除指定學號的學生    3、修改指定學號的成績               4、查詢指定學號的資訊      &n

springMVC-spring-Hibernate 開發學生管理系統簡單案例-jsp檔案說明(五)

五、jsp檔案說明 原始檔:https://download.csdn.net/download/flyingshadower/10628472 (1)jsp檔案如圖: (2)addPage.jsp <%@ page contentType="text/html;char

springMVC-spring-Hibernate 開發學生管理系統簡單案例-配置檔案說明(三)

三、配置檔案說明 原始檔:https://download.csdn.net/download/flyingshadower/10628472 (1)在pom.xml寫入需要的各類依賴,自動下載依賴包。 <?xml version="1.0" encoding="UTF-8"?&g

springMVC-spring-Hibernate 開發學生管理系統簡單案例-java各檔案編寫(四)

四、java各檔案編寫 原始檔:https://download.csdn.net/download/flyingshadower/10628472 (1)工程目錄: (2)StudentEntity 利用Hibernate自動生成實體類 package com.student

實驗三用雙鏈表、靜態連結串列以及間接定址實現基本的學生管理系統

實驗目的:鞏固線性表的資料的儲存方法和相關操作,學會針對具體應用,使用線性表的相關知識來解決具體問題。 實驗內容:建立一個由n個學生成績的線性表,n的大小由自己確定,每個學生的成績資訊由自己確定,實現資料的對錶進行插入、刪除、查詢等操作。 (1)用雙鏈表實現 源程式: #incl

實驗三用單鏈表實現基本的學生管理系統

實驗目的:鞏固線性表的資料的儲存方法和相關操作,學會針對具體應用,使用線性表的相關知識來解決具體問題。 實驗內容:建立一個由n個學生成績的線性表,n的大小由自己確定,每個學生的成績資訊由自己確定,實現資料的對錶進行插入、刪除、查詢等操作。 源程式: # ifndef LinkLis

應用批量修改檔名,學生管理系統(檔案版)

<1>執行過程演示 執行程式之前 執行程式之後 <2>參考程式碼 #coding=utf-8 # 批量在檔名前加字首 import os funFlag = 1 # 1表示新增標誌 2表示刪除標誌 folderName = './renam

函式應用學生管理系統

import time import os #定一個列表,用來儲存所有的學生資訊(每個學生是一個字典) info_list = [] def print_menu(): print("---------------------------") print(" 學生管理系統 V1.0"

Django學習筆記010-學生管理系統(Django實現)

Django學習筆記-學生管理系統(Django實現)筆記中僅實現了對資料的全部查詢。 下面實現新增、刪除、修改,程式碼如下。 下面的程式碼沒有對輸入框內容進行限制,如果輸入不符合規則的內容,會出現錯誤。 本篇更新完畢後Django更新暫停一段,由於工作崗位是測試工程師,後面將重點關注測

Django學習筆記008-學生管理系統(Django實現)-查詢資料庫

資料庫配置: DATABASES = { 'default': { ##資料庫引擎 'ENGINE': 'django.db.backends.mysql', ##資料庫主機地址 'HOST': '127.0.0.1',