预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共11页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

下面是写的一个邮件系统页面的分页,数据库可以根据情况改动,已经测试过,仅供参考! 1.UserMail.java packagecom.softeem.user; publicclassUserMail{ privateintid; //发件人 privateStringsender; //收件人 privateStringrecipients; //主题 privateStringtitle; //内容 privateStringcontents; //时间 privateStringtimes; //附件 privateStringupload; //邮件大小 privateintsizes; //邮件类型:1为新邮件,2为收件箱,3为草稿箱,4为发件箱,5为垃圾箱 privateinttypes; //状态:1为已读,0为未读 privateintstatus; publicintgetId(){ returnid; } publicvoidsetId(intid){ this.id=id; } publicStringgetSender(){ returnsender; } publicvoidsetSender(Stringsender){ this.sender=sender; } publicStringgetRecipients(){ returnrecipients; } publicvoidsetRecipients(Stringrecipients){ this.recipients=recipients; } publicStringgetTitle(){ returntitle; } publicvoidsetTitle(Stringtitle){ this.title=title; } publicStringgetContents(){ returncontents; } publicvoidsetContents(Stringcontents){ this.contents=contents; } publicStringgetTimes(){ returntimes; } publicvoidsetTimes(Stringtimes){ this.times=times; } publicStringgetUpload(){ returnupload; } publicvoidsetUpload(Stringupload){ this.upload=upload; } publicintgetSizes(){ returnsizes; } publicvoidsetSizes(intsizes){ this.sizes=sizes; } publicintgetTypes(){ returntypes; } publicvoidsetTypes(inttypes){ this.types=types; } publicintgetStatus(){ returnstatus; } publicvoidsetStatus(intstatus){ this.status=status; } } 2.UserDAO.java /** *查询收件箱中所有数据,分页显示 *@return */ publicList<UserMail>ListUserMail(intcount){ List<UserMail>list=newArrayList<UserMail>(); Connectionconn=DBManager.getConnection(); //types为状态,表示收件箱 Stringsql="selecttop10*fromusersmailwheretypes='2'and(idnotin(selecttop(10*(?-1))idfromusersmailwheretypes='2'))"; try{ PreparedStatementpst=conn.prepareStatement(sql); pst.setInt(1,count); ResultSetrs=pst.executeQuery(); while(rs.next()){ UserMailuser=newUserMail(); intid=rs.getInt("id"); intstatus=rs.getInt("status"); Stringuplo