- 35
- 1
- 约6.06千字
- 约 8页
- 2019-09-14 发布于广东
- 举报
个人信息管理系统
1、登录界血
用户登录
用户名:
页面娩转中
代码实现
publi c Boolean 1ogi n (User user) throws SQLException{
Conncction con二DB. conncction();
boolean temp=true;
String sql二〃select * from user where userName=,〃+user. getUserNa me()+…;
PreparedStatement ps二DB. prepar(sql, con);
ResultSet rs=null;
rs=ps. executeQuery ();
if (rs. next ()) {
sql二〃select * from user where password」/z+user. getPassword () +/z,〃 ps二DB. prepar(sql, con);
rs=ps. cxccutcQucry();
if (rs. next ()) {
temp二true;
}else {
temp二false;
}
}else{
temp二false;
}
DB. Close (con);
DB. Close (rs);
return
1
temp;
j
public String
String register(User user){ temp二〃succss;
Connection con二DB. connection();
String sql二〃select * from user where userName=,〃+user. getUserNa me()+…;
PreparedStatement psi二DB.prepar(sql, con);
RcsultSct rs=null;
rs二psi. executeQuery ();
if (rs. next ()) {
〃 〃 temp= error ;
sql二insert into user values (?, ?, ?, ?, ?) PreparedStatement ps2=DB.prepar (sql, con);
ps2. setString(l, ps2. set Str in g(2, ps2. sctString(3, ps2.setString(4, ps2.setString(5,user. getUserName ()); user, get Password ()); user, get Sex ());
ps2. setString(l, ps2. set Str in g(2, ps2. sctString(3, ps2.setString(4, ps2.setString(5,
user. getBirth()); user. getPhone ());
ps2. executeUpdate();
DB. Close(ps2);
} catch (SQLException el) { el.printStackTrace();
}
DB. Close (con);
DB. Close (psi);
return temp;
}
2、主页面
■0牌 ? Aft:
MMe
5?Wf
欢迎使用
3、个人信息界面
佛Sai环
代码实现:
action nan\e=ugerenAdclu class= gerenActionu method=ugerenAdd99 /action
action name=HgerenDetn class= ugerenActionu method= ugerenDeLH /action
action n3^=ugerenMQnan class= gerenActionn method= gerenMana result name=^success/admin/geren/gerenManajsp/result /action
action name= HgerenEditPreu class= HgerenActionu
method=ugerenEditPre
result name= success/admin/geren/gerenEditPre?jsp/result /action
action natr\e=gerenEdit, class= gerenAction
method=ugerenEditu
/action
public String gerenMana()
{
String sql=from TXuyuan where xuyuanDel二no”;
List
xuyuanList=xuyuanDAO?getHibernateT
原创力文档

文档评论(0)