?? addtypeok.jsp
字號:
<%@ include file="conn.jsp"%>
<%@ include file="isadmin.jsp"%>
<%request.setCharacterEncoding("GB2312");
String addtype=request.getParameter("addtype");
if(addtype==null){
out.print("<script>alert('請輸入要添加的欄目名');history.go(-1);</script>");
}
String sql="select * from scott.type where type='"+addtype+"'";
ResultSet rs=stmt.executeQuery(sql);
if(rs.next()){
out.print("<SCRIPT language=JavaScript>alert('數(shù)據(jù)庫中已經(jīng)有一個名為"+addtype+"的欄目了!');");
out.print("history.go(-1);</SCRIPT>");
}else{
stmt.executeUpdate("INSERT INTO scott.type(typeid ,type) VALUES(scott.typeid.nextval,'"+addtype+"')");
out.print("<script>alert('添加成功');window.location.href='addtype.jsp';</script>");
}
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -