📄 admin_0005fuserupdate_0002ejsp_jsp.java
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class admin_0005fuserupdate_0002ejsp_jsp extends HttpJspBase {
// begin [file="/admin_userupdate.jsp";from=(17,3);to=(27,0)]
//处理字符串的一个常用方法
public String getString(String s){
if(s==null) s="?";
try{byte a[]=s.getBytes("ISO-8859-1");
s=new String(a);
}catch(Exception e){
s="?";
}
return s;
}
// end
static {
}
public admin_0005fuserupdate_0002ejsp_jsp( ) {
}
private static boolean _jspx_inited = false;
public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
String _value = null;
try {
if (_jspx_inited == false) {
synchronized (this) {
if (_jspx_inited == false) {
_jspx_init();
_jspx_inited = true;
}
}
}
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/admin_userupdate.jsp";from=(0,48);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/admin_userupdate.jsp";from=(1,31);to=(17,0)]
out.write("\r\n\r\n<html>\r\n<head>\r\n<title>BBS管理系统</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody {\r\n\tbackground-color: #FFCC99;\r\n}\r\n-->\r\n</style>\r\n\r\n</head>\r\n<body bgcolor=\"#ffffff\">\r\n\r\n");
// end
// HTML // begin [file="/admin_userupdate.jsp";from=(27,2);to=(28,0)]
out.write("\r\n");
// end
// begin [file="/admin_userupdate.jsp";from=(28,2);to=(68,0)]
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:bbs","","");
stmt=conn.createStatement();
int num=Integer.parseInt(request.getParameter("userid"));
String password=request.getParameter("password");
String nichen=request.getParameter("nichen");
nichen=getString(nichen);
String sex=request.getParameter("sex");
sex=getString(sex);
String brithday=request.getParameter("brithday");
brithday=getString(brithday);
String from=request.getParameter("from");
from=getString(from);
String email=request.getParameter("E-mail");
email=getString(email);
String zhuye=request.getParameter("zhuye");
zhuye=getString(zhuye);
String QQ=request.getParameter("QQ");
QQ=getString(QQ);
String MSN=request.getParameter("MSN");
MSN=getString(MSN);
String info=request.getParameter("info");
info=getString(info);
stmt.executeUpdate("UPDATE user SET password='"+password+"'WHERE userid="+num);
stmt.executeUpdate("UPDATE user SET nickname='"+nichen+"'WHERE userid="+num);
stmt.executeUpdate("UPDATE user SET sex='"+sex+"'WHERE userid="+num);
stmt.executeUpdate("UPDATE user SET brithday='"+brithday+"'WHERE userid="+num);
stmt.executeUpdate("UPDATE user SET userfrom='"+from+"'WHERE userid="+num);
stmt.executeUpdate("UPDATE user SET email='"+email+"'WHERE userid="+num);
stmt.executeUpdate("UPDATE user SET zhuye='"+zhuye+"'WHERE userid="+num);
stmt.executeUpdate("UPDATE user SET QQ='"+QQ+"'WHERE userid="+num);
stmt.executeUpdate("UPDATE user SET MSN='"+MSN+"'WHERE userid="+num);
stmt.executeUpdate("UPDATE user SET info='"+info+"'WHERE userid="+num);
out.println("<script>alert('更新成功!');this.location.href='admin_userlist.jsp';</script>");
conn.close();
// end
// HTML // begin [file="/admin_userupdate.jsp";from=(68,2);to=(71,0)]
out.write("\r\n</tr>\r\n</table>\r\n");
// end
// begin [file="/admin_userupdate.jsp";from=(71,2);to=(75,0)]
}catch(Exception e){
out.println("<script>alert('更新失败!');history.go(-1);</script>");
}
// end
// HTML // begin [file="/admin_userupdate.jsp";from=(75,2);to=(78,0)]
out.write("\r\n</body>\r\n</html>\r\n");
// end
} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -