资源描述:
《个人信息管理系统源代码(自己写的).doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、这是一个个人信息管理系统的web应用程序,为本人学习完JSP后花了一天时间写的,虽然很粗糙,但因为所学知识不多,编程经验很少,能做到这样,觉得暂时还不错。数据库为sqlserver2005开发环境为eclipse以下是源代码。包括数据库的创建,B.java(JavaBeans放翁数据库),index.jsp(主页)和Jsp0.jsp,Jsp1.jsp,Jsp2.jsp,Jsp3.jsp,Jsp4.jsp,Jsp5.jsp,Jsp6.jsp,创建数据库createdatabasequanonprimary(name='quan_db',filename='d:quan.mdf
2、',size=5mb,maxsize=50mb,filegrowth=10%)createtablem(midchar(30)notnullprimarykey,mnamechar(10)notnull,sexchar(8),ageint,heightint,jianshuchar(50),aihaochar(50))-----------------------------------------------------------------------------------------------------------------------------------
3、-------//bean访问数据库//bean访问数据库packageb;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.PreparedStatement;importjava.sql.ResultSet;importjava.sql.SQLException;publicclassB{privateStringname;privateStringmid;privateStringsex;privateintage;privateintheight;privateStringjia
4、nshu;privateStringaihao;publicvoidB(){name="";mid="";sex="";age=0;height=0;jianshu="";aihao="";}publicvoidsetName(Stringname){this.name=name;}publicStringgetName(){returnname;}publicvoidsetMid(Stringmid){this.mid=mid;}publicStringgetMid(){returnmid;}publicvoidsetSex(Stringsex){this.sex=sex;
5、}publicStringgetSex(){returnsex;}publicvoidsetAge(intage){this.age=age;}publicintgetAge(){returnage;}publicvoidsetHeight(intheight){this.height=height;}publicfloatgetHeight(){returnheight;}publicvoidsetJianshu(Stringjianshu){this.jianshu=jianshu;}publicStringgetJianshu(){returnjianshu;}publ
6、icvoidsetAihao(Stringaihao){this.aihao=aihao;}publicStringgetAihao(){returnaihao;}static{try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}catch(ClassNotFoundExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}}ConnectiongetCon(Stringuser,Stringpwd){Connectioncon=null;try{con=Dr
7、iverManager.getConnection("jdbc:odbc:qdb",user,pwd);}catch(SQLExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}finally{if(con==null){returnnull;}else{returncon;}}}voidclose1(Connectioncon,PreparedStatementps){try{if(con!=null)con.close();}c