Pagination of resultset containing few hundreds results..

Hi,
In my table i want to display data which is coming from the database. The resultset contains a number of rows. On my jsp page i want to display 10 rows per page. I can display data on the page but it is not doing pagination of total result in resultset.
I am a new jsf user. And i dont know how to do this.
Can anybody help me please...
Thanks in advance....
Regards,

no, i want all rows to be printed on the page.
But see i have approx. one million rows, so i don't want put all those rows into an arraylist.
I dont know whether JSF has this feature or not, is there a way so that i simply return a ResultSet(which contains millions of rows) and it itself do the pagination for them.
Or is there any other way that you think will be appropriate for me.
Regards

Similar Messages

  • How to create a role which contains few query for the user

    Hi,
    I need a create a role in the security which should contain few custom BI queries and then assign the users to the role.
    Even I have to assign the vendor to their unique vendor number in the security perespective for the created BI Reports.
    Thanks!!

    Try this link  http://www.sapecc.com/bw_security/bw_security_newquery.htm

  • How to compile few hundreds of forms ?

    1 - i just installed "oracle application server forms and report services" for solaris v10
    2 - i have few hundreds of developer 2000 forms
    Q - How to mass compile all of these forms
    Regards
    Mohamed Hammed

    You will use the batch process as it was explained above, but I recommend you to revisit the Forms upgrade page on OTN before starting the process. There is also a white paper, explaining differences between 6i and 10g (or 9i) forms. As far as I know, you can not upgrade directly from D2K to 9i or 10g forms but need to upgrade to 6i forms and then 9i or 10g. Don't forget the menu's (if you have any custom ones). There are lots of obsolete functionality/features between the two versions (D2K and 9i/10g). You can find more on the Forms forum regarding this subject. Hope this proves useful.

  • Scanning (Into JPEG) of Plain Paper with few graphics results into multiple images on HP 3545

    Scanning (Into JPEG) of Plain Paper with few graphics results into multiple images.
    Whenever I scan a page which is almost a white paper, but has some graphics on it, then the Scanned Files is not a single, rather it becomes in multiple parts e.g. circle in one jpeg file, square in another jpeg file. However the scanning to PDF works fine. Please let me know if this is manufacturing defect or defect in the product I purchased. 

    This only happens if I scan plain paper with few graphics. But scan to jpeg is working fine if the page has multiple objects

  • Pagination or how to correctly display results

    hi all ! Im having a doubt on how to present some data in my webapp.
    The thing is that a have a 1 to N relation between objects. The way Im doing it now is that when I ask for a information I redirect to another page when a product can have several claims on it.
    The problem is that if I get for example N results the pages expands and repeats the information N times. Not good....
    Wich is the best way to present the information? Pagination? If so wich is the best source for examples or a library?
    Any ideas or suggestions are welcome.
    Thanks a lot!

    What about tabs? I have used those before to show a set of data related to a date but split over age bands, each tabl contained the data for an age band and clicking the tabs opens that set of data. Its pretty easy to do using css and divs and making the tabs clickable using javascript.

  • XML queries (EXISTSNODE, CONTAINS) giving inconsitance results

    Hi,
    I am querying data from a table that has xmltype datatype and getting inconsistant results with two different approaches. I would like to have the top 500 records for a "REGION". My first query uses CONTAINS with "HASPTH" and the second query uses the condition EXISTSNODE with XPATH value. The table has both the indexes CTXSYS.CTXXPATH and CTXSYS.CONTEXT
    Can somebody help me to understand why I am getting inconsistant results?
    The sample xmltype data would be like:
    <REC>
    <CUSTID>14590</CUSTID>
    <LNAME>McDonald</LNAME>
    <FNAME>Warren</FNAME>
    <REGION>Orlando</REGION>
    </REC>
    Here my 1st query with CONTAINS and "HASPATH"
    SELECT /*+ FIRST_ROWS */ a.xmldata.CUSTID TAG1, a.xmldata.LNAME TAG2,
    a.xmldata.FNAME TAG3
    FROM CR_XML a WHERE
    CONTAINS(sys_nc_rowinfo$,'(haspath (//REGION = "Orlando)"))',1)>0 and
    rownum <501 order by 1
    2nd query with EXISTSNODE:
    SELECT /*+ FIRST_ROWS */ a.xmldata.CUSTID TAG1, a.xmldata.LNAME TAG2,
    a.xmldata.FNAME TAG3
    FROM CR_XML a WHERE
    EXISTSNODE (sys_nc_rowinfo$,'/REC[REGION="Orlando"]')=1 and
    rownum <501 order by 1
    Thanks,
    Ravi

    Thanks. I had seen the note that the problem didn't happen if he didn't use a DataSource connection, but had taken that to be just more data about the problem, rather than his solution. I am surprised that you would have to use a deprecated class (or am I wrong about that?) in order to use XSU with object types. Was this issue perhaps really a version compatibility issue among XSU,JDBC driver and JDK? I'd like to find a way to use XSU to produce XML from an object view using a data source connection, but am stuck currently at the same spot the original poster was. Can you help with that,please?

  • Auto-open DHTML dropdowns containing highlighted search result?

    I have submitted the following feature request.
    Does anyone know of a script or other "trick" that will produce this result?
    When returning search results in published output, automatically open DHTML dropdowns containing the highlighted search term. Otherwise, users go to the listed page but cannot see the highlighted search term. There may be many dropdowns on a single page, resulting in some inconvenience for end-users of published output.

    Hi Willam
    I stand to be corrected on this, but won't that cause all drop-downs to expand for all topics? I understood the issue to be that only when a term was found inside a drop-down was when the expansion was desired. So perhaps a single page has ten drop downs and a searched term is found that occurs in one of the ten, only expand that drop-down do the term would be visible.
    AFAIK this isn't possible.
    As an aside, it always did strike me as odd that someone would go to all the trouble of inserting drop-downs and expands, only to later want them all presented by default when the topic was opened. Isn't the idea behind them to hide information until the user wishes to see it?
    Scratching head.... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Trouble Populating CachedRowSetImpl with a ResultSet Containing a CLOB

    Hi,
    I need to populate a CachedRowSetImpl with a ResultSet that contains a CLOB. I am using the Oracle thin jdbc driver (ojdbc14.jar) When I populate it however, I get an exception:
    java.sql.SQLException: Invalid precision value. Cannot be less than zero
    Here is my code snippet. I get the exception when I call dor_note_dataRowSet.populate(resultSet);
    javax.naming.Context ctx = null;
    DataSource ds = null;
    Connection conn = null;
    PreparedStatement ps1 = null;
    String sqlUpdate = null;
    ResultSet resultSet = null;
    try
    ctx = new javax.naming.InitialContext();
    ds = (DataSource)ctx.lookup("<private>");
    conn = ds.getConnection();
    sqlQuery = "SELECT " +
    "DOR_NOTE_DT, DOR_NOTE_TX " +
    "FROM DOR.DOR_NOTE_DATA " +
    "WHERE DOR_NOTE_CD='SECURITY' AND " +
    "TO_CHAR(DOR_Note_Dt, 'mm/dd/yyyy') = '" + strDate + "'";
    ps1 = conn.prepareStatement(sqlQuery);
    resultSet = ps1.executeQuery();
    dor_note_dataRowSet.populate(resultSet);
    ps1.close();
    conn.close();
    catch (Exception ex) {
    log("Error Description", ex);
    error("Failed to upload file :"+ex.getMessage());
    Thanks

    I figured out how to do it

  • Create pagination for table contain more than 2 PK

    Guys;
    Is there any way to use the wizard for creating FORM PAGINATION for tables having more than 2 PK??
    Regards;

    Hi dimitri;
    after the user login & start using this form thiswhat should happen to these 3 PKs:
    -1st PK will be a unique number for the questions.
    -2nd PK should be the ID for each survey ( created as global variable in Zero Page ).
    -3rd PK will be the division for this user (also created as a global variable in ZERO PAGE)..so this is the only field which will nt be changed while the user is logged..
    i tried to use the 1st 2 PKs...& set the last one to get a default value..it worked in the begining but gave me the 1st record for each Survey but my problem that i couldnt navigate to the 2nd record..& after that once i log out & relogin it willnt give me anything.
    Regards;
    ehammad

  • "fill down" from dell containing letter X results in succeeding letters

    If I use the letter X as a placeholder in a cell and want to fill cells in successive rows with the same letter, I get y in the next cell, z in the next, etc. How can I tell Numbers to duplicate X in the succeeding rows?

    It's explained in the Help, chapter Autofilling Table Cells
    select cell A1 and cell A2, both containing X
    then drag the circular handle to the bottom.
    Yvan KOENIG (from FRANCE mardi 17 juin 2008 20:57:00)

  • Retreival of the ResultSet containing aggregate functions

    Hello,
    I am trying to retreive the data from a database using count(*) funtion..
    Here ist he snippet of the code:
    p=cprepareStatement("select count(*) from emp where ename=? and epwd=?");
    p.setString(1,t1);
    p.setString(2,t2);
    r=p.executeQuery();
    r.next();
    st=r.getInt(1);
    c.commit();here, My doubt is if it takes the value correctly into st.???
    can you suggest any other way to capture the resultset of the aggregate functions?

    My guess is your code should work. For readability, I would prefer (not tested):
    p = cprepareStatement("select count(*) empCount from emp where ename = ? and epwd = ?");
    p.setString(1, t1);
    p.setString(2, t2);
    r = p.executeQuery();
    r.next();
    st = r.getInt("empCount");
    c.commit();

  • At least one of the input binary log files contain fewer than two data samples.

    Hi Guys,
    I encountered this error, when I stop the my defined collection set and try to see the related report in Performance Monitor. I searched on the Internet says that a fast start/stop man end without enough counter data being collected. However, it seems not
    the case in my scenario. I set the sample interval to 15 seconds (default) and run the collection set more than 1.5 days.
    By the way, I monitor the Windows Server 2008 SP1 server on a remote Windows 7 SP1, both of them are 64-bits. Only general performance counters are added such as CPU, DISK related. I am looking forward to your help. Thanks in advance.
    P.S. I forgot to say, I set up a same data collector on the local computer (Windows 7 box), this does not happen. So, I believe I must has some configuration issues for remote monitor.
    Please mark replies as helpful or answers if they are helful, doing so can help others encountering the similar issue.

    Hi,
    It works locally but  not remotely. I monitor Windows Server 2008 R2 SP1 (Enterprise 64-bit) remotely on Windows 7 SP1 (Ultimate, 64-bit), I start PerfMon using a domain account which is local administrator on both server boxes. I get a .cab files
    for each data collection set, size from 1KB to 3KB. The sample internal is default 15 seconds and I believe the data collection set was started for more than 15 seconds or even hours. Here are steps to reproduce this issue:
    On Win7 box, open performance monitor (PerfMon)
    Connect to the remote WinSrv box
    Create a data collection set, and add the following counters using default 15 seconds sample internal
     Processor(*)\% Privileged Time
     Processor(*)\% Processor Time 
    Save and Start data collection set
    After more than 15 seconds or even hours, I get the above error message.
    Thanks in advance.
    Please mark replies as helpful or answers if they are helful, doing so can help others encountering the similar issue.

  • Sloppy input LOV component : wait time almost half a minute

    I have one LOV on my jspx , contains few hundreds records - now don't tell me that's a large data set
    First time,it takes 8-9 seconds just to launch the LOV and another 19 seconds just to return selected value to the input LOV
    This is ridiculous, you think customer is going to wait for 27-28 seconds just to do this
    Second Time, popup takes 2 seconds to launch and 10 seconds to return value (little better)
    JDev 11.1.1.2.0 , same behavior with input Combo Box LOV , selectOneChoice is useless , since it gives you integer index values in valueChangeListener
    I am running this locally with integrated weblogic server, now imaging using this jspx all the time with 500 users on a production server
    Once you set Query Limit to 10 : it takes 2 seconds to load LOV and 2 seconds to return value. quite impressive
    hmmm.... well, now the scrollbar inside looks big enough that you have very few rows, even though you have a quite large data set, and as you scroll it fetches data , so now you have to wait every time when you scroll and also sacrifice UI usability - good way to load balance
    Edited by: user626222 on Sep 1, 2010 7:11 AM
    Edited by: user626222 on Sep 1, 2010 7:37 AM
    Edited by: user626222 on Sep 1, 2010 7:39 AM

    Well, I'm guessing that the LOV should go ahead and fetch all of the rows, so if I were you, I'd try "All at Once" for the setting and a larger number for the batch size; how large is a tradeoff between performance (DB round trips) and memory (buffer needed). As you said, the answer is "it depends" - perhaps try setting it as large as, I dunno, 500, and see what happens to performance and memory used. If you set it all the way up to 1300, it will be 1 round trip, but will need a large buffer.
    Sorry I cannot be more specific, but you will have to do some testing to work out the "best" settings for you. Using -Djbo.debugoutput=console or -Djbo.debugoutput=adflogger will spit out all kinds of diagnostic information so you can see the query being executed and fetched, together with all kinds of other good information.
    John

  • Problem with store ResultSet and show result in table

    Hi, I'm kind of new in ADF, I need to store ResultSet and show result in table-component. I have two problems:
    1) I get my ResultSet by calling callStoredProcedure(...) and this returns actually ref_cursor as ResultSet.
    When I try to println() contains of this result set in this method - it works OK (commented part),
    but when I want to println() somewhere else (eg. in retrieveRefCursor() method) it doesn't work.
    The problem is that the scrollability of the ResultSet is lost - it becomes a TYPE_FORWARD_ONLY ResultSet.
    Is there any way to store data from ref_cursor for a long time?
    2) My second problem is "store any result set and show this data in table". I have tried use method storeNewResultSet() but
    without result (table contains only "No rows yet" and everything seems to be OK - no exception, no warning, no error...).
    I have tried to call this method with ResultSet from select on dbs (without resultSet as ref_cursor ) - no result with createRowFromResultSet(),
    storeNewResultSet(), setUserDataForCollection()...
    I've tried a lot of ways to do this, but it doesn't work. I really don't know how to make it so it can work.
    Thanks for your help.
    ADF BC, JDev 11.1.1.0
    This is my code from ViewObjectImpl
    package tp.model ;
    import com.sun.jmx.mbeanserver.MetaData ;
    import java.sql.CallableStatement ;
    import java.sql.Connection ;
    import java.sql.PreparedStatement ;
    import java.sql.ResultSet ;
    import java.sql.ResultSetMetaData ;
    import java.sql.SQLException ;
    import java.sql.Statement ;
    import java.sql.Types ;
    import oracle.jbo.JboException ;
    import oracle.jbo.server.SQLBuilder ;
    import oracle.jbo.server.ViewObjectImpl ;
    import oracle.jbo.server.ViewRowImpl ;
    import oracle.jbo.server.ViewRowSetImpl ;
    import oracle.jdbc.OracleCallableStatement ;
    import oracle.jdbc.OracleConnection ;
    import oracle.jdbc.OracleTypes ;
    public class Profiles1ViewImpl extends ViewObjectImpl {
        private static final String SQL_STM = "begin Pkg_profile.get_profile_list(?,?,?,?);end;" ;
        public Profiles1ViewImpl () {
        /* 0. */
        protected void create () {
            getViewDef ().setQuery ( null ) ;
            getViewDef ().setSelectClause ( null ) ;
            setQuery ( null ) ;
        public Connection getCurrentConnection () throws SQLException {
            // Note that we never execute this statement, so no commit really happens
            Connection conn = null ;
            PreparedStatement st = getDBTransaction ().createPreparedStatement ( "commit" , 1 ) ;
            conn = st.getConnection () ;
            st.close () ;
            return conn ;
        /* 1. */
        protected void executeQueryForCollection ( Object qc , Object[] params , int numUserParams ) {
            storeNewResultSet ( qc , retrieveRefCursor ( qc , params ) ) ;
            // callStoredProcedure ( qc , SQL_STM ) ;
            super.executeQueryForCollection ( qc , params , numUserParams ) ;
        /* 2. */
        private ResultSet retrieveRefCursor ( Object qc , Object[] params ) {
            ResultSet rs = null ;
            rs = callStoredProcedure ( qc , SQL_STM ) ;
            return rs ;
        /* 3. */
        public ResultSet callStoredProcedure ( Object qc , String stmt ) {
            CallableStatement st = null ;
            ResultSet refCurResultSet = null ;
            try {
                st = getDBTransaction ().createCallableStatement ( stmt , 0 ) ; // call 
                st.setObject ( 1 , 571 ) ; //set id of my record to 571
                st.registerOutParameter ( 2 , OracleTypes.CURSOR ) ; // my ref_cursor
                st.registerOutParameter ( 3 , Types.NUMERIC ) ;
                st.registerOutParameter ( 4 , Types.VARCHAR ) ;
                st.execute () ; //executeUpdate
                System.out.println ( "Numeric " + st.getObject ( 3 ) ) ;
                System.out.println ( "Varchar " + st.getObject ( 4 ) ) ;
                refCurResultSet = ( ResultSet ) st.getObject ( 2 ) ; //set Cursoru to ResultSet
                //   setUserDataForCollection(qc, refCurResultSet); //don't work
                //   createRowFromResultSet ( qc , refCurResultSet ) ; //don't work
                /* this works but only one-time call - so my resultSet(cursor) really have a data
                while ( refCurResultSet.next () ) {
                    String nameProfile = refCurResultSet.getString ( 2 ) ;
                    System.out.println ( "Name profile: " + nameProfile ) ;
                return refCurResultSet ;
            } catch ( SQLException e ) {
                System.out.println ( "sql ex " + e ) ;
                throw new JboException ( e ) ;
            } finally {
                if ( st != null ) {
                    try {
                        st.close () ; // 7. Close the statement
                    } catch ( SQLException e ) {
                        System.out.println ( "sql exx2 " + e ) ;
        /* 4. Store a new result set in the query-collection-private user-data context */
        private void storeNewResultSet ( Object qc , ResultSet rs ) {
            ResultSet existingRs = getResultSet ( qc ) ;
            // If this query collection is getting reused, close out any previous rowset
            if ( existingRs != null ) {
                try {
                   existingRs.close () ;
                } catch ( SQLException s ) {
                    System.out.println ( "sql err " + s ) ;
            setUserDataForCollection ( qc , rs ) ; //should store my result set
            hasNextForCollection ( qc ) ; // Prime the pump with the first row.
        /*  5. Retrieve the result set wrapper from the query-collection user-data      */
        private ResultSet getResultSet ( Object qc ) {
            return ( ResultSet ) getUserDataForCollection ( qc ) ;
        // createRowFromResultSet - overridden for custom java data source support - also doesn't work
       protected ViewRowImpl createRowFromResultSet ( Object qc , ResultSet resultSet ) {
            ViewRowImpl value = super.createRowFromResultSet ( qc , resultSet ) ;
            return value ;
    }

    Hi I have the same problem like you ...
    My SQL Definition:
    CREATE OR REPLACE TYPE RMSPRD.NB_TAB_STOREDATA is table of NB_STOREDATA_REC
    CREATE OR REPLACE TYPE RMSPRD.NB_STOREDATA_REC AS OBJECT (
       v_title            VARCHAR2(100),
       v_store            VARCHAR2(50),
       v_sales            NUMBER(20,4),
       v_cost             NUMBER(20,4),
       v_units            NUMBER(12,4),
       v_margin           NUMBER(6,2),
       v_ly_sales         NUMBER(20,4),
       v_ly_cost          NUMBER(20,4),
       v_ly_units         NUMBER(12,4),
       v_ly_margin        NUMBER(6,2),
       v_sales_variance   NUMBER(6,2)
    CREATE OR REPLACE PACKAGE RMSPRD.NB_SALES_DATA
    AS
    v_sales_format_tab   nb_tab_storedata;
    FUNCTION sales_data_by_format_gen (
          key_value         IN       VARCHAR2,
          l_to_date         IN       DATE DEFAULT SYSDATE-1,
          l_from_date       IN       DATE DEFAULT TRUNC (SYSDATE, 'YYYY')
          RETURN nb_tab_storedata;
    I have a PLSQL function .. that will return table ..
    when i use this in sql developer it is working fine....
    select * from table (NB_SALES_DATA.sales_data_by_format_gen('TSC',
                                        '05-Aug-2012',
                                        '01-Aug-2012') )
    it returning table format record.
    I am not able to call from VO object. ...
    Hope you can help me .. please tell me step by step process...
    protected Object callStoredFunction(int sqlReturnType, String stmt,
    Object[] bindVars) {
    System.out.println("--> 1");
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement("begin ? := " +"NB_SALES_DATA.sales_data_by_format_gen('TSC','05-Aug-2012','01-Aug-2012') ; end;", 0);
    System.out.println("--> 2");
    st.executeUpdate();
    System.out.println("--> 3");
    return st.getObject(1);
    catch (SQLException e) {
    e.printStackTrace();
    throw new JboException(e);

  • Updating DB through resultSet that contains a join query

    hy, is there any way to update a database by using ResultSet.updateXXX() when the result set
    contains the result of a join qeury ?
    guy.

    firstly thanx for answering.
    lets asssume that the query contains Attrbs from more the two tables.
    will the updatexxx() update the undelying data base related table ?

Maybe you are looking for