Querys to 'Navigate' through records
Posted in 1998
Hi all, The JDBC drivers I am using don't have scrolling cursors :( to get the 'next', 'prev'...etc record, I have had to resort to some creative SQL statements...but they seem to execute slowly..too slowly. Here is an example method from the orders object // public method to get the previous record of this type public void prev() { ...//other search methods removed else { nav_id = navQuery("select id from "+tableName+" where id < "+db_id+" order by id DESC"); } if (nav_id !=0) load(nav_id); // } the id column is indexed but I think the 'order by id DESC' part of the statement takes the most time. is there a better way to do this type of search? Thanks, ~Scott -- ________________________________________ Scott Ahten Code Wrangler Silent ) Planet scott@stage22.com http://www.stage22.com