WebRoot/SelectStudent.jsp

(开头部分) 2KB

这里只显示每个文件的开头 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>查询学生信息</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">
    <center>
    <table border="2" bgcolor="CCCEEE" width="600">
      <tr bgcolor="CCCCCC" align="center">
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>体重</th>
      </tr>
      
      <%
        Connection conn=null;
        PreparedStatement ps=null;
        ResultSet rs=null;
        try{
            conn=DBConnection.getConn();
            ps=conn.prepareStatement("select * from Student");
            rs=ps.executeQuery();
             while(rs.next()){
               String studentNumber=rs.getString("studentNumber");
               String studentName=rs.getString("studentName");
               String studentSex=rs.getString("studentSex");
               int studentAge=rs.getInt("studentAge");
               int studentWeight=rs.getInt("studentWeight");
               
               out.print("<tr>");
               out.print("<td>"+studentNumber+"</td>");
               out.print("<td>"+studentName+"</td>");
               out.print("<td>"+studentSex+"</td>");
               out.print("<td>"+studentAge+"</td>");
               out.print("<td>"+studentWeight+"</td>");
               out.print("</tr>");
            }
          }catch(Exception e){
             e.printStackTrace();
后面还有 10 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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