版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、jsp+oracle分页(含模糊查询)CREATESEQUENCEperson.sequ;CREATETABLEperson(idintnotnul1primarykey?一一sequenceuseridvarchar2(32),namevarchar2(32),passwordvarchar2(20);INSERTINTOperson(id,userid,name,password)(person.sequ.nextVal,zymOU猛哥01,T);INSERTINTOperson(id,userid,name,password)(person.sequ.nextVal,zym02,z猛哥0
2、2,T);INSERTINTOperson(id,userid,name,password)(person.sequ.nextVal,zym03,猛哥03,T);INSERTINTOperson(id,userid,name,password)(person.sequ.nextVal,zym04,f猛哥04,T);INSERTINTOperson(id,userid,name,password)(person.sequ.nextVal,zym05,猛哥05,T);INSERTINTOperson(id,userid,name,password)(person.sequ.nextVal,zym0
3、6,f猛哥06,T);INSERTINTOperson(id,userid,name,password)(person.sequ.nextVal,fym07,猛哥07,T);VALUESVALUESVALUESVALUESVALUESVALUESVALUESINSERTINTOperson(id,userid,name,password)VALUES(person-sequ.nextVal,zym08,猛哥08,T);INSERTINTOperson(id,userid,name,password)VALUES(person-sequ.nextVal,zym09,f猛哥09,T);INSERT
4、INTOperson(id,userid,name,password)VALUES(person-sequ.nextVal,fyml0,猛哥10,T);INSERTINTOperson(id,userid,name,password)VALUES(person-sequ.nextVal,zymll,猛哥11,T);INSERTINTOperson(id,userid,name,password)VALUES(person-sequ.nextVal,zyml2,,/猛哥12,T);INSERTINTOperson(id,userid,name,password)VALUES(person-seq
5、u.nextVal,zyml3,猛哥13,T);INSERTINTOperson(id,userid,name,password)VALUES(person-sequ.nextVal,fyml4,,/猛哥14,T);INSERTINTOperson(id,userid,name,password)VALUES(person-sequ.nextVal,zyml5,猛哥15,T);INSERTINTOperson(id,userid,name,password)VALUES(person-sequ.nextVal,zyml6,猛哥16,T);INSERTINTOperson(id,userid,n
6、ame,password)VALUES(person-sequ.nextVal,zyml7,,/猛哥17,T);INSERTINTOperson(id,userid,name,password)VALUES(person-sequ.nextVal,fyml8,猛哥18,T);INSERTINTOperson(id,userid,name,password)(person-sequ.nextVal,zyml9,,/猛哥19,T);INSERTINTOperson(id,userid,name,password)(person-sequ.nextVal,zym20,,/猛哥20,T);INSERT
7、INTOperson(id,userid,name,password)(person-sequ.nextVal,zym21,,/猛哥21,T);INSERTINTOperson(id,userid,name,password)(person-sequ.nextVal,zym22,,/猛哥22,T);INSERTINTOperson(id,userid,name,password)(person-sequ.nextVal,zym23,,/猛哥23,T);list,jsp分页显示人员列表VALUESVALUESVALUESVALUESVALUES/进行乱码处理requestsetCharacter
8、Encoding(GB2312);%/接收查询关键字keyWord=newString(request.getParameter(kw)getBytes(8859-1);/keyWord=request.getParameter(nkw);/接收传过来的当前页trycurrentPageInteger.parselnt(request.getParameter(cpn);catch(Exceptione)StringDBDRIVER=oracle,jdbc.driver.OracleDriver;StringDBURL=jdbc:oracle:thin:310:1521:
9、styleerp*;StringDBUSER=nSYSTEM;StringDBPASSWORD=HASDqwel23;Connectionconn=nu11;%tryClass.forName(DBDRIVER);conn=DriverManager.getConnection(DBURL,DBUSER,DBPASSWORD);PreparedStatementpstmt=null;Stringsql=nul1;if(keyWord=nul1)/如果为空则没有查询,表示查询出全部sql=SELECTCOUNT(id)fromperson;elsesql=SELECTCOUNT(id)fromp
10、ersonWHEREuseridLIKE?ORnameLIKE?;pstmt=conn.prepaTeStatement(sql);/如果有查询关键字,则进行设置if(keyWord!=nul1)pstmt.setString(1,%+keyWord+n%);pstmt.setString(2,%+keyWord+%);ResultSetrs=pstmt.executeQuery();if(rs.next()alIRecorders=rs.getInt(1);rs.close();pstmt.close();/计算总页数pageSize=(alIRecorders+lineSize-1)/Ii
11、neSize;if(keyWord=nul1)sql=nSELECTid,userid,name,passwordFROMperson;elsesql=SELECTid,userid,name,passwordFROMpersonWHEREuseridLIKE?ORnameLIKE?;pstmt=conn.prepaTeStatement(sql);if(keyWord!=nul1)pstmt.setString(1,%+keyWord+%);pstmt.setString(2,n%n+keyWord+n%n);rs=pstmt.executeQuery();%functionopenPage
12、(curpage)document,spage.cp.value=curpage;/alert(cupage);document,spage.submit();functionselOpenPage()document,spage.cp.valuedocument,spage.selpage.value;document,spage.submit();formname=spageaction=输入查询关键字:inputtype=Mtextname=nkwva1ue=M0)%inputtype=buttonvalue=首页onClick=MopenPage(1)inputtype=Mbutton
13、value=上一页onClick=MopenPage()inputtype=Mbuttonvalue=下一页onClick=MopenPage()inputtype=buttonvalue=尾页onClick=openPage()AA%cuondo、資莫关于二一hpQlos-QXHEbnEdluu.IJny爭-HonleAuo二do)(+XOZ一soMed=:x二Hx-UUJOJ%二(obneduQdoos二Hobnueqouo_oMedos=:2UEU-OCDOS嬴擦謎nuoJ7QZ-s*Ed2_-rsz-s二PQJ1.IOC。1UOJp%登陆名称姓名密码操作%inti=0;for(intx=0;x(current1)*1ineSize;x+)rs.next();/对于输出代
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025浙江温州市供销集团有限公司招聘工作人员1人参考笔试题库及答案解析
- 2025湖北省中西医结合医院招聘1人笔试备考试题及答案解析
- 2026新疆第三师图木舒克市面向社会招聘事业单位人员84人笔试备考试题及答案解析
- 2026年输电设备检验认证协议
- 2026年夏季水上乐园特色活动策划方案
- 2025永宁县第二中学消防控制室值班员招聘1人笔试模拟试题及答案解析
- 2025福建水投集团福鼎生态环境有限责任公司招聘3人考试备考题库及答案解析
- 2026年系统稳定性外包服务合同
- 2026年网络安全监控服务合同协议
- 2026海亮股份校园招聘“航海计划”笔试参考题库及答案解析
- 制造业数字化转型公共服务平台可行性研究报告
- 氢能与燃料电池技术 课件 5-燃料电池
- DG-TJ08-2011-2007 钢结构检测与鉴定技术规程
- 【课件】台湾的社区总体营造
- 重庆市两江新区2023-2024学年五年级上学期英语期末试卷
- BGO晶体、LYSO晶体、碲锌镉晶体项目可行性研究报告写作模板-备案审批
- 昆明理工大学《机器学习》2023-2024学年第一学期期末试卷
- 2023版国开电大本科《高级财务会计》在线形考(任务一至四)试题及答案
- 难治性类风湿关节炎的诊治进展
- 城镇职工医疗保险
- 煤矿用履带式液压钻机ZDY2300LX说明书-图文
评论
0/150
提交评论