WebRoot/LookUpdateStudent.jsp

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<%@ page language="java" import="java.util.*,java.sql.*,com.db.*" pageEncoding="UTF-8"%>
<%
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>My JSP 'LookUpdateStudent.jsp' starting page</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="styles.css">
	-->

  </head>
  
  <body bgcolor="CCCFFF">
  		<%
  		request.setCharacterEncoding("UTF-8");
  			String sid=request.getParameter("studentNumber");
  			Connection conn=null;
  			PreparedStatement ps=null;
  			ResultSet rs=null;
  			try{
  				conn=DBConnection.getConn();
  				ps=conn.prepareStatement("select * from Student where studentNumber=?");
  				ps.setString(1, sid);
  				rs=ps.executeQuery();
  				ArrayList arr=new ArrayList();
  				while(rs.next()){
  					Student st=new Student();
  					st.setStudentNumber(rs.getString("studentNumber"));
  					st.setStudentName(rs.getString("studentName"));
  					st.setStudentSex(rs.getString("studentSex"));
  					st.setStudentAge(rs.getInt("studentAge"));
  					st.setStudentWeight(rs.getInt("studentWeight"));
  					arr.add(st);
  					session.setAttribute("arr", arr);
  				}
  				
  			}catch(Exception e){
  				e.printStackTrace();
  			}finally{
  				DBConnection.close(rs, ps, conn);
  			}
  			
  			
  		 %>
  		 
  		 <%
  		 	ArrayList arr=(ArrayList)session.getAttribute("arr");
  		 	for(int i=0;i<arr.size();i++){
后面还有 41 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。