📄 b025d754ea1c00171005f7af098808c8
字号:
<%@ page import="java.sql.*"%>
<%@ page import="com.xxgl.data.DBconnection"%>
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>Insert title here</title>
<link href="../style.css" rel="stylesheet">
<link href="css/formclass.css" type="text/css" rel="stylesheet">
<style type="text/css">
<!--
body {
background-color: #DEE7FF;
}
-->
</style></head>
<body>
<%
int count=0;
//以try开始
try
{
//建一个数据库连接
Connection con = DBconnection.getConnection();
Statement stmt;
ResultSet rs;
String sname =request.getParameter("sname");
sname=new String (sname.getBytes("ISO-8859-1"),"GBK");
//创建一个JDBC声明
stmt = con.createStatement();
//增加新记录
String tempStr="'"+sname+"','"+sex+"','"+age+"','"+in_year+"','"+jg+"','"+zzmm+"','"+adress+"','"+phone+"','"+memory+"'";
String sql="INSERT INTO newstudent (s_name,sex,age,in_year,jg,zzmm,adress,phone,memory) VALUES ("+tempStr+")";
rs=stmt.executeUpdate(sql);
%>
<%
while (rs.next())
{
int col1 = rs.getInt(1);
String col2 = rs.getString(2);
}%>
//关闭数据库连结
rs.close();
stmt.close();
con.close();
}
//捕获错误信息
catch (Exception e) {out.println(e.getMessage());}
%>
<script language="javascript">
if(<%=count%>==1)
alert("添加成功!");
else
alert("添加失败");
window.location.href("addnewstudent.html");
</script>
<table width="469" border="0" align="center" cellPadding="0" cellSpacing="0" borderColor="#dee7ff" bgColor="#dee7ff" ID="Table1">
<tbody>
<tr>
<td width="469" height="35" colSpan="3" bordercolor="#ffffff" bgcolor="#dee7ff">
<table style="FONT-SIZE: 10pt" borderColor="#ffffff" cellSpacing="0" cellPadding="0" bgColor="#dee7ff" border="0" ID="Table2">
<tbody>
<tr height="35">
<td width="18" height="16" align="middle" background="images/title_left.gif" bgColor="#dee7ff"><img src="images/file1.gif" width="12" height="16"></td>
<td align="left" width="104" background="images/title_left.gif" bgColor="#dee7ff"><font color="#f7f7f7">异动处理</font></td>
<td align="middle" width="10" background="images/title_middle.gif" bgColor="#dee7ff"><font color="#f7f7f7"> </font> </td>
<td width="630" align="middle" background="images/title_right.gif" bgColor="#dee7ff"><font color="#f7f7f7"> </font> </td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td align="middle" vAlign="center" bordercolor="#6982D3" bgColor="#dee7ff" class="formclass_showTd"><div align="center"><br>
处理学生异动</div>
<form method="POST" id="form1" name="form1" action="yd.jsp">
<table width="410" border="0" cellspacing="0" bordercolor="#83A1E8">
<tr>
<td width="222" height="29"> 学号:<% =s_id;%> </td>
<td width="184">姓名:</td>
</tr>
<tr>
<td> 入学年份: </td>
<td>异动日期:
<input name="ydrq" type="text" id="ydrq" size="12"></td>
</tr>
<tr>
<td>异动类别:
<select name="select">
<option value="xiuxue" selected>休学</option>
<option value="zhuanxue">转学</option>
<option value="tuixue">退学</option>
<option value="kaichu">开除</option>
</select></td>
<td>异动原因:
<input name="ydyy" type="text" id="ydyy" size="12"></td>
</tr>
<tr width="121">
<td>异动去向:
<input name="textfield" type="text" size="15"></td>
</tr>
<tr>
<td><div align="right">
<input type="submit" name="Submit" value="提交">
</div></td>
<td><input type="reset" name="Submit" value="重置"></td>
</tr>
</table>
</form>
<table border="1" bordercolor="#DEE7FF">
<table width="466" >
<tr>
<td bordercolor="#6C87D6" bgcolor="#6683D3"></td>
</tr>
</table></table>
<tr>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -