一:打开软件,创建自己需要的项目名把sqljdbc4.jar导入并且部署
二: model包中的 Student代码
package org.cs.model;
public class Record {
public int id;
public String user_Name;
public String pwd;
public String name;
public String age;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUser_Name() {
return user_Name;
}
public void setUser_Name(String user_Name) {
this.user_Name = user_Name;
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((age == null) ? 0 : age.hashCode());
result = prime * result + id;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((pwd == null) ? 0 : pwd.hashCode());
result = prime * result
+ ((user_Name == null) ? 0 : user_Name.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Record other = (Record) obj;
if (age == null) {
if (other.age != null)
return false;
} else if (!age.equals(other.age))
return false;
if (id != other.id)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (pwd == null) {
if (other.pwd != null)
return false;
} else if (!pwd.equals(other.pwd))
return false;
if (user_Name == null) {
if (other.user_Name != null)
return false;
} else if (!user_Name.equals(other.user_Name))
return false;
return true;
}
@Override
public String toString() {
return “Record [id=” + id + “, user_Name=” + user_Name + “, pwd=” + pwd
+ “, name=” + name + “, age=” + age + “, getId()=” + getId()
+ “, getUser_Name()=” + getUser_Name() + “, getPwd()=”
+ getPwd() + “, getName()=” + getName() + “, getAge()=”
+ getAge() + “, getClass()=” + getClass() + “, hashCode()=”
+ hashCode() + “, toString()=” + super.toString() + “]”;
}
public Record(int id, String user_Name, String pwd, String name, String age) {
super();
this.id = id;
this.user_Name = user_Name;
this.pwd = pwd;
this.name = name;
this.age = age;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String toString1() {
return “序号 id=” + id + “, 用户名=” + user_Name + “, 密码=” + pwd + “, 名字=” + name +",年龄=" +age;
}
public Record() {
super();
// TODO Auto-generated constructor stub
}
public Record(Integer id, String name, String email, String pwd) {
super();
this.id = id;
this.user_Name = user_Name;
this.pwd = pwd;
this.name = name;
this.age = age;
}
}
三: 登录页面相关代码与登录页面index.jsp相关代码
四: 注册页面相关代码与注册页面Lojin.jsp代码
五:最后是用户详情页相关代码和select.jsp
六:util包 DBHelper代码
七:页面展示