欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOC文档下载  

    java web学生信息管理系统.doc

    • 资源ID:2386764       资源大小:160.50KB        全文页数:28页
    • 资源格式: DOC        下载积分:8金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要8金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    java web学生信息管理系统.doc

    Web程序设计 学生信息管理系统 姓名:鲁超、刘千飞、肖伟超万联播、张明明、白浩班级: 软件0901 时间:2011/12/22 一、实验目的 熟练运用web开发技术设计完成一个学生信息管理系统。二、实验原理功能要求:基于B/S架构实现学生信息的增删改查展示功能,实现完整的应用构建和界面设计。技术要求:基于mysql或mssqlserver数据库,以Tomcat为应用服务器,可使用Jsp+Servelt+Javabean完成,鼓励使用struts,Hibernate框架完成设计。三、实验分组成员姓名成员学号负责内容鲁超200907040101删除模块刘千飞200907040102登陆页面及参与总体内容设计肖伟超200907040103修改模块万联播200907040104查询模块张明明200907040105分页及参与总体内容的设计白浩200907040107增加模块四、实验内容登陆主页源代码:login.html:<!DOCTYPE html PUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN" "http:/www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>登陆模块</title></head><body bgcolor=lightblue bgcolor="FFFFFF"><h1 align="center"><b>欢迎登陆学生信息管理系统</b></h1><hr><form action="forward.jsp" method="post"><p></p><table width="52%" border="2" align="center"><tr bgcolor="#FFFFCC"><td align="center" width="43%"><div align="center">用户名:</div></td><td width="57%"><div align="left"><input type="text" name="username"></div></td></tr><tr bgcolor="#CCFF99"><td align="center" width="43%"><div align="center">密码:</div></td><td width="57"><div align="left"><input type="password" name="password"></div></td></tr></table><p align="center"><input type="reset" name="Reset" value="重置"><input type="submit" name="Submit2" value="提交"></p></form></body></html>forward.jsp:<% page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312"%><!DOCTYPE html PUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN" "http:/www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>login forward</title></head><body bgcolor=lightblue><%String username=null;String password=null;request.setCharacterEncoding("gb2312");response.setContentType("text/html;charset=gb2312");username=request.getParameter("username");password=request.getParameter("password");if(!username.equals("")&&!password.equals("")%><jsp:forward page="login_ok.jsp"><jsp:param name="username" value='<%=username%>'/><jsp:param name="username" value='<%=password%>'/></jsp:forward><%else%><jsp:forward page="error.jsp"><jsp:param name="username" value='<%=username%>'/><jsp:param name="username" value='<%=password%>'/></jsp:forward><%></body></html>login_ok.jsp:<% page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312"%><!DOCTYPE html PUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN" "http:/www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Insert title here</title><style type="text/css">inputcolor:red;font-size:12pt;</style></head><body bgcolor=lightblue><center><h1>欢迎您使用学生管理系统</h1></center><hr><%String username=null;String password=null;request.setCharacterEncoding("gb2312");response.setContentType("text/html;charset=gb2312");username=request.getParameter("username");password=request.getParameter("password");out.println("登陆成功,用户名<font color='red'>"+username+"</font>,");out.println("密码<font color='red'>"+password+"</font>");%><br><p align="center">请选择您要进行的操作:<form action="p_cha.html" method="post"><input type="submit" name="cha" value="查 询"> </form><form action="p_shan.html" method="post"><input type="submit" name="shan" value="删 除"> </form><form action="p_gai.html" method="post"><input type="submit" name="gai" value="修 改"> </form><form action="p_zeng.html" method="post"><input type="submit" name="zeng" value="增 加"> </form></body></html>error.jsp:<% page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312"%><!DOCTYPE html PUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN" "http:/www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Error</title></head><body bgcolor=lightblue><center><h1>欢迎您使用学生管理系统</h1></center><%String username=null;String password=null;request.setCharacterEncoding("gb2312");response.setContentType("text/html;charset=gb2312");username=request.getParameter("username");password=request.getParameter("password");out.println("您输入的用户名<font color='red'>"+username+"</font>,");out.println("和密码<font color='red'>"+password+"</font>有一项为空,请重新输入:");%><a href="login.html">-返回重新登陆-</a></body></html>学生信息增加模块:p_zeng.html:<% page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312"%><!DOCTYPE html PUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN" "http:/www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Insert title here</title><style type="text/css">inputcolor:red;font-size:12pt;</style></head><body bgcolor=lightblue><center><h1>欢迎您使用学生管理系统</h1></center><hr><%String username=null;String password=null;request.setCharacterEncoding("gb2312");response.setContentType("text/html;charset=gb2312");username=request.getParameter("username");password=request.getParameter("password");out.println("登陆成功,用户名<font color='red'>"+username+"</font>,");out.println("密码<font color='red'>"+password+"</font>");%><br><p align="center">请选择您要进行的操作:<form action="p_cha.html" method="post"><input type="submit" name="cha" value="查 询"> </form><form action="p_shan.html" method="post"><input type="submit" name="shan" value="删 除"> </form><form action="p_gai.html" method="post"><input type="submit" name="gai" value="修 改"> </form><form action="p_zeng.html" method="post"><input type="submit" name="zeng" value="增 加"> </form></body></html>zeng.jsp:<% page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312" import="java.sql.*"%><!DOCTYPE html PUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN" "http:/www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>call stored procedure</title></head><body bgcolor=lightblue> <% int PAGESIZE=3; int pageCount=0; int curPage=1; java.sql.Connection conn=null; PreparedStatement pstmt=null; Statement stmt=null; ResultSet rs=null; String cloStr="sno","sname","cclass","sex","age","nation","clname","place" String showStr="学生编号","学生姓名","所在年级","性别","年龄","民族","专业","住址"String sno,sname,cclass,sex,age,nation,clname,place; String strURL="jdbc:mysql:/localhost/test" String strDBUser="root" String strDBPwd="123" try Class.forName("com.mysql.jdbc.Driver"); conn=java.sql.DriverManager.getConnection(strURL,strDBUser,strDBPwd); catch(ClassNotFoundException e) e.printStackTrace(); out.println("您输入的信息有误,请查证后再重新输入!"); catch(Exception ex) ex.printStackTrace(); out.println("您输入的信息有误,请查证后再重新输入!"); try sno=request.getParameter("sno"); byte no=sno.getBytes("ISO-8859-1"); sno=new String(no); sname=request.getParameter("sname"); byte name=sname.getBytes("ISO-8859-1"); sname=new String(name,"gb2312"); cclass=request.getParameter("cclass"); byte clss=cclass.getBytes("ISO-8859-1"); cclass=new String(clss,"gb2312"); sex=request.getParameter("sex"); byte ex=sex.getBytes("ISO-8859-1"); sex=new String(ex,"gb2312"); age=request.getParameter("age"); byte ge=age.getBytes("ISO-8859-1"); age=new String(ge); nation=request.getParameter("nation"); byte tion=nation.getBytes("ISO-8859-1"); nation=new String(tion,"gb2312"); clname=request.getParameter("clname"); byte cname=clname.getBytes("ISO-8859-1"); clname=new String(cname,"gb2312"); place=request.getParameter("place"); byte lace=place.getBytes("ISO-8859-1"); place=new String(lace,"gb2312"); String sqlll="insert into S(sno,sname,cclass,sex,age,nation,clname,place) values('"+sno+"','"+sname+"','"+cclass+"','"+sex+"','"+age+"','"+nation+"','"+clname+"','"+place+"')"pstmt=conn.prepareStatement(sqlll);int count3=pstmt.executeUpdate();/插入 String sqllll="select * from S" stmt=conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY); rs=stmt.executeQuery(sqllll); rs.last();int size=rs.getRow();pageCount=(size%PAGESIZE=0)?(size/PAGESIZE):(size/PAGESIZE+1); catch(Exception ex) ex.printStackTrace(); out.println("您输入的信息有误,请查证后再重新输入!"); /获取想要显示的页数: String integer=request.getParameter("curPage"); if(integer=null) integer="1" try curPage=Integer.parseInt(integer); catch(NumberFormatException e) curPage=1; if(curPage<=1) curPage=1; if(curPage>=pageCount) curPage=pageCount; /如果要显示第curPage页,那么游标应移到posion的值是: int posion=(curPage-1)*PAGESIZE+1; rs.absolute(posion); / 设置游标的位置%><br><table border=1 cellspacing=0 width='100%' class=listFram id="maintable"><tr><%for(int i=0;i<showStr.length;i+)out.println("<td height=5>");out.println("<div align='center'>"+showStri+"</div></td>");%></tr><%int count=0;do if(count>=PAGESIZE)break; out.println("<tr>");for(int i=0;i<cloStr.length;i+)out.println("<td height=5>");out.println("<div align='center'>"+rs.getString(cloStri)+"</div></td>");out.println("</tr>");count+;while(rs.next();%></table><a href = "cha.jsp?curPage=1" >首页</a> <a href = "cha.jsp?curPage=<%=curPage-1%>" >上一页</a> <a href = "cha.jsp?curPage=<%=curPage+1%>" >下一页</a> <a href = "cha.jsp?curPage=<%=pageCount%>" >尾页</a> 第<%=curPage%>页/共<%=pageCount%>页 <FORM action="" method=get >输入页码数<Input Type=text name=curPage size=4> <Input Type=submit name=g value="跳转"> </FORM> </body></html>学生信息删除模块:p_shan.html:<!DOCTYPE html PUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN" "http:/www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Insert title here</title><style type="text/css">h3color:red;</style></head><body bgcolor=lightblue><center><h1>欢迎您使用学生管理系统</h1></center><p align="center"><hr><div align="right"><a href="login_ok.jsp">返回首页</a></div><h3>删 除 操 作</h3><table align="center"><tr><td>请输入学生学号:<form target="mainFrame" action="shan_xuehao.jsp" method="post" ><input type="text" name="sno" size=20><input type="submit" name="su" value="按学号删除"></form></td><td>请输入学生姓名:<form target="mainFrame" action="shan_xingming.jsp" method="post" ><input type="text" name="sname" size=20><input type="submit" name="su" value="按姓名删除"></form></td></tr><tr><td>请输入学生性别:<form target="mainFrame" action="shan_xingbie.jsp" method="post" ><input type="text" name="sex" size=20><input type="submit" name="su" value="按性别删除"></form></td><td>请输入学生住址:<form target="mainFrame" action="shan_dizhi.jsp" method="post" ><input type="text" name="place" size=20><input type="submit" name="su" value="按地址删除"></form></td></tr></table><p align="center"><iframe width=700 height=700 name="mainFrame" frameborder="no"></iframe></body></html>按学号删除: Shan_xuehao.jsp:<% page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312" import="java.sql.*"%><!DOCTYPE html PUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN" "http:/www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>call stored procedure</title></head><body bgcolor=lightblue> <% int PAGESIZE=3; int pageCount=0; int curPage=1; java.sql.Connection conn=null; PreparedStatement pstmt=null; Statement stmt=null; ResultSet rs=null; String cloStr="sno","sname","cclass","sex","age","nation","clname","place" String showStr="学生编号","学生姓名","所在年级","性别","年龄","民族","专业","住址" String sno; if(conn=null) String strURL="jdbc:mysql:/localhost/test" String strDBUser="root" String strDBPwd="123" try Class.forName("com.mysql.jdbc.Driver"); out.println("连接数据库成功."); conn=java.sql.DriverManager.getConnection(strURL,strDBUser,strDBPwd); catch(ClassNotFoundException e) e.printStackTrace(); out.println("ClassNotFoundException111"); catch(Exception ex) ex.printStackTrace(); out.println("Exception11"); trysno=request.getParameter("sno"); byte no=sno.getBytes("ISO-8859-1"); sno=new String(no);String sql="delete from S where sno="+sno;pstmt=conn.prepareStatement(sql);int count=pstmt.executeUpdate();/删除String sqllll="select * from S"stmt=conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY);rs=stmt.executeQuery(sqllll);rs.last();int size=rs.getRow();pageCount=(size%PAGESIZE=0)?(size/PAGESIZE):(size/PAGESIZE+1);catch(Exception ex) ex.printStackTrace(); out.println("您输入的信息有误,请查证后再重新输入!"); /获取想要显示的页数: String integer=request.getParameter("curPage"); if(integer=null) integer="1" try curPage=Integer.parseInt(integer); catch(NumberFormatException e) curPage=1; if(curPage<=1) curPage=1; if(curPage>=pageCount) curPage=pageCount; /如果要显示第curPage页,那么游标应移到posion的值是: int posion=(curPage-1)*PAGESIZE+1; rs.absolute(posion); / 设置游标的位置%><br><table border=1 cellspacing=0 width='100%' class=listFram id="maintable"><tr><%for(int i=0;i<showStr.length;i+)out.println("<td height=5>");out.println("<div align='center'>"+showStri+"</div></td>");%></tr><%int count=0;do if(count>=PAGESIZE)break; out.println("<tr>");for(int i=0;i<cloStr.length;i+)out.println("<td height=5>");out.println("<div align='center'>"+rs.getString(cloStri)+"</div></td>");out.println("</tr>");count+;while(rs.next();%></table><a href = "

    注意事项

    本文(java web学生信息管理系统.doc)为本站会员(仙人指路1688)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开