四月十一日
今天写了一点团队项目的内容
package Dao; public class dao { public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPeople() { return people; } public void setPeople(String people) { this.people = people; } public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public String getTimu() { return timu; } public void setTimu(String timu) { this.timu = timu; } public String getJiaoshipingjia() { return jiaoshipingjia; } public void setJiaoshipingjia(String jiaoshipingjia) { this.jiaoshipingjia = jiaoshipingjia; } public String getXiaozupingfen() { return xiaozupingfen; } public void setXiaozupingfen(String xiaozupingfen) { this.xiaozupingfen = xiaozupingfen; } public String getMingci() { return mingci; } public void setMingci(String mingci) { this.mingci = mingci; } String name; String people; String number; String timu; String jiaoshipingjia; String xiaozupingfen; String mingci; }

package Dbutil; import java.sql.*; public class db { //eshop为数据库名称,db_user为数据库用户名db_password为数据库密码 public static String db_url = "jdbc:mysql://localhost:3306/ceshi?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT"; public static String db_user = "root"; public static String db_password = "NN06280055"; public static Connection getConn() { Connection conn = null; try { Class.forName("com.mysql.cj.jdbc.Driver"); conn = DriverManager.getConnection(db_url, db_user, db_password); System.out.println("连接成功"); } catch (Exception e) { System.out.println("连接失败"); e.printStackTrace(); } return conn; } public static void close(Statement state, Connection conn) { if(state!=null) { try { state.close(); } catch (SQLException e) { e.printStackTrace(); } } if(conn!=null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } } public static void close(ResultSet rs, Statement state, Connection conn) { if(rs!=null) { try { rs.close(); } catch (SQLException e) { e.printStackTrace(); } } if(state!=null) { try { state.close(); } catch (SQLException e) { e.printStackTrace(); } } if(conn!=null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } } public static void main(String[] args) { return; } }

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>在此处插入标题</title>
</head>
<body>
<form action="add1.jsp" method="get">
<table align="center" border="1" width="500">
<div id="dateTime"></div>
<tr>
<td>队名</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td>参赛人员</td>
<td><input type="text" name="people" /></td>
</tr>
<tr>
<td>参赛人数</td>
<td><input type="text" name="number" /></td>
</tr>
<tr>
<td>选题</td>
<td><input type="text" name="xuanti" /></td>
</tr>
<tr>
<td>教师评价</td>
<td><input type="text" name="jiaoshipingjia" /></td>
</tr>
<tr>
<td>小组评分</td>
<td><input type="text" name="xiaozupingfen" /></td>
</tr>
<tr>
<td>名次</td>
<td><input type="text" name="mingci" /></td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" value="提交" /></td>
</tr>
<input type="button" value="继续添加" onclick="location.href='add.jsp'" /></br>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@ page import="Dao.dao"%> <%@ page import="Dao.hanshu"%> <%@ page import="Dbutil.db"%> <html> <head> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>在此处插入标题</title> </head> <body> <% String name = request.getParameter("name"); String people = request.getParameter("people"); String number = request.getParameter("number"); String xuanti = request.getParameter("xuanti"); String jiaoshipingjia = request.getParameter("jiaoshipingjia"); String xiaozupingfen = request.getParameter("xiaozupingfen"); String mingci = request.getParameter("mingci"); hanshu.creat(name, people, number, xuanti, jiaoshipingjia, xiaozupingfen, mingci); %> <input type="button" value="返回继续添加" onclick="location.href='add.jsp'" /></br> </body> </html>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>在此处插入标题</title>
</head>
<body>
<form action="update1.jsp" method="get">
<table align="center" border="1" width="500">
<tr>
<td>队名</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td>参赛人员</td>
<td><input type="text" name="people" /></td>
</tr>
<tr>
<td>参赛人数</td>
<td><input type="text" name="number" /></td>
</tr>
<tr>
<td>选题</td>
<td><input type="text" name="xuanti" /></td>
</tr>
<tr>
<td>教师评价</td>
<td><input type="text" name="jiaoshipingjia" /></td>
</tr>
<tr>
<td>小组评分</td>
<td><input type="text" name="xiaozupingfen" /></td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" value="提交" /></td>
</tr>
</body>
</html>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@page import="Dao.dao" %> <%@page import="Dao.hanshu" %> <html> <head> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>在此处插入标题</title> </head> <body> <% String name = request.getParameter("name"); String people = request.getParameter("people"); String number = request.getParameter("number"); String xuanti = request.getParameter("xuanti"); String jiaoshipingjia = request.getParameter("jiaoshipingjia"); String xiaozupingfen = request.getParameter("xiaozupingfen"); hanshu.update(name,people,number,xuanti,jiaoshipingjia,xiaozupingfen,name); %> <input type="button" value="返回" onclick="location.href='welcome.jsp'" /></br> </body> </html>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· DeepSeek在M芯片Mac上本地化部署