<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="myBean.*" %>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>插入数据库</title>
</head>

<body>
<jsp:useBean id="db" scope="page" class="myBean.DBConnection" />
<%
	String name = db.convertDB(db.convertGBK(request.getParameter("name")));
	String email = db.convertDB(request.getParameter("email"));

	String sql= "insert into user(name, email) values('" + name +"', '"+ email +"')";
	out.print(sql);
	if(db.execModify(sql) == 1) {
		out.print("<p>插入数据成功!");
	}else {
		out.print("<p>数据库操作有误!");
	}
%>
<p><a href="list_userinfo.jsp">查看数据</a>
<p><a href="userinfo.jsp">返回</a>
</body>

</html>