java分页问题,请大家帮助一下,急呀!
public class HotelSearchResult extends AbstractTag {
protected String parse() {
String root=(String) this.getRequestPara().get(StrongIPP.STRONGIPP_WEBAPP_CONTEXTPATH);
StringBuffer sql=new StringBuffer();
StringBuffer msql=new StringBuffer();
String showmax="10";
String group=(String)this.requestPara.get("group");//宾馆星级
String area=(String)this.requestPara.get("city");//区域
String name=(String)this.requestPara.get("hotelname");//宾馆名称
StringBuffer returnHtml = new StringBuffer(1600);
JGDBConnection creatconn=new JGDBConnection();//创建数据库连接实例
Connection conn=creatconn.getConnection("dejdbc.properties");
sql.append("select t.en_id id,t.en_name name,d.item_name grade,t.img img,t.intraduce intr,t.address geograp from t_tour_enterprise t,t_tour_hotel h,t_tour_base_dataitem d where t.en_type=2 and h.en_id=t.en_id and d.item_id=h.hotel_level ");
if(group!=null&&!"null".equals(group)){
sql.append(" and {d.item_name}=")
.append(group);
}
if(name!=null&&!"null".equals(name)){
sql.append("and {t.en_name} like '%"+")" )
.append(name)
.append("\"%'");
}
// if(area!="00"){
// sql.append("and {d.item_name}=")
// .append(area);
// }
sql.append(" and rownum <= ")
.append(showmax)
.append(" order by t.en_id desc");
try{
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery(sql.toString());
while(rs.next()){
returnHtml.append("<table width=\"97%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#99CC33\">")
.append("<tr>")
.append("<td class=\"jdbgfont2\"><strong>")
.append(rs.getString("name"))
.append("</strong></td>")
.append("<td> </td>")
.append("<td> </td>")
.append("</tr>")
.append("<tr bgcolor=\"#FBFFEC\">")
.append("<td class=\"jdbgfont3\">酒店等级:")
.append(rs.getString("grade"))
.append("</td>")
.append("<td class=\"jdbgfont3\"> </td>")
.append("<td colspan=\"2\" class=\"jdbgfont3\">地理位置:")
.append(rs.getString("geograp"))
.append("</td>")
.append("</tr>")
.append("<tr bgcolor=\"#FFFFFF\">")
.append("<td colspan=\"4\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">")
.append("<tr valign=\"top\">")
.append("<td width=\"15%\" align=\"center\">")
.append("<img src=\"")
.append("http://192.168.2.20:8081/newtour")
.append(rs.getString("img"))
.append("\" width=\"150\" height=\"120\" />")
.append(" <td width=\"85%\">");
Clob info=rs.getClob("intr");
int textLength=200;
if(info!=null ){
String secnicintro=info.getSubString(1, (int) info.length());
secnicintro=secnicintro.replaceAll("<.*?>", "");
int n=secnicintro.length();
if(n>t