?? questionsavemodify.jsp
字號(hào):
<%@page contentType="text/html;charset=GBK"%>
<%@page import="java.sql.*" errorPage="/public/error.jsp"%>
<%@ include file="/public/checkvalidadmin.jsp"%>
<%@ include file="/public/checkvalidadmin8.jsp"%>
<jsp:useBean id="conn" scope="page" class="test.ConnOracle"/>
<%!
ResultSet rs = null;
String questionid;
String selectid;
String classid;
String qname;
String choice1;
String choice2;
String choice3;
String choice4;
String answer;
String sql = "";
int result = 0;
String currpage = "1";
%>
<%
request.setCharacterEncoding("GBK");
currpage = request.getParameter("Page");
questionid = request.getParameter("questionid");
selectid = request.getParameter("selectid");
classid = request.getParameter("classid");
qname = request.getParameter("qname");
choice1 = request.getParameter("choice1");
choice2 = request.getParameter("choice2");
choice3 = request.getParameter("choice3");
choice4 = request.getParameter("choice4");
answer = request.getParameter("answer");
// 避免用戶(hù)直接在瀏覽器地址欄輸入頁(yè)面地址所產(chǎn)生的Exception
if(questionid==null || questionid.equals("")) {
out.println("<center>");
out.println("請(qǐng)進(jìn)行合法操作!");
out.println("</center>");
return;
}
try{
sql = "select * from test_question_lib where ";
sql += " questionid='" + questionid + "'";
rs = conn.executeQuery( sql );
if(!rs.next()) {
out.println("<center>");
out.println("數(shù)據(jù)庫(kù)沒(méi)有代號(hào)為" + questionid + "的試題信息!<br>");
out.println("單擊這里<a href=javascript:history.back()>返回</a><br>");
out.println("</center>");
} else {
sql = "update test_question_lib set selectid=" + selectid;
sql+= ",classid='" + classid + "'";
sql+= ",qname='" + qname + "'";
sql+= ",choice1='" + choice1 + "'";
sql+= ",choice2='" + choice2 + "'";
sql+= ",choice3='" + choice3 + "'";
sql+= ",choice4='" + choice4 + "'";
sql+= ",answer='" + answer + "'";
sql+= " where questionid='" + questionid + "'";
result = conn.executeUpdate( sql );
if(result !=1 ) {
out.println("<center>");
out.println("試題信息更新失?。?lt;br><br>");
out.println("請(qǐng)將下列信息告知管理員<br><br>");
out.println("單擊這里<a href=javascript:history.back()>返回</a><br>");
out.println("</center>");
}
}
}catch(Exception ee) {
out.println("<center>");
out.println("試題信息更新失敗!<br><br>");
out.println("請(qǐng)將下列信息告知管理員<br><br>");
out.println(ee.toString() + "<br><br>");
out.println("單擊這里<a href=javascript:history.back()>返回</a><br>");
out.println("</center>");
}
%>
<jsp:forward page="questionmanager.jsp">
<jsp:param name="Page" value="<%=currpage%>"/>
</jsp:forward>
</center>
</Body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -