按键三,2,按条件 输入数据后

Posted can丶

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了按键三,2,按条件 输入数据后相关的知识,希望对你有一定的参考价值。

<%@ page language="java" import="java.util.*" import="java.sql.*" 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 ‘update_stu_3.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>
<title>修改后重写记录页面</title>

<body>
<%
String driverName="com.mysql.jdbc.Driver";
String dbName="MyLogin";
String userName="root";
String userPwd="lovezjl";
String url1="jdbc:mysql://localhost:3306/MyLogin";
String url2="?user=root&password=lovezjl";
String url3="&useUnicode=true&characterEncoding=UTF-8";
String url=url1+url2+url3;
Class.forName(driverName);
Connection conn=DriverManager.getConnection(url);



String sushe3=request.getParameter("sushe");
String shuliang3=request.getParameter("shuliang2");
String jiedan3=request.getParameter("jiedan2");
String song3=request.getParameter("song2");
String sql="update student_xinxi1 set shuliang=?,jiedan=?,song=? where sushe=‘"+sushe3+"‘";
PreparedStatement pstmt=conn.prepareStatement(sql);
request.setCharacterEncoding("UTF-8");
pstmt.setString(1,shuliang3);
pstmt.setString(2,jiedan3);
pstmt.setString(3,song3);
int n=pstmt.executeUpdate();
if(n>=1){%>重写数据操作成功!<br><%}
else{ %>重写数据操作失败!<% %><br><%}
if(pstmt!=null){pstmt.close();}
if(conn!=null){conn.close();}
%>





</body>

</html>

以上是关于按键三,2,按条件 输入数据后的主要内容,如果未能解决你的问题,请参考以下文章

平板电脑死机了怎么办,按任何按键都不管用,关机也关不了了?

M4—按键识别

单片机独立按键与矩阵按键

按键四;按条件删除信息

按键三:按照条件修改信息

按键精灵怎么逐行自动读取文本中的文字,并自动输入某处