📄 coursemod.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>课程信息管理</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
body {
background-image: url(image/bg_002.gif);
}
-->
</style></head>
<body>
<%
String loginNum=(String)session.getAttribute("lnum");
String name=(String)session.getAttribute("name");
session.setAttribute("lnum",loginNum);
session.setAttribute("name",name);
if(loginNum.equals("3"))
{
Connection conn=null;
Statement stmt=null;
Statement stmts=null;
String sql=null;
String coId=(String)request.getParameter("coId");
String d=(String)request.getParameter("depName");
byte[] tempname;
tempname=request.getParameter("coName").getBytes("ISO-8859-1");
String coName= new String(tempname);
String tId=(String)request.getParameter("tId");
float credit=Float.parseFloat(request.getParameter("credit"));
float period=Float.parseFloat(request.getParameter("period"));
byte[] temptime;
temptime=request.getParameter("cTime").getBytes("ISO-8859-1");
String cTime= new String(temptime);
String cPlace=(String)request.getParameter("cPlace");
int cNumAll=Integer.parseInt(request.getParameter("cNumAll"));
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:xk","sa","");
stmt=conn.createStatement();
sql="update course set coName='"+coName+"' where coId='"+coId+"'";
stmt.executeUpdate(sql);stmt.close();
stmt=conn.createStatement();
sql="update course set tId='"+tId+"' where coId='"+coId+"'";
stmt.executeUpdate(sql);stmt.close();
stmt=conn.createStatement();
sql="update course set credit='"+credit+"' where coId='"+coId+"'";
stmt.executeUpdate(sql);stmt.close();
stmt=conn.createStatement();
sql="update course set period='"+period+"' where coId='"+coId+"'";
stmt.executeUpdate(sql);stmt.close();
stmt=conn.createStatement();
sql="update course set cTime='"+cTime+"' where coId='"+coId+"'";
stmt.executeUpdate(sql);stmt.close();
stmt=conn.createStatement();
sql="update course set cPlace='"+cPlace+"' where coId='"+coId+"'";
stmt.executeUpdate(sql);stmt.close();
stmt=conn.createStatement();
sql="update course set dId='"+d+"' where coId='"+coId+"'";
stmt.executeUpdate(sql);stmt.close();
stmt=conn.createStatement();
sql="update course set cNumAll='"+cNumAll+"' where coId='"+coId+"'";
stmt.executeUpdate(sql);stmt.close();
response.sendRedirect("courseManage.jsp");
}
catch(Exception e){out.println("输入有误");out.print("<a href=courseManage.jsp>院系信息管理页面</a>");
}
}
else
{out.println("请先登陆.....");
out.print("<a href=../index.jsp>登陆页面</a>");
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -