304ead18021d00171005f7af098808c8

来自「实习的时候做的数字校园系统」· 代码 · 共 73 行

TXT
73
字号
<!--首先导入一些必要的packages-->

<!--告诉编译器使用SQL包-->
<%@ page import="java.sql.*"%>

<%@ page import="com.xxgl.data.DBconnection"%>
<!--设置中文输出-->
<%@ page contentType="text/html; charset=GB2312" %> 

<html>
<head>
  <title>DbJsp.jsp</title>
</head>
<body>
<%
int count=0;
//以try开始
try
{ //以try开始

String s_id =request.getParameter("sid");
s_id=new String (s_id.getBytes("ISO-8859-1"),"GBK");
String yesorno =request.getParameter("yesorno");
yesorno=new String (yesorno.getBytes("ISO-8859-1"),"GBK");

String yesorno =request.getParameter("yesorno");
yesorno=new String (yesorno.getBytes("ISO-8859-1"),"GBK");

String yesorno =request.getParameter("yesorno");
yesorno=new String (yesorno.getBytes("ISO-8859-1"),"GBK");

String yesorno =request.getParameter("yesorno");
yesorno=new String (yesorno.getBytes("ISO-8859-1"),"GBK");

String yesorno =request.getParameter("yesorno");
yesorno=new String (yesorno.getBytes("ISO-8859-1"),"GBK");
String yesorno =request.getParameter("yesorno");
yesorno=new String (yesorno.getBytes("ISO-8859-1"),"GBK");
String yesorno =request.getParameter("yesorno");
yesorno=new String (yesorno.getBytes("ISO-8859-1"),"GBK");


 //建一个数据库连接
Connection con = DBconnection.getConnection();
Statement stmt;

stmt = con.createStatement();
//修改记录
String sql="update newstudent set yesorno='"+yesorno+"'  WHERE testid='"+test_id+"'";

 count=stmt.executeUpdate(sql);


//关闭数据库连结
stmt.close();
con.close();
}

//捕获错误信息
catch (Exception e) {out.println(e.getMessage());}

%>

<script language="javascript">
if (<%=count%> == 1)
alert("缴费信息修改成功!"); 
else
alert("缴费信息修改失败!");
window.location.href("selectstudent1.jsp");
</script>


</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?