Detailed JSP Plugs (Oracle + JSP + Apache)

xiaoxiao2021-03-06  101

From: www.cnjsp.net Whwgz Aprove 11, 2002 21:47 I have a detailed JSP page program! (Oracle JSP Apache) One Premise Hope The latest record is created in the beginning of the table: table: myTable query: create or replace view as myTable_View from myTable ORDER BY ID DESC, preferably use serial number Create Sequence MyTable_sequence Automatically add your record ID number

Second source program <% string sconn = "Your connection" Class.Forname ("Oracle.jdbc.driver.Driver.Oracledriver); connection conn = drivermanager.getConnection (Sconn," Your User Name "," Patern "; Statement stmt = conn.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); Statement stmtcount = conn.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);

ResultSet RS = Stmt.executeQuery ("Select * from myTable_View"); string sqlcount = "select count (*) from myTable_view"; ResultSet Rscount = Stmtcount.executeQuery (Sqlcount);

INT PageSize = Your per page displays a record number; int RowCount = 0; // Total record number while (RSCount Int pagecount; // Total number INT CURRPAGE; // Current page String strpage; strPage = request.getParameter ("Page"); if (strpage == null) {currpage = 1;} else {currpage = integer.parseint (strpage); if (currpage <1) currpage = 1;} PageSize-1) / pageSize; if (currpage> pagecount) currpage = pagecount;

INT since = (currpage-1) * Pagesize; int N = 0; rs.absolute (thepage 1); While (n <(pagesize) &&! r%> <% rs.close (); rscount.close () Stmt.close (); stmtcount.close (); conn.close ();%>

转载请注明原文地址:https://www.9cbs.com/read-124246.html

New Post(0)