25 广东海洋大学本科生课程实习报告
String msg = null;
sql=con.createStatement() ;
rs = sql.executeQuery(\* from student where username='\ + username + \); //查询数据库
if (!rs.next()) {//如果不存在 String birth;
birth = year + \年\ + month + \月\ + day + \日\; /* byte[] bb=username.getBytes(\ username=new String(bb);
byte[] b=sex.getBytes(\ sex=new String(b); */
String updateCondition = \sex, birth, age, telephone , email )values('\+ username+ \+ password+ \+ sex+ \ + birth+\+ age+ \+ telephone + \+ email + \;
sql=con.createStatement();
sql.executeUpdate(updateCondition); //插入数据库中
msg = \恭喜你,已注册成功!\;
out.println(\color=green size=5>提示信息:
\+ msg + \); response.sendRedirect(\); }
else {//如果注册用户已存在
msg = \你所注册的用户已经存在,请你重新注册!\;
out.println(\color=green size=5>提示信息:
\+ msg + \); out.println(\onclick=history.back();>\);} }
catch(Exception e){
out.println(\系统错误\); };
%>