<%@ page contentType ="text/html ;charset = UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
<HTML>
<head>
<meta http-equil="Content-Type" content="text/html:charset=UTF-8">
<title>数据库</title>
</head>
<BODY bgcolor="pink">
<td>
<table border="1" bgcolor="yellow" align="center">
<tr>
<th width="80" align="center">学号</th>
<th width="80" align="center">姓名</th>
<th width="80" align="center">性别</th>
<th width="80" align="center">年龄</th>
<th width="80" align="center">出生地</th>
<th width="80" align="center">功能</th>
</tr>
</td>
<% try { Class.forName("com.mysql.jdbc.Driver");}
catch(ClassNotFoundException e) {
out.print(e);
}
Connection con;
Statement stmt;
ResultSet rs;
String uri=
"jdbc:mysql://localhost:3306/student?" +
"user=root&password=root&characterEncoding=utf-8";
con = DriverManager.getConnection(uri);
stmt = con.createStatement();
String sql="select *from student order by 学号";
rs=stmt.executeQuery(sql);
%><center>
<a href="tianjia.jsp"><h2>添加数据</h2></a></center>
<FORM action = "chaxunNumber.jsp" Method ="post">
<h3 align="center">输入学号查询数据:<Input type="text" name = "idcard" >
<Input type= submit name= "tijiao1" value= "提交">
</Form>
<FORM action = "chaxunName.jsp" Method ="post">
<h3 align="center">输入姓名查询数据:<Input type="text" name = "name" >
<Input type= submit name= "tijiao2" value= "提交">
</Form>
<%
while (rs.next()){
%>
<tr>
<td><%=rs.getString("学号")%></td>
<td><%=rs.getString("姓名")%></td>
<td><%=rs.getString("性别")%></td>
<td><%=rs.getString("年龄")%></td>
<td><%=rs.getString("出生地")%></td>
<td>
<a href="xiugai.jsp?id=<%out.print(rs.getString(1));%>">修改
<a href="shanchu.jsp?id=<%out.print(rs.getString(1));%>">删除</a>
</tr>
<%}
con.close();%>
</table></BODY></HTML>
没有合适的资源?快使用搜索试试~ 我知道了~
学生管理系统.zip
共8个文件
jsp:8个
需积分: 44 34 下载量 134 浏览量
2020-05-06
17:14:38
上传
评论 3
收藏 7KB ZIP 举报
温馨提示
实现最基本的增删改查(初学者)喜欢的可以下载。...........................
资源推荐
资源详情
资源评论
收起资源包目录
学生管理系统.zip (8个子文件)
tianjiayunxing.jsp 1KB
tianjia.jsp 1KB
shanchu.jsp 971B
chaxunNumber.jsp 2KB
xiugai.jsp 2KB
xiugaiyunxing.jsp 2KB
chaxunName.jsp 2KB
shujuku.jsp 2KB
共 8 条
- 1
资源评论
OrdnAry
- 粉丝: 61
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功