📄 modify2.jsp
字号:
<%@ page session="true"%>
<%@ page contentType="text/html;charset=gb2312" %>
<HTML>
<HEAD>
<TITLE>modify</TITLE>
</HEAD>
<BODY>
<%@ page language="java" import="java.sql.*,javax.sql.*;" %>
修改信息窗口
[<a href="modify.html" target=3>返回</a>]
<%
String sort=(String)session.getAttribute("sort");
String name=(String)session.getAttribute("user");
String production=(String)session.getAttribute("production");
//out.println("<hr>"+name+"<hr>");
if(!name.equals("over")){
String jdbcDriver="com.mysql.jdbc.Driver";
String jdbcURL="jdbc:mysql://localhost:3306/teacher";
try{
Class.forName(jdbcDriver);
Connection con=DriverManager.getConnection(jdbcURL,"root","000000");
Statement stmt=con.createStatement();
if (sort.equals("getAward")){
String author=(String)request.getParameter("author");
String production1=(String)request.getParameter("name");
String awardBand=(String)request.getParameter("band");
String time=request.getParameter("time");
String number=(String)request.getParameter("number");
stmt.executeUpdate("update getAward set author='"+author+"',production='"+production1+"',awardBand='"+awardBand+"',time='"+time+"',number='"+number+"' where production='"+production+"'");
%>
<hr>修改成功!<hr>
<%}%>
<%if (sort.equals("checkUp")){
String author=request.getParameter("author");
String production1=request.getParameter("name");
String checkBand=request.getParameter("checkBand");
String level=request.getParameter("level");
String checkTime=request.getParameter("time");
String rank=request.getParameter("number");
stmt.executeUpdate("update checkUp set author='"+author+"',production='"+production1+"',checkBand='"+checkBand+"',level='"+level+"',checkTime='"+checkTime+"',rank='"+rank+"' where production='"+production+"'");
%>
<hr>修改成功!<hr>
<%}%>
<%if (sort.equals("onStudy")){
String author=request.getParameter("author");
String production1=request.getParameter("name");
String itemBand=request.getParameter("band");
double itemMoney=Double.parseDouble(request.getParameter("money"));
String t0=(String)request.getParameter("t0");
String t1=(String)request.getParameter("t1");
//out.print(itemBand);
stmt.executeUpdate("update onStudy set author='"+author+"',production='"+production1+"',itemBand='"+itemBand+"',itemMoney="+itemMoney+", t0='"+t0+"', t1='"+t1+"' where production='"+production+"' and author='"+name+"'");
%>
<hr>
修改成功!
<hr>
<%}
stmt.close();
con.close();
System.out.println("修改成功!");
}catch(ClassNotFoundException e){
System.out.println("未找到要加载的驱动类");
}catch(SQLException e){
System.out.println("SQL错误提示:"+e);
}
}else{%>
<br>
<br>
<h1 align="center"><font color="00ff00" size=5>教师科研信息管理系统</font></h1>
<hr color="#ff8000">
<p>
<center>
请先[<a href="login.html" target=3>登录</a>]
</center>
</p>
<%}%>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -