1、各专业全套优秀毕业设计图纸各专业全套优秀毕业设计图纸成绩评阅人评阅日期数据库原理课程设计题目:房屋租赁管理系统班级:网络12-1学号:34姓名:指导老师:2014年10月3日目录TOCo1-5hz1.需求分析3.功能分析3.工作流图3.数据流图4.数据字典4.概念模型设计6.逻辑结构设计8.4.功能设计8.5.功能模块的实现9.系统界面9.主要源代码1.4.6.总结3.4.7.参考文献3.4.需求分析1.1功能分析某房屋租赁公司欲建立一个房屋租赁服务系统,统一管理房主和租赁者信息,以便快速地提供租赁服务。该系统具有以下功能:登记房主
3、统会安排租赁者与房主见面。对于每次看房,系统会生成一条看房记录。收取手续费。每成功一次租赁服务,系统根据租赁价格按比例生成费用清单。变更房屋状态。当租赁者与房主达成租房或退房协议后,房主向系统提交变更房屋状态请求。用户论坛。租赁者在论坛上寻找合租对象、与房主进行交流。工作流图房屋租赁管理系统示f申请看房记登记房屋登记租赁者.变更房屋状.态赁房屋的客.租赁的房屋列1.3数据流图1.4数据字典该数据库字典如下表:库表登记表名中文名handingcharges手续费登记表houseowner房主信息表houses房屋信息表renter租赁者信息表rentered已出租的
7、住日臭填隹餐记房屋看崖记录曲的居层岀租的居屋用户论坛退出系统由请疽屁记说房屋編号房屋地址房屋最大容邸数房屋的夷型慣5報曲请求看烏容户喀9|广州市天河区天河花园B栋3輛5带阳合的橫腐(30009|广卅币天河区天河花园B椒沏5带阳台的權启3000第1页息E页下_可图10查看租房记录图10查看租房记录图9更变房屋状态jf益奔W月L2日昊煩佳蚩己房犀看房记录我的房屋出租闽聶用户论坛退岀系统房屋最大容纳人数6房屋的类型带阳台的檯房带阳台的檯房第2页肖卫页下一页匕一页2014年10月12日昱甦-.-iI.1憧用户卷坛退:二系统图11手续费林思邀房主姓名|刘恒乐特祖貸宙屋列表104廃惶最丈容人
9、息图15注册页面=text/html;charset=GBK%language=java5.2主要源代码(1)index.jspv%pagecontentTypeimport=java.util.*vhtmlvheadtitle房屋租赁系统vframesetrows=210,*cols一11*11frameborder=Noborder=0framespacing=0vframesrc=jsp/top.jspname=topscrolling=nonorresizevframesrc=jsp/first.jspname=mainscro
10、lling=yes/frameset(2)first.jspvhtmlvhead欢迎光临vtablealign=centerwidth=579height=300border=0celpadding=0vtablewidth=568height=178border=0cellpadding=0cellspacing=0background=./images/background.gif(3)top.jsppageEncoding=GBK%:+request.getServ%pageIanguage=javaimport=java.ut
12、ptfunctiontype=text/javascriptbt_submit_onclick()location.replace(./SurWetland.jsp);functionvarvarvarcheckForm()subform=document.form_s;houseower_name=subform.houseower_name.value;house_address=subform.house_address.value;if(monitor_units=)|monitor_units.replace(/(As*)|(s*$)/g,)
13、=ifalert(房主姓名不能为空!subform.monitor_units.focus();returnfalse;);(farmername=|farmername.replace(/(As*)|(s*$)/g,alert(人工湿地名称不能为空!subform.farmername.focus();III!)=);returnfalsesubform.action=bbfunctionfile_check()varsubform=document.form_uqfile;file=subform.file1.value;if(file=)请选择要
14、上传的文件);varalert(returnfalse;elsesubform.action=/iep/afile.dofiles=+file;subform.submit();/弹出选择历史functionLineQueryOpen()varsubform=document.form_s;varmonitor_units=subform.monitor_units.value;varfarmername=subform.farmername.value;III!)=if(monitor_units=|monitor_units.repl
15、ace(/(As*)|(s*$)/g,=)TOCo1-5hzalert(检测单位不能为空!“);subform.monitor_units.focus();returnfalse;if(farmername=|farmername.replace(/(As*)|(s*$)/g,)=”)alert(人工湿地名称不能为空!“);subform.farmername.focus();returnfalse;window.showModalDialog(/iep/SurWetland.domethod=findEvents&farmername=+fa
16、rmername,,dialogWidth:1000px;dialogHeight:420px;);登记房屋formname=form_saction=bbmethod=post房主姓名:房屋地址:房屋租金:type=text最多能容纳的房客数:房屋类型:vselectname=housetypesize=1平房voptionvalue=带阳台的楼房带阳台的楼房/option独立式住宅独立式住宅/option房屋状态:vselectname=house
19、n;importjava.sql.Statement;publicclassHODaoprivateConnectioncon;privateStringdriver;privateStringurl;privateStringusername;privateStringpass;publicHODao()publicHODao(Stringdriver,Stringurl,Stringusername,Stringpass)this.driver=driver;this.url=url;this.username=username;
20、this.pass=pass;publicConnectiongetCon()returncon;publicvoidsetCon(Connectioncon)this.con=con;publicStringgetDriver()returndriver;publicvoidsetDriver(Stringdriver)this.driver=driver;publicStringgetUrl()returnurl;publicvoidsetUrl(Stringurl)this.url=url;publicStringget
21、Username()returnusername;publicvoidsetUsername(Stringusername)this.username=username;publicStringgetPass()returnpass;publicvoidsetPass(Stringpass)this.pass=pass;*閿熸枻鎷峰彇閿熸枻鎷疯彉閿熸枻鎷烽敓鏂嫹浣1敓鏂嫹閿燂拷*throwsClassNotFoundException*throwsSQLException*/publicConnectiongetConnection()thro
22、wsClassNotFoundException,SQLExceptionif(con=null)Class.forName(driver);con=(Connection)DriverManager.getConnection(url,username,pass);returncon;/*插入查询throwsSQLExceptionthrowsClassNotFoundException*/publicbooleaninsert(Stringsql,ObjectClassNotFoundExceptionPreparedStatementgetCo
23、nnection().prepareStatement(sql);for(inti=0;iargs.length;i+)/Stringarg=(String)argsi;ps.setObject(i+1,argsi);if(ps.executeUpdate()!=1)returnfalse;returntrue;args)throwsSQLException,ps=(PreparedStatement)/*throwsSQLExceptionthrowsClassNotFoundException*/publicResultSet
24、query(Stringsql,ObjectClassNotFoundException,SQLExceptionargs)throwsPreparedStatementps=getConnection().prepareStatement(sql);for(inti=0;iargs.length;i+)ps.setObject(i+1,argsi);returnps.executeQuery();/*鎵q敓鏂嫹閿熺潾闈+嫹*/publicResultSetqueryall(Stringsql)throwsClassNotFoundEx
25、ception,SQLExceptionStatementps=getConnection().createStatement();returnps.executeQuery(sql);/*修改数据throwsSQLExceptionthrowsClassNotFoundExceptionthrows*/publicvoidmodify(Stringsql,Objectargs)ClassNotFoundException,SQLExceptionPreparedStatementps=getConnection().prepar
26、eStatement(sql);for(inti=0;iargs.length;i+)ps.setObject(i+1,argsi);ps.executeUpdate();/*关闭数据库连接*throwsSQLException*/publicvoidcloseCon()throwsSQLExceptionif(con!=null&!(con.isClosed()con.close();(8)modifyhousestate.javapackagewebtier;importjava.io.IOException;importjav
29、onseresponse)throwsServletException,IOExceptionServletContextconfig=getServletConfig().getServletContext();GBK);request.setCharacterEncoding(Stringhouse_state仁request.getParameter(Mapmap=request.getParameterMap();Setset=map.entrySet();Iteratorit=set.iterator();Stringstr=n
30、ull;while(it.hasNext()str=it.next().toString();if(str.contains(submit)break;Stringid=str.substring(6);id=id.split(=)0;/Stringid=String.valueOf(charid);HttpServletResponsere=response;Stringhouse_state2=request.getParameter(Stringhouse_state=request.getParameter(Stringdriver=config.g
31、etInitParameter(house_state1house_state10house_statedriver);););+id);Stringurl=config.getlnitParameter(url)+useUnicode=true&characterEncoding=GBK;Stringuser=config.getInitParameter(user);Stringpass=config.getInitParameter(pass);HODaohoDao=newHODao(driver,url,user,pass);S
32、tringsql=updatehousessethouses.house_state=wherehouses.houseid=;Stringargs=newStringhouse_state,id;tryhoDao.modify(sql,args);/hoDao.closeCon();catch(ClassNotFoundExceptione)/TODOAuto-generatedcatchblocke.printStackTrace();catch(SQLExceptione)/TODOAuto-generatedcat
33、chblocke.printStackTrace();response.setContentType(text/html;charset=utf-8);PrintWriterpw=response.getWriter();if(house_state.equals(已岀租)Stringhouseower_name=(String)config.getAttribute(houseowername=newhouseower_name);String(houseower_name.getBytes(Stringhouseid=id;StringISO-8
34、859-1),GBK);house_address=request.getParameter(Stringhouseaddress+id);rentered_name=request.getParameter(doublerenteredname+id);rentvalue=Double.(request.getParameter(parseDoubledoublehandlingcharge=rent_value*0.2;/PrintWriterpw=response.getWriter();rentered_namerentvalue+id);pw.writ
35、e(alert(功,系统收取+handlingcharge+元手续费)String祝贺您租房成);args2=houseower_name,houseid,house_address,String.valueOf(rent_value),String.valueOf(handlingcharge);Stringsql2=insertintohandlingcharges(houseower_name,houseid,house_address,rent_value,handlingcharge)+values(,,,,);Stringsq
36、l3=insertintorentered(houseid,rentered_name)values(,);Stringargs3=newStringhouseid,rentered_name;tryhoDao.insert(sql2,args2);hoDao.insert(sql3,args3);catch(ClassNotFoundExceptione)/TODOAuto-generatedcatchblocke.printStackTrace();catch(SQLExceptione)/TODOAuto-generatedcatchblo