主题:[讨论]为什么我JSP更新数据库没有错误,数据库还是更新不了
求助,谢谢各位,新手。。。感激不尽。。。
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>注册页面</title>
</head>
<body>
<jsp:useBean id="insert" scope="page" class="reg.dbconn"/>
<%
String UserName=request.getParameter("UserName");
String NickName=request.getParameter("NickName");
String Sex=request.getParameter("Sex");
String Password=request.getParameter("Password");
String Question=request.getParameter("Question");
String Answer=request.getParameter("Answer");
String Email=request.getParameter("Email");
String reg;
reg="insert into information(username,nickname,sex,password,question,answer,email) values('"+UserName+"','"+NickName+"','"+Sex+"','"+Password+"','"+Question+"','"+Answer+"','"+Email+"')";
insert.executeUpdate(reg);
%>
<jsp:forward page="reg3_ok.jsp"/>
</body>
</html>
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>注册页面</title>
</head>
<body>
<jsp:useBean id="insert" scope="page" class="reg.dbconn"/>
<%
String UserName=request.getParameter("UserName");
String NickName=request.getParameter("NickName");
String Sex=request.getParameter("Sex");
String Password=request.getParameter("Password");
String Question=request.getParameter("Question");
String Answer=request.getParameter("Answer");
String Email=request.getParameter("Email");
String reg;
reg="insert into information(username,nickname,sex,password,question,answer,email) values('"+UserName+"','"+NickName+"','"+Sex+"','"+Password+"','"+Question+"','"+Answer+"','"+Email+"')";
insert.executeUpdate(reg);
%>
<jsp:forward page="reg3_ok.jsp"/>
</body>
</html>