Database paging query

zhaozj2021-02-16  58

public class SQLServerPages extends Pages {public SQLServerPages () {} public ResultSet getRs (TranContext DBSQL, String pk) {String SQL = ""; ResultSet rs = null; try {SQL = this.getSQLString (pk); DBSQL.prepareStatement (SQL rs = dbsql.executeQuery (); return} Catch (Exception E) {return null;}} public string getsqlstring (string pk) {string SQL = this.ssql.tolowercase (sys.getlocale (); string Sqltotal = ""; string con1 = "SELECT"; string con2 = "from"; string con3 = "where"; string con4 = "order"; int I1 = sql.indexof (con1); int = sql.indexof Con2); Int i3 = SQL.indexof (con3); int i4 = SQL.INDEXOF (con4); string selectitem = "; string Tablename ="; string Cond = "; string orderrs =" "; selecttem = SQL .string (i1 6, i2); if (i3! = -1) {TABLENAME = SQL.SUBSTRING (i2 4, i3); if (i4! = -1) {COND = SQL.SUBSTRING (i3 5 , I4); Orders = Sql.substring (i4 5, sql.length ());} else {cond = SQL.SUBSTRING (i3 5, sql.length ());}} else {if (i4! = -1) {TABLENAME = SQL.s Ubstring (i2 4, i4); Orders = SQL.SUBSTRING (i4 5, sql.length ());} else {TABLENAME = SQL.SUBSTRING (i2 4, sql.length ());}} String_Orders = ""; if (i4! = -1) {_ORDERS = "Order" Orders;} // SQL = "SELECT TOP" ipage "*" TABLENAME "WHERE ID NOT IN (SELECT TOP" (SPAGE ipage) "ID from" TABLENAME " _ _ORDERS ") " _ORDERS; SQL =" SELECT TOP "

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

New Post(0)