Column list front paging: The data structure is the user-defined paging symbol. When you see this page symbol, you will automatically pagin. The last three replacement of the IP address is *. XML Version = "1.0" encoding = "GB2312"?> <% @ page contenttype = "text / vnd.wap.wml; charset = GB2312"%> <% @ include file = "/ common / link.inc"%> <% @ page import = "Java. Util. * "%> <% @ page import =" java.util.hashmap "%> <% @ include file =" toutf.jsp "%> <% @ page import =" java.sql. * "%> < % Statement Stmt = con.createstatement (ResultSet.Type_Scroll_Sensitive, ResultSet.concur_updatable); Statement Stmthref = con.createstatement (); ResultSet RS = null, RSHREF = NULL;
INT TYPE = 0, ID = 0, LOC_ID = 0; INT PARENTID = 0; String Name = "", PIC_PATH = "" "#"; string href = "#"; string sqlhref = "; string kindid = Request.getParameter ("ID");
INT TMPKINDID; if (kindid == null) {TMPKINDID = 0;} else {tmpkindid = integer.parseint (kindid);
String SQL = ""; // Father ID SQL = "SELECT PARENT_ID" "from life_kind where id =" TMPKINDID "ORDER BY LOC_ID"; RS = Stmt.executeQuery (SQL); if (rs.next ()) {ParentID = rs.Getint (1);} // Page TYPE = 6 map beginmap = new hashmap (); map endmap = new hashmap (); string tmpid = "0"; sql = "select LOC_ID" "from life_kind WHERE PARENT_ID = " TMPKINDID " AND type = 6 " " ORDER BY LOC_ID "; RS = Stmt.executeQuery (SQL); INT PNUM = 1; While (rs.next ()) {beginmap.put (" " PNUM, TMPID; tmpid = rs.getstring (1); endmap.put (" pnum, tmpid); PNUM ;} string testsql = SQL; // Current page number pnumnow string pnum1 = request.getParameter (" pnum " ); String SQLSUB = ""; int pnumnow = 0; if (pNum1! = Null) // Generates a panewater condition SQL statement {pnumnow = integer.parseint (pNum1);} else {pNum1 = "1"; pnumnow = 1 }} IF ((PNUM> 1) && (PNUMNOW == PNUM)) // There is a page symbol and is the last page {/ PNUM1 = " (PNUM - 1); SQLSUB = "and LOC_ID>" Integer.Parseint ((String) endmap.get (pnum1));} else if ((pnum> 1) && (pnumnow == pnum)) // Split symbol and is the first page {SQLSUB = "and LOC_ID <" Integer.Parseint ((String) BeginMap.get (PNUM1));} else if (pnum> 1) {sqlsub = "and loc_id>" integer.parseint (String) BeginMap. GET (PNUM1));
SQLSUB = "and LOC_ID <" Integer.Parseint ((String) endmap.get (pnum1));} SQL = "SELECT ID, NAME, TYPE, LOC_ID, PIC_PATH, LINK_URL, CREATE_DATE" "from Life_kind where parent_id = " TMPKINDID SQLSUB " ORDER BY LOC_ID "; RS = Stmt.executeQuery (SQL);%> <% while (rs.next )) {Pic_path = ""; id = rs.getinT (1); name = rs.getstring (2); type = rs.getint (3); LOC_ID = rs.getint (4); pic_path = rs.getstring 5); link_url = rs.getstring (6); if (pic_path! = Null) {pic_path = "";} Switch (Type ) {// 0 Sub-class Click to enter the subclass name list case 0: href = pic_path "" Name ""; Break; // 1 No children with title Click Category Name Enter Content Title List Page Case 1: HREF = PIC_PATH name " "; Break; // 2 There is no title Click Category Name into direct display Troubleshooting information about this Kind_ID. If this type is, you can only in the content table, the content table is not a title. Case 2: href = pic_path " Name " "; Break; // 3 Dynamic column link itself is a link to a dynamic column. The link address is deposited in Life_kind.Link_URL Case 3: href = pic_path "" Name ""; Break; // 4 itself is a description Store the log picture of this classification, it is a descriptive information, in the life_kind_desc table, Case 4: SQLHREF = "SELECT KIND_DESC from Life_kind_Desc Where Kind_ID = '" "'"; RSHREF = stmthref.executeQuery (SQLHREF); if (RSHREF.NEXT ()) {href = rshref.getstring (1);} Break; // 5 itself is a picture that does not store this classification log picture, itself image address inserts life_kind.pic_path case 5: href = pic_path; Break (// 6 page symbols can not store the log picture of this classification, the classification list program is judged, if you encounter a page symbol, automatically go to this page 6: href = "--------"; Break; default: HREF = ""; Break;}%> <% = HREF%>
<%}%> <% // page implementation // forward page IF (PNUM> 1) {if (PNUMNOW> 1) {OUT.PRINTLN ("" a> ");}}} // page number FOR (INT i = 1; i <= pnum; i ) {if (pnumnow == i) {OUT.Println (i);} else {Out.println "" i "");}} // Turn later IF (PNUM> 1) {i (pNumnow