資源簡介
JSP項目 投票系統 系統開發 數據庫開發 基于JSP開發的論壇系統

代碼片段和文件信息
package?spage;
import?java.sql.*;
public?class?ShowPage
{
private?String?str?=?““;
//顯示頁號為p的一頁(user)
public?String?printPage(ResultSet?rs?int?p?int?size)?
{
??str?=?““;
??//將訪問游標定位到頁號為p的頁要顯示的第一條記錄的位置
??try?{
?? for(int?k=0;k<(p-1)*size;k++)
rs.next();
??}
??catch(SQLException?e)?{???}
??for(int?iPage=1;?iPage<=size;?iPage++)?{
?????str?+=?printRow(rsiPagep);
?????try?{
?if(!rs.next())?break;
?????}
?????catch(Exception?e)?{???}
??}
??return?str;
}
//顯示單行記錄(user)
public?String?printRow(?ResultSet?rs?int?iint?p)?
{
String?temp?=?““;
try?{
int?id=rs.getInt(“userid“);
temp+=““;
temp+=““+rs.getString(“name“)+“ “;??
temp+=““+rs.getString(“sex“)+“ “;
temp+=““+rs.getString(“age“)+“ “;
int?grade=rs.getInt(“rank“);
temp+=““;
switch?(grade)
{
case?0:temp+=“普通用戶“;break;
case?1:temp+=“1區斑竹“;break;
case?2:temp+=“2區斑竹“;break;
case?3:temp+=“3區斑竹“;break;
case?4:temp+=“管理員“;break;
}
temp+=“ “;
temp+=““+rs.getString(“pubnum“)+“ “;
temp?+=?“修改 “;
temp?+=?“刪除 “;
????temp?+=?“ “;
}
catch(SQLException?e)?{???}
return?temp;
}
//顯示頁號為p的一頁(board)
public?String?artPrintPage(ResultSet?rs?int?p?int?sizeboolean?fboolean?isex)?
{
??str?=?““;
??//將訪問游標定位到頁號為p的頁要顯示的第一條記錄的位置
??try?{
?? for(int?k=0;k<(p-1)*size;k++)
rs.next();
??}
??catch(SQLException?e)?{???}
??for(int?iPage=1;?iPage<=size;?iPage++)?{
?????str?+=?artPrintRow(rsiPagepfisex);
?????try?{
?if(!rs.next())?break;
?????}
?????catch(Exception?e)?{???}
??}
??return?str;
}
//顯示單行記錄(board)
public?String?artPrintRow(?ResultSet?rs?int?iint?pboolean?fboolean?isex)?
{
String?temp?=?““;
try?{
int?id=rs.getInt(“id“);
temp+=““;
boolean?ex=rs.getBoolean(“excellent“);
if(ex)
temp+=“![]()
“;??
else
temp+=“![]()
“;??
temp+=““+rs.getString(“title“)+“ “;??
temp+=“vascript:detailwin(“+rs.getString(“userid“)+“)‘>“+rs.getString(“name“)+“ “;
temp+=““+rs.getString(“reNum“)+“ “;
temp+=““+rs.getString(“pubtime“)+“ “;
if(f)
{
if(isex)
temp?+=?“加精 “;
else
temp?+=?“從精華中刪去 “;
}
????temp?+=?“ “;
}
catch(SQLException?e)?{???}
return?temp;
}
//顯示頁號為p的一頁(article)
public?String?detailPage(ResultSet?rs?int?p?int?sizeString?logidboolean?f)?
{
??str?=?““;
??//將訪問游標定位到頁號為p的頁要顯示的第一條記錄的位置
??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????740??2005-08-03?13:43??論壇系統\forum\addex.jsp
?????文件???????1797??2005-07-25?18:08??論壇系統\forum\adduser.jsp
?????文件???????4827??2005-08-03?13:13??論壇系統\forum\board.jsp
?????文件?????????86??2005-07-25?18:06??論壇系統\forum\check.jsp
?????文件????????129??2005-07-25?18:06??論壇系統\forum\checkadmin.jsp
?????文件???????1739??2005-07-25?18:09??論壇系統\forum\dealdelete.jsp
?????文件???????1365??2005-07-28?15:41??論壇系統\forum\dealdeleteuser.jsp
?????文件???????1468??2005-07-28?19:30??論壇系統\forum\dealpost.jsp
?????文件???????1646??2005-07-25?18:11??論壇系統\forum\dealupdate.jsp
?????文件???????1870??2005-07-25?18:07??論壇系統\forum\dealupdateuser.jsp
?????文件????????717??2005-08-03?13:44??論壇系統\forum\delex.jsp
?????文件???????3147??2005-08-03?13:33??論壇系統\forum\detail.jsp
?????文件???????2237??2005-08-01?16:22??論壇系統\forum\detailuser.jsp
?????文件????????170??2005-07-24?17:16??論壇系統\forum\error.jsp
?????文件???????4433??2005-08-03?13:27??論壇系統\forum\excellent.jsp
?????文件???????2752??2005-08-03?13:47??論壇系統\forum\forum.ldb
?????文件?????622592??2005-08-03?13:45??論壇系統\forum\forum.mdb
?????文件???????3809??2005-07-28?18:55??論壇系統\forum\home.jsp
?????文件????????861??2005-07-23?17:16??論壇系統\forum\login.jsp
?????文件?????????68??2005-07-21?14:39??論壇系統\forum\logout.jsp
?????文件???????3260??2005-08-03?13:33??論壇系統\forum\manage.jsp
?????文件???????3644??2005-07-26?20:22??論壇系統\forum\post.jsp
?????文件???????3010??2005-07-26?20:28??論壇系統\forum\register.jsp
?????文件????????506??2005-07-23?16:54??論壇系統\forum\st
?????文件???????1287??2005-07-27?13:15??論壇系統\forum\top.jsp
?????文件????????694??2005-07-26?12:55??論壇系統\forum\toparticle.jsp
?????文件???????4851??2005-07-24?18:01??論壇系統\forum\update.jsp
?????文件???????5078??2005-07-31?13:44??論壇系統\forum\updateuser.jsp
?????文件????????932??2005-07-27?15:40??論壇系統\forum\verify.jsp
?????文件????????277??2005-01-28?18:51??論壇系統\forum\WEB-INF\web.xm
............此處省略105個文件信息
評論
共有 條評論