How can i display 5,10,15... records @ a time from a table in a DB?

well, i have developed a JSP application that shows ALL the employees in a certain department... the problem is when the number of employees increase the jsp page bcomes very, VERY long...
how can i do this by showing at least 20 records at a time... also like other jsp pages that i see that they have page numbers in the page above to show the other records... like...
page 1 20 records...
page 2, another 20...
... so on and so forth...
please help...
:]

Don't loop through the whole result set at once, just show records 1 to n....where n is whatever value you think creates a nice sized page. If you cache the results you can then display n+1 to 2n when the user hits a "more" link at the bottom of the page...and so on.
btw...caching may not be the best way to store your data, depends on the size of the resultsset, you may want to re-run the query each time and/or optimise the query to only fetch back the n results you want each time.
J.

Similar Messages

  • How can I display de last items of a region from other page in Portal?

    I want to display de last five items (f.e.) included in a region (with attributes created) from other page. I've tried using custom search, but it also shows the attribute names, and I want show the attribute values (I don´t know how can I format these attributes).
    Thanks a lot.

    How can I display the last items of a region from other Oracle Portal page?

  • In alv , how can i  display message like 'NO records in the table'in spool

    When there are no any records , i have to display a message in spool like 'No records exist'.
    how can i do this?/
    Thanks,
    Suresh.

    hi check this..
    if the final internal table is empty then you will show like this..
    if not it_final[] is initial.
    call function reuse_alv_list_display.
    elseif.
    message s000 with 'no data available for the selection'.
    endif..
    regards,
    venkat

  • How can i display Value in Report which i select from Multiple select list

    Dear All,
    i am using multiple select List in form with report page.
    When i create new Entry with select Multiple value in Multiple Select List then in report Value display me in below format
    my SQL Query are
    select NAME D, CODE R from  COUNTRY_MAS WHERE ACTIVE_FLG ='Y' order by NAME
    AS:AI:AG:AM these are return value .i want to display NAME in report .
    How can i do this ?
    Thanks
    Edited by: Vedant on Apr 25, 2012 11:14 PM

    Short answer, use the apex_util.string_to_table to convert to a table; then you can either iterate through the table to generate a string of names, or accomplish the same with a bulk operation.
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_util.htm#CHDFEEJD
    Encapsulate all this within a pl/sql function.

  • How can I display the last items of a region from other Oracle Portal page?

    I want to display de last five items (f.e.) included in a region (with attributes created) from other page. I've tried using custom search, but it also shows the attribute names, and I want show the attribute values (I don´t know how can I format these attributes).
    Thanks a lot.

    create a stored procedure (f.e. in schema myschema create a stored proc named renderAsHTML)
    code for the procedure :
    PROCEDURE renderAsHTML(p_itemId varchar2,p_pageId varchar2,p_siteId varchar2) IS
        l_displayName  portal.wwsbr_all_items.display_name%type;
        l_name         portal.wwsbr_all_items.name%type;
        l_publishDate  varchar2(10);
        l_url varchar2(250);
    BEGIN
         -- Looking for item datas
         select display_name, name,   to_char(publish_date,'dd/mm/yyyy')
         into l_displayName,l_name, l_publishDate
         from portal.wwsbr_all_items
         where id =p_itemId and language=portal.wwctx_api.get_nls_language;
         -- getting the URL og the item
         l_url := portal.wwpob_page_util.get_page_url(p_pageId, p_siteId);
         -- HTML rendering
    htp.p('<.a href="'||l_url ||'/'|| l_name ||'">' ||  l_displayName ||'</.a><.br/>');
    htp.p('Published on ' || l_publishDate ');
    EXCEPTION
        WHEN others THEN
               htp.p('<.div>Somme error occured , code is ' || SQLCODE || '.</.div>');
    END renderAsHTML;
    please notice that I've added a dot in HTML tags to avoid this forum to interpret them
    note : make sure that you granted "execute" for the public user on teh procedure you've just created.
    go to item properties (navigator>shared objects>item types>modify the one you want
    go to tab3 (procedures)
    set the following options :
    type : PL/SQL
    call proc : myschema.renderAsHTML
    link text : render as HTML
    icon : keep blank
    select the "display proc results with the item" option
    pass the following parameters :
    attribute1 : item ID as p_itemId
    attribute1 : page ID as p_pageId
    attribute1 : pagegroup as p_siteId
    Now, in your custom search portlet, go to results rendering, remove all attributes and add the "associated function" attribute.
    Now, all the HTML generated by the stored proc will be rendered instead of the item.

  • How to insert a set of rows at a time from another table

    Hello!
    I have a table1 and table 2 - i want to insert a set of rows at a time from table1 to table 2. Then do a COMMIT. Then continue inserting another set of rows and so on.... say i want to insert into table 2 i million records at a time and then do a commit. then continue with the next 1 million and do a commit and so on..until there are no more records in table 1
    Any ideas please!!!!!!!!!!

    may be this will help
    declare
    cursor c1
    select * from table1
    i_counter binary_integer := 1;
    begin
    for c1_rec in c1
    insert into table2
    values(c1_rec.,..);
    if i_counter = 1000? then
    commit;
    i_counter = 1;
    end if;
    i_counter := i_counter+1;
    end loop
    end;

  • How can I display a list of records from a JSP to my Midlet ??

    Hi there !
    I'm new in J2ME. I have been strugling with this problem for weeks now. All I find on the net is some theory and is not helping me much. Here the deal
    I have created a Midlet that shoud display a certain list which is from the remote database. The list comes from a JSP file in the server. When I use the browser I can see the list.
    The problem comes when I have to take the same list and output it in my midlet file. Then finding the selected index of the selecte item of the same list and using it somewhere else.
    I would appreciate it if somone could help me !!
    My head is speaning now !!! If you want me to post my code so one could identidy the proble, I don't mind !! Help please !!

    Here is my Code !!
                 String url = "http://10.2.25.3:8080/CreateAppointment/doctorsList.jsp";
        String dateUrl = "http://10.2.25.3:8080/CreateAppointment/date.jsp";
       String myUsername,myPassword;
       // Custom declaration code starts here
       public CreateAppointment_GUI()
                //Creating a login Form
                loginScreen = new Form("Login");
                //Login form Textfields
                username = new TextField("Username:", null, 200, TextField.ANY);
                password = new TextField("Password:", "Initial text", 200, TextField.ANY|     TextField.PASSWORD);
                loginScreen.append(username);
                loginScreen.append(password);
                //Adding the commands
                loginScreen.addCommand(loginCommand);
                loginScreen.addCommand(cancelCommand);
                loginScreen.setCommandListener(this);
                loginScreen.setItemStateListener(this);
                // Creating my selection list
                String[] selectionList = { "1.Appointments", "2.Add New Patient", "3.Patient Details" };
                listSelectAction = new List("Select Action", List.IMPLICIT, selectionList, images);
                listSelectAction.addCommand(backCommand);
                listSelectAction.addCommand(nextCommand);
                listSelectAction.setCommandListener(this);
             public void startApp() throws MIDletStateChangeException
               display = Display.getDisplay(this);
               display.setCurrent(loginScreen);
            public void pauseApp()
            public void destroyApp(boolean unconditional) throws MIDletStateChangeException
                 notifyDestroyed();
            public void itemStateChanged(Item item)
       void getDoctors(String url) throws IOException {
                    HttpConnection connection = null;
            InputStream is = null;
            OutputStream os = null;
            StringBuffer stringBuffer = new StringBuffer();
            TextBox textBox = null;
            String newStr =null;
            String newStr2=null;
            Vector v = new Vector();
           try {
              connection = (HttpConnection)Connector.open(url);
              connection.setRequestMethod(HttpConnection.POST);
              //connection.setRequestProperty(String key, String value)
              connection.setRequestProperty("IF-Modified-Since","20 Jan 2001 16:19:14 GMT");
              connection.setRequestProperty("User-Agent","Profile/MIDP-2.0 Confirguration/CLDC-1.0");
              connection.setRequestProperty("Content-Language", "en-CA");
              connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
              os = connection.openOutputStream();
              is = connection.openInputStream();
              int ch;
              while ((ch = is.read()) != -1) {
                stringBuffer.append((char) ch);
                System.out.print((char)ch);
                   }//while
              newStr = stringBuffer.toString();
                    newStr2=newStr.trim();
                    int start = 0;
                    position = newStr2.indexOf("%", 0);
                    while ((position = newStr2.indexOf("%",start)) > -1) {
                      String aName = newStr2.substring(start,position);
                      v.addElement(aName); // store the substring
                      start = position + 1; // so the next time we start checking following the space
              String[] theNames = new String[v.size()]; // create an array big enough to store the strings
              v.copyInto(theNames); // Now theNames is a String array with the list of names
               // now we can create a List using this array:
               listDoctors = new List("Select Doctor", List.IMPLICIT, theNames,null);
               listDoctors.addCommand(backCommand);
               listDoctors.addCommand(nextCommand);
               listDoctors.setCommandListener(this);
          } //try
           finally {
               if(is!= null) {
                  is.close();
               } //if
               if(os != null) {
                  os.close();
               }//if
               if(connection != null) {
                  connection.close();
               }//if
            }//final
         display.setCurrent(listDoctors);
        } //invoke
    public void commandAction(Command c, Displayable d)
                     if (c == loginCommand)
                      myUsername = username.getString();
                      myPassword = password.getString();
                         Thread thread = new Thread() {
                               public void run() {
                                   try {
                                      getDoctors(url);
                                      display.setCurrent(listSelectAction);
                                   }// Try
                                   catch (IOException ioe) {
                                      ioe.printStackTrace();
                                   }// catch
                               }// Public void
                         };//Thread
                          thread.start();
                     else if (c == cancelCommand && d == listSelectAction)
                     else if (c == nextCommand && d == listSelectAction)
                        int selectedAction = listSelectAction.getSelectedIndex();
                            Alert displayNewText =
                            new Alert("Selected","Screens are still being developed", null, AlertType.INFO);
                                displayNewText.setTimeout(1000);
                         if (selectedAction == 0)
                             Thread thread = new Thread() {
                               public void run() {
                                   try {
                                      getDoctors(url);
                                      display.setCurrent(listSelectAction);
                                   }// Try
                                   catch (IOException ioe) {
                                      ioe.printStackTrace();
                                   }// catch
                               }// Public void
                         };//Thread
                          thread.start();
                         if (selectedAction == 1)
                               display.setCurrent(displayNewText);
                         if (selectedAction == 2)
                               display.setCurrent(displayNewText);
                     }//Else
                     else if (c == backCommand && d == listDoctors)
                          display.setCurrent(listSelectAction);
                     else if (c == nextCommand && d == listDoctors)
                             Thread thread1 = new Thread() {
                               public void run() {
                                   try {
                                      getDate(dateUrl);
                                      display.setCurrent(listDate);
                                   }// Try
                                   catch (IOException ioe) {
                                      ioe.printStackTrace();
                                   }// catch
                               }// Public void
                         };//Thread
                          thread1.start();
                     else if (c == backCommand && d == listDate)
                          display.setCurrent(listDoctors);
    }That is my midlet !! Now here is the code for my JSP !!
                        <%@ page import="java.sql.*" %>
    <%@page import="java.util.*,java.text.*" %>
    <%
    String name="";
    String id = "";
    String connectionURL = "jdbc:microsoft:sqlserver://10.2.25.223;DatabaseName=NDOH_PAAB";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    %>
    <%
    try
                            Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
                    catch (Exception ex)
                            out.println(ex.toString());
                            connection = DriverManager.getConnection(connectionURL,"remotepaab_user","mohwiti2004");
                            statement = connection.createStatement();
                            String mysql ="SELECT * from physicians";
                            //out.println(mysql);
                            rs = statement.executeQuery(mysql);
    %>
    <%
          while (rs.next()) {
                 name= rs.getString("name");
                 id = rs.getString("id");
                 out.print(name + "%");
                 out.print(id + "%");
    %>
    <%
    %>
    <% rs.close(); %>In the JSP the name variable is the one that has my List. The problem is how do I say in my Midlet = display the list contained in name. Or in id. I need to use both of them "name + id". the id I will use to find out which name a user ha selected !! Not sure how !!!
    Any help would be appreciated !! Thanks !!

  • How can I display more than one record with result set meta data?

    Hi,
    My code:
        ArrayList<String> resultList = new ArrayList<String>();
        rs=ps.executeQuery();      
        ResultSetMetaData rsmd = rs.getMetaData();      
        while(rs.next()){      
         for(int k=1;k<=rsmd.getColumnCount();k++){            
            resultList.add(rs.getString(k)); 
        ps.close();       
        }catch(Exception e){                                 
        e.printStackTrace();      
        return resultList;
        public String test(ArrayList result)throws Exception{ 
        String data=         
            "<tr>"+ 
            "<td class=normalFont>"+result.get(0)+"</td>"+ 
            "<td class=normalFont>"+result.get(1)+"</td>"+ 
            "</tr>"; 
        return data; 
        }  All the things are wroking but the problem is that ArrayList is displaying just one record whereas I have more than 20 records to display. I tried with loop like: i<result.size(); and result.get(i) then its throwing exception
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 I stuck here for the last more than 2 days. Please help me
    Best regards

    Raakh wrote:
    Still waiting .....I would have answered much earlier, but when I saw this little bit of impatience, I decided to delay answering for a while.
    ArrayList<String> list = new ArrayList<String>();
    list.add("abc");
    list.add("def");
    list.add("ghi");
    System.out.println(list.get(0));
    abc
    System.out.println(list.get(1));
    def
    System.out.printnln(list);
    [abc, def, ghi]That list has 3 items. Each one is a String.
    But here is what you appear to be doing:
    select * from person
    +-----+-------------+-------------+--------+
    | id  |  first name |  last name  | height |
    +-----+-------------+-------------+--------+
    |   1 | Joe         | Smith       | 180    |
    +-----+-------------+-------------+--------+
    |   2 | Mary        | Jones       | 144    |
    +-----+-------------+-------------+--------+
    for each row in ResultSet {
      for each column in ResultSet {
        list.add(that element);
    // which becomes
    list.add(1);
    list.add("Joe");
    list.add("Smith");
    list.add(180);
    list.add(2);
    list.add("Mary");
    list.add("Jones");
    list.add(144);
    System.out.println(list.get(0));
    1
    System.out.println(list.get(1));
    Joe
    System.out.printlN(list);
    [1, Joe, Smith, 180, 2, Mary, Jones, 144]That list has 8 items. Some of them are Strings and some of them are Integers. I would assume that, for this sample case, you would want a list with 2 items, both of which are Person objects. However, it really isn't clear from your posts what you are trying to do or what difficulty you're having, so I'm just guessing.

  • How can I display my bookmarks onscreen at all times as in IE?

    IE allow the bookmark list to be displayed at all times on the left side of the screen. I find this very handy as it eliminates the many additional clicks needed in FF to track down a desired bookmark.

    You can open the bookmarks in the sidebar via View > Sidebar Bookmarks
    Press F10 or press and hold the Alt key down to bring up the "Menu Bar" temporarily.
    You can also find a toolbar button in the palette to open the bookmarks sidebar (star without the drop marker) and drag the button on a toolbar.
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"
    * http://kb.mozillazine.org/Toolbar_customization

  • How can I display a avi-file while acquiring data from a DAQ-CARD at the same time

    While my system is acquiring analog data and controlling a motor, I want to display a avi-film (preferably in full-screen, so that the LabView GUI disapears during this process). Are there any VI's to open external players? May I face some problems to lose samples, due to the calling of external players?

    mhi wrote in message news:<[email protected]>...
    > I've already found this example, but it doesn't work with the latest
    > media-player. Anyhow, thank you for your answer!
    you can also try out this free vi from my website:
    http://www.geocities.com/irene_he/FunStuff.html
    Irene

  • How can i insert more than one record a time in a JSP page?

    Hi experts,
    I'm working with JDeveloper version 3.2 application server 9i.
    I want to insert more than 1 record using a jsp page and then perform a commit at the end.
    do you can help me with this problem/challenge?
    Thank you,
    Regards,
    Mario

    statement.executeBatch() maybe?

  • How can I turn off the "Show All" navigation option from af:table?

    I would like to hide the "Show All" option from the navigation menu of af:table. Any clues/thoughts on how to do that ?
    Please help !
    Thanks a lot
    Message was edited by:
    samsam
    Message was edited by:
    samsam

    In Vista you can set the volume and mute setting for each application separately in the volume mixer.
    You can click the Volume icon on the Windows Taskbar near the clock and click the Mixer link at the bottom to open the mixer.<br />
    You can adjust the volume level for each application in that window.<br />
    You will only see the Firefox program in the Mixer if you are on a website that plays sound.

  • Search help - Display only 500 entries at one time from Internal Table

    Hi,
    I have an internal table with 1000000 entries. And when I use F4IF_INT_TABLE_VALUE_REQUEST function module to display the search help with internal table, it gives me dump. Can somebody help me - how to display limited values when we process search help?
    Thanks,
    Sheel

    Hi Sheel
    u have a variable callcontrol-maxrecords in search help exit to limit the number of records.. check my weblog for more help: https://wiki.sdn.sap.com/wiki/x/du0

  • How can i display recent update/delete/insert records in form

    Hai !!!!
    i am new for forms,.......any body tell me, how can i display recent no of records updated or no of records deleted or no of records are inserted in a form. these records count are display in display items....give me detail explination......
    Subbu.....

    the easiest way is copy and paste the oracle-forms example from the OU.
    You need form-level-trigger ON-ERROR + ON-MESSAGE, POST-INSERT, POST-UPDATE, POST-DELETE, three global variables and a procedure:
    ON-ERROR
    handle_message( error_code, 'ERROR: ' || ERROR_TYPE || '-' || TO_CHAR(ERROR_CODE) ||': '|| ERROR_TEXT );
    ON-MESSAGE
    handle_message( message_code, MESSAGE_TYPE || '-' || TO_CHAR(MESSAGE_CODE) || ': ' || MESSAGE_TEXT );
    PROCEDURE handle_message( message_number IN NUMBER, message_line IN VARCHAR2 ) IS
    BEGIN
        IF message_number IN ( 40400, 40406, 40407 )
        THEN
          DEFAULT_VALUE( '0', 'GLOBAL.insert' );
          DEFAULT_VALUE( '0', 'GLOBAL.update' );
          DEFAULT_VALUE( '0', 'GLOBAL.delete' );
          MESSAGE('Save Ok: ' ||
            :GLOBAL.insert || ' records inserted, ' ||
           :GLOBAL.update || ' records updated, ' ||
           :GLOBAL.delete || ' records deleted !!!' );
          ERASE('GLOBAL.insert'); 
          ERASE('GLOBAL.update');
          ERASE('GLOBAL.delete');
        ELSE
             MESSAGE(message_line );
              END IF;
    END;
    POST-INSERT
    DEFAULT_VALUE('0', 'GLOBAL.insert');
    :GLOBAL.insert := TO_CHAR( TO_NUMBER( :GLOBAL.insert ) + 1 );
    POST-UPDATE
    DEFAULT_VALUE('0', 'GLOBAL.update');
    :GLOBAL.update := TO_CHAR( TO_NUMBER( :GLOBAL.update ) + 1 );
    POST-DELETE
    DEFAULT_VALUE('0', 'GLOBAL.delete');
    :GLOBAL.delete := TO_CHAR( TO_NUMBER( :GLOBAL.delete ) + 1 );try it
    Gerd

  • How can I display the rows into columns.

    How can I display the rows into columns. I mean
    Create table STYLE_M
    (Master varchar2(10), child varchar2(10));
    Insert itno style_m
    ('MASTER1','CHILD1');
    Insert itno style_m
    ('MASTER2','CHILD1');
    Insert itno style_m
    ('MASTER2','CHILD2');
    Insert itno style_m
    ('MASTER3','CHILD1');
    Insert itno style_m
    ('MASTER3','CHILD2');
    Insert itno style_m
    ('MASTER3','CHILD3');
    Note : The Master may have any number of childs.
    I want to display like this..
    Master child1, child2, child3, .......(dynamic)
    MASTER1 CHILD1
    MASTER2 CHILD1 CHILD2
    MASTER3 CHILD1 CHILD2 CHILD3
    Sorry for disturbing you. Please hlp me out if you have any slution.
    Thanks alot.
    Ram Dontineni

    Here's a straight SQL "non-dynamic" approach.
    This would be used if you knew the amount of children.
    SELECT
         master,
         MAX(DECODE(r, 1, child, NULL)) || ' ' || MAX(DECODE(r, 2, child, NULL)) || ' ' || MAX(DECODE(r, 3, child, NULL)) children
    FROM
         SELECT
              master,
              child,
              ROW_NUMBER() OVER(PARTITION BY master ORDER BY child) r
         FROM
              style_m
    GROUP BY
         master
    MASTER     CHILDREN                        
    MASTER1    CHILD1                          
    MASTER2    CHILD1 CHILD2                   
    MASTER3    CHILD1 CHILD2 CHILD3             Since you said that the number of children can vary, I incorporated the same logic into a dynamic query.
    SET AUTOPRINT ON
    VAR x REFCURSOR
    DECLARE
            v_sql           VARCHAR2(1000) := 'SELECT master, ';
            v_group_by      VARCHAR2(200)  := 'FROM (SELECT master, child,  ROW_NUMBER() OVER(PARTITION BY master ORDER BY child) r FROM style_m) GROUP BY master';
            v_count         PLS_INTEGER;
    BEGIN
            SELECT
                    MAX(COUNT(*))
            INTO    v_count
            FROM
                    style_m
            GROUP BY
                    master;
            FOR i IN 1..v_count
            LOOP
                    v_sql := v_sql || 'MAX(DECODE(r, ' || i || ', child, NULL))' || ' || '' '' || ';
            END LOOP;
                    v_sql := RTRIM(v_sql, ' || '' '' ||') ||' children ' || v_group_by;
                    OPEN :x FOR v_sql;
    END;
    PL/SQL procedure successfully completed.
    MASTER     CHILDREN
    MASTER1    CHILD1
    MASTER2    CHILD1 CHILD2
    MASTER3    CHILD1 CHILD2 CHILD3I'll point your other thread to this one.

Maybe you are looking for

  • USB Drive Connected to Airport Extreme:  I can see, but can't access

    Connected one printer and two USB hard drives through USB hub to Extreme. Printer works ok. Both Drives are visible in Finder, but won't show files. Tried to copy files through Finder to each USB drive and got an "Error Code 8058". Tested each drive

  • Request for - Folders for Play Lists      (GUI improvement)

    This is a serious request for Apple to make one simple improvement on it's iTunes user interface: Please give us the ability to make folders of play lists. Readers: Please reply to this post to let our friends at Apple know if you think this would be

  • CSMARS Ports B/W GC and LC

    Does anyone know all of the necessary ports to open between the GC and LC? I found a Cisco doc that says this communication is on 8444, but my Dashboard on my GC is not updating with the traffic from the LC. I can see the Hotspot Graphs of each zone

  • Cannot add mailbox database copy to DR site - .edb file not getting created

    I have a DR site setup that I want copies of 4 of my mailbox databases.  3 of the mailbox databases copied over successfully but the last and largest one which is really not that large 69Gbs keeps failing when i Update the database copy.  Seems to no

  • Short Dump - EXSORT_NOT_ENOUGH_MEMORY in ACT_UPG

    Hello Experts, I am in the process of Upgrading ECC6 EHP3 to EHP4. Upgrade is stalled in phase  ACT_UPG phase for last almost 24 hours now. I posted a thread about that [EHP4 upgrade stucl in MAIN_SHDRUN/ACT_UPG; Now my phase got an error EXSORT_NOT_