Showing query results in multiple pages

Hello,
          I have a requirement where
          Inside JSP,
          1. I query a database.
          2. Get the result set.
          3. Now I need to display 20 results at a time (with [next20] and [prev20] links).
          4. Can any one give me some hint about this.
          Thanks,
          Naga
          

Did you look at http://java.sun.com/j2ee/blueprints/design_patterns/page_by_page_iterator/index.html ?
          Naga <[email protected]> wrote:
          > Hello,
          > I have a requirement where
          > Inside JSP,
          > 1. I query a database.
          > 2. Get the result set.
          > 3. Now I need to display 20 results at a time (with [next20] and [prev20] links).
          > 4. Can any one give me some hint about this.
          > Thanks,
          > Naga
          Dimitri
          

Similar Messages

  • Showing search results in multiple pages

    Hi,
    i want some logic for following requirement..I have a jsp page in that i will enter empno,empdept..and i will click on search button..when user clicks on search we will get some search results..i want to display these results based on maximum rowsize mentioned bye the use..if he selects 10..it should display 10 per page and a next button like java forum..if he clicks on next it should display the next results.like wise untill endof resultset..and these results should be displayed on the same page og jsp.
    plz give me some logic for these req..
    regards,
    sam

    This has been asked several times in the past couple of months. Search for "Paging" on these forums. Example:
    JSTL or plain Java - http://forum.java.sun.com/thread.jsp?forum=45&thread=539250
    Struts - http://forum.java.sun.com/thread.jsp?thread=536490&forum=45
    And others suggest grabbing only the number of records from the DB that you will display.

  • How to display the query results in several pages?.

    Hi,
    i want to display the query results in several pages. for example my query result found 50 matches, now i want to print 20 per pages next 20 will be in next pages. iam using only jsp & mysql.
    Regards
    Chinna

    Hi, what you are trying accomplish is known as pagination.
    You could use JSTL tags with Custom Tags to perform pagination in your JSP pages.
    evnafets showed me DisplayTags , you could use those as well http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html
    Here is one article on paging:
    http://www.javaworld.com/javaworld/jw-07-2004/jw-0726-pagination.html

  • Search criterias in one page, the query results in another page?

    Hi, can I put search criterias in one page, and get query results in another page?
    Need help
    Thanks in advance
    karman

    If you meant a situation like: Page 1 has some items and page 2 has a report which refers page 1 itemsThen your report _query would fetch proper results provided the page 1 item values are available in the session_.
    That is, after submitting their values(using page submit,dynamic action,ajax etx) to session state , their values would be available in any page (anywhere in that session ) , until the page cache for the item page(page 1) is cleared.

  • SQL Developer v2.1.0.6 Build MAIN-63.73 doesn't show query results

    SQL Developer v2.1.0.6 Build MAIN-63.73 doesn't show query results for "select * from all_scheduler_jobs;" when I click on "Run Statement" icon at toolbar but when I click on "Run Script" the results appear.
    Is this a bug?
    In prior version this worked.

    This bug was fixed in SqlDev 2.1.1. You'll find this build on our homepage.
    -Raghu

  • How to display query result in seperated page.

    How to display query result in seperated page, if the results are very big (more than 5000 records) and there are so many concurrent users (about 500 - 1000 users).
    Are there any solutions or frameworks?
    Plese help me .........
    thanks,
    --bhasin

    Hi,
    How to display query result in seperated page?I think RowSet will be the better technology to use in this
    situation.For more information on this please visit http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.html
    which explains in detail about RowSets.
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support/

  • Show query results in new tabs - preference

    I am presently in Build MAIN-12.84.
    Setting this preference: "Show query results in new tabs" either on or off gives the same result when executing for instance 3 queries at once.
    1. execution 3 result tabs, 2. execution, 6 result tabs ....
    And that also happens even if I set the preference to OFF ! surely not the intended behaviour?
    best regards Inger

    Hi KK
    For this to work unit must be a characteristic that is stored in the infoprovider
    Try creating a structure in the rows with 3 RKF, drag in the unit characteristic a restrict to the following:
    1. Unit restricted to KG
    2. Unit restricted to LB
    3. Unit restricted to EA
    Then under the RKF include the material characteristic, this will give a break down of material by the above unit types.
    Then in the columns include quantity.
    Hope this helps
    Josh

  • Verity search results across multiple pages

    Hi, I am attempting to implement verity search on my website and am using the code below for the search, and search results page.
    Currently the results are limited to 5 as specified by the maxrows command. How can I implement a forward and back feature across multiple pages? (like google search results)
    Search:
    <cfparam name="form.params" default="">
    <cfparam name="target" default="searchVerity">
    <cfoutput>
    <form method="post" action="results1.cfm">
    <p>
    Enter your search term(s) using AND, OR, NOT and parens.
    Surround an exact phrase with quotes.
    </p>
    <input type="text" name="params" size="75" value="#form.params#">
    <br />
    <input type="submit" value="Search">
    </form>
    </cfoutput>
    Result Page:
    <cfparam name="form.params" default="">
    <cfparam name="target" default="searchVerity">
    <cfsearch
    name="foundResults"
    collection="search"
    criteria="#form.params#"
    contextPassages = "1"
    contextBytes = "300"
    maxrows = "5">
    <hr />
    <h3>Search Results</h3>
    This search returned a total of <cfoutput>#foundResults.recordCount#
        </cfoutput> results.
    <cfoutput query="foundResults">
    <hr />
    <p>
    File: <a href="#foundResults.URL#" target="_blank">#
        foundResults.title#</a> (score=#foundResults.score
        #)<br />
    Highlighted Summary: #foundResults.context#
    </p>
    </cfoutput>

    Hi All,
    Has anyone tried to implement the jsptags in Servlets?
    I am using Servlets and required a Search display like this. I have my results being retrieved from a class and I am trying to display these results in a table format.
    i.e.
    Customer c = new Customer();
    c.retrieveCustomers();
    then i iterate through the customers
    while(c.next){

  • How to display MySql query results in multiple columns?

    Hi, I know how to display PHP/MySq
    l query results in a single column, but I am really stuck at displa
    ying the results in multiple columns in DW CS4.
    Can anyone help me with a code example?. I am new to php/mysql. Thanks

    Are you asking how to pivot the results of the query? Do a search for horizontal looping. If that's not what you are asking, please provide more details.

  • Power Query website with multiple pages

    Hi There,
    Is there a way to use Power Query to extract data from a website that has multiple pages when the URL does not seem to have a page number parameter?
    See the bottom table (Past events) in this site:
    http://www.sqlsaturday.com/events.aspx
    There are multiple pages, but the link to each page is just something like: javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2','Page$2')
    Thanks in advance for your help
    Help Others! Don't forget to mark your thread as answered

    I have in the past delved down in to the AJAX URL syntax for refreshes done that way. It is often actually easier to consume such response formats in Power Query.

  • What's the easiest way to show query results?

    I have a button on the Business Partner form, and I want to show the results of a query when you push it.  What's the easiest way to show this data to the user?
    Am I going to have to create a new form and add a matrix to it?  There has to be an easier way.

    Hi Bryan,
    If the query is without parameter, you can activate the menu for this query, else I think the best way is a new form with a grid (much faster than matrix).
    Regards
    Ad

  • Showing db results in different pages

    How can I do to show a query's results that is too long (more than 200 rows) in more than one page (showing next, previous, first and last links)?
    I'm using a servlet that attends the request and then this servlet forward a jsp page with the results. This is the page that I want to show "paged"(showing for example 10 results out of 200, and then links to the previous and next)
    Thanks

    there are a lot of kinds to do it.
    One is to design your query adding two parameters , pageRow and offset.
    your query become for example with postgreSQL
    SELECT *
    FROM {TABLE_NAME}
    WHERE {conditions}
    LIMIT {pageRow}
    OFFSET offset
    Than when you click next button you must execute the same query incrementing
    offset by pageRow amount.

  • What is the best way to output query result in jsp page?

    I have several pages with 2-3 queries on each one.
    My jsp pages call a class that I've created, the class will create a connection with the db, execute the query and returns the ResultSet to the jsp page. Then I iterate the RS on the jsp page.
    Is there a better way of sending the data back to the jsp? I was thinking of .xml.

    Send it back as a java.util.List, or some other Collection. Then iterate through the collection. My preference is to make a Bean of the date that represents a Row on the ResultSet and put those in the List. Then when we get to the JSP, iterate the List to get the beans, and call get methods to get the values...
      /* In a method that traverses ResultSet and fills a List of  beans... */
      List data = new ArrayList();
      while(results.next())
        MyBean mb = new MyBean();
        mb.setProperty1(rs.getString(1)); //But give properties good names
        mb.setProperty2(rs.getString(2)); //Not 'Property1 and Property2
        data.add(mb);
      return data;If you are using JSTL you can do something like this:
      <c:set var="myBeans" value="${theDbObject.results}"/> //Assuming the above method was called 'getResults()'
      <table>
      <c:forEach var="mb" items="${myBeans}">
        <tr><td>${mb.property1}</td><td>${mb.property2}</td>...</tr>
      </c:forEach>
      </table>

  • Quiz variables show wrong result on multiple quiz attempts

    Hi everbody
    cp4: I have a quiz with certificate at the end of my project. On the certificate the result is shown with the help of the variable cpInfoPercentage. The user has a maximum of 3 attempts to pass the quiz. Now, when he needs more than one attempt, the variable shows the sum of the results from each attempt. The same is true for the variable cpQuizInfoPointssored.
    Has anyone made the same experience and knows a way arount it?
    Thanks for your help.
    Petra

    I'm just bumping this up because I am having a similar problem. cpInfoPercentage variable is not resetting on multiple quiz attempts, even though quiz results screen is showing correct score and pass/fail message. Is there a way to reset this variable, or some other workaround?  THanks.

  • Create Internal table with fields coming as query result of multiple tables

    Hi
    I want to create internal table with the fileds which come as a result of a select query from multiple tables

    My code is something like this. I need  the data from various fields of diff tables depending on the excel file. This data is then to be put in a internal table
    *& Report  Z_EXTC
    report  z_extc.
    type-pools : abap.
    parameter: objname(25) type c.
    data : idetails type abap_compdescr_tab,
           xdetails type abap_compdescr.
    data : ref_table_des type ref to cl_abap_structdescr.
    data: p_table type string.
    data:l_string type string,
         l_filename(200) type c,
         dy_line  type ref to data,
         xfc type lvc_s_fcat,
         ifc type lvc_t_fcat.
    types:begin of itab,
         tabname type dd03l-tabname,
         fieldname type dd03l-fieldname,
         end of itab.
    types:begin of atab,
          tabname type dd03l-tabname,
          cnt type string,
          end of atab.
    field-symbols: <dyn_table> type table,
                   <dyn_table1> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: dy_table type ref to data,
          dy_table1 type ref to data.
    data: itab1 type itab occurs 0 with header line.
    data atab1 type atab occurs 0 with header line.
    data frstrec type i value 0.
    data lastrec type i value 0.
    l_string = ''.
    call function 'GUI_UPLOAD'
      exporting
        filename                      = 'C:\excel_files\FIELDS_CC.TXT'
       filetype                      = 'TXT'
       has_field_separator           = 'X'       .
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    *Refresh itab1.
    loop at itab1.
      on change of: itab1-tabname.
        if lastrec = 1.
          move l_string to atab1-cnt.
       move itab1-tabname to atab1-tabname.
          append atab1.
          l_string = ''.
        endif.
        move itab1-tabname to atab1-tabname.
        frstrec = 1.
      endon.
      if frstrec = 1.
        concatenate l_string itab1-fieldname into l_string separated by
    space.
        lastrec = 1.
      endif.
    *write:/ itab1-tabname,40 itab1-fieldname.
    endloop.
    move l_string to atab1-cnt.
    append atab1.
    loop at atab1.
      write:/ atab1-tabname,5 atab1-cnt.
    endloop.

Maybe you are looking for

  • Version 9.3.3 Crashes

    There is a problem with Adobe Reader 9.3.3 which looks very similar to the previous 9.0 issue we had. Scenario is as follows: 1.       Update Adobe Reader to 9.3.3 2.       Open a PDF Form. 3.       Leave the Form. 6.       Approx 20 – 30 seconds del

  • Send a mail via ABAP program

    Hello Experts, I want to send mail via ABAP program with the following requirements : 1. Recipient is OUTLOOK email -id 2. Sender address has to be an external email-id 3. Send mail as CC and BCC also to other email-id. Is there any function module w

  • How to get a windows 8 64 iso?

    Just got a brand new MSI GE60 laptop with Windows 8 64 pre-installed; does anyone know how to get an ISO of Windows??  I know about the MSI Burn Recovery stuff, but that simply makes an image of your entire system, not simply windows 8 . 

  • Data Source 0ca_ts_is_1(Time sheet data (Approved)) config prob(urgent)

    Hi Experts, we need to extract the data from 0ca_ts_is_1(Time sheet data (Approved) but the problem is the no of records in the table <b>CATSDB</b> is <b>849</b> but in <b>RSA3</b> (0ca_ts_is_1) there are <b>500</b> records only. What could be the re

  • Regular expressions: the shorter the string, the longer the time to analyse

    Hello there ! I've got a problem with regular expressions... I analyse those two strings with the same regular expression, searching for the "message" word. The first of them, which is much longer than the other one, is instantly analysed... but the