日期:2014-05-17 浏览次数:20933 次
package ui;
public class UserInfo {
private int id;
private String username;
private String userpassword;
private String qqnum;
private String qqpw;
private String telphone;
private String email;
//id
public int getId(){
return id;
}
public void setId(int id){
this.id=id;
}
//用户名
public String getUsername(){
return username;
}
public void setUsername(String username){
this.username=username;
}
//登录密码
public String getUserpassword(){
return userpassword;
}
public void setUserpassword(String userpassword){
this.userpassword=userpassword;
}
//QQ号码
public String getQqnum(){
return qqnum;
}
public void setqQnum(String qqnum){
this.qqnum=qqnum;
}
//QQ密码
public String getQqpw(){
return qqpw;
}
public void setQqpw(String qqpw){
this.qqpw=qqpw;
}
//手机
public String getTelphone(){
return telphone;
}
public void setTelphone(String telphone){
this.telphone=telphone;
}
//邮箱
public String getEmail(){
return email;
}
public void setEmail(String email){
this.email=email;
}
}
<form action="AddInfo.jsp" method="post" onsubmit="return check(this);">
<table align="center" width="450">
<tr>
<td align="center" colspan="2" height="40">
<b>user info</b>
</td>
</tr>
<tr>
<td align="right">username:</td>
<td>
<input type="text" name="username">
</td>
</tr>
<tr>
<td align="right">userpassword:</td>
<td>
<input type="password" name="userpassword">
</td>
</tr>
<tr>
<td align="right">qqnum:</td>
<td>
<input type="text" name="qqnum">
</td>
</tr>
<tr>
<td align="right">qqpw:</td>
<td>
<input type="password" name="qqpw">
</td>
</tr>
<tr>
<td align="right">telephone:</td>
<td>
<input type="text" name="telphone">
</td>
</tr>
<tr>
<td align="right">email:</td>
<td>
<input type="text" name="email">
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" value="add">
</td>
</tr>
</table>
</form>
<jsp:useBean id="userinfo" class="ui.UserInfo"></jsp:useBean>
<jsp:setProperty property="*" name="userinfo"/>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%
try{
Class.forName("com.mysql.jdbc.D