Process ResultSet in batches

Hi,
I have a servlet that returns a JDBC ResultSet from the (Oracle) database, the ResultSet contrains about 100 records.
I want to show only 20 records per time, so I want to fetch 5x20 records, below the 20 records I want a forward or backward button.
How can this be built the best way ?
I am using java 1.5_02, Tomcat 5.5.9 on Fedora Core3 and Oracle 10g.
Thanks for your help/tips !
Coen

Are you sure? Isn't rownum always right? I thought tt's not a real column, it's generated by Oracle and always continuous.
One gotcha with rownum though: you need to add an "order by" clause in your query, otherwise you get the results in random order, possibly in different order every time you get a next page. -> Missing results, duplicated results on your pages. The "order by" means the database will sort the entire result set for every page. Keep performance in mind if the number of rows can be large. There is no really perfect, universally applicable, no-performance-worries way to do paging in SQL.

Similar Messages

  • QM In-Process Inspection for Batch Managed Material

    Hi,
    I have a issue related to UD of In-Process inspection for batch managed material. The production process is discrete manufacting for a cold rolling mill. A production order can have mutiple coils as per the production amount. To track the individual coil , batch management has ben activated. We have both in-process as well as inspection after production here.
    For inspection after production we are fine as we are doing partial confirmation after every coil and have separate inspection lot having different batch number.
    But for in-process I can have only one inspection lot for the production order (created on release of the production order). I can do the result recording but while trying to do UD u2013 it is asking for a batch number as the material is batch managed. W/o entering the batch number system is not allowing me to do the UD.
    Is there any solution/work around of this problem.
    -Regards
    ashim

    Hi Ashim,
    you raised a very good question? i am helpless here to execute same scenario,
    but i disussed with my QM guy here, he said, once the material is batch managed then it has to ahve batch in UD.
    so i discussed ur case, which is very much valid for heavy ind like cement and all,
    so what i suggest, u create a dummy batch in the UD for in process (no inventory posting)
    and at confimation give ur usual batch (if system propose the dummy batch which u give in the UD for inprocess, try to change there--- i hope it should allow)
    i would really like to here answer from u for this.
    try to do as suggested, and let me know the results.
    REgards,
    Pravin mukkawar

  • Picking process in OPM Batch

    Hi Team,
    To set the Bulk picking process to happen for created batches and when executed no batch order number is getting defaulted for selecting it.
    Kindly let me know is there any set up missed for this feature.
    Regards,
    PAM

    Could you please explain me what steps need to be done for picking process in OPM batch?

  • Process recordset in batch of 10

    Hi,
    I've got a query that returns more than 1000 records.
    Now, for each record, there are several methods to be called
    and much processing to be done.
    If I just do
    <cfloop query="queryName">
    <!--- Invoke all methods here --->
    </cfloop>
    This will take too long and will cause major performance
    issues on the server.
    Therefore I want to process the recordset in batches of 10
    (I've tested with 10 records and it's fine).
    i.e. Loop 1st 10 records -> for each record call the
    appropriate methods, etc. When 1st 10 are finished, proceed to the
    next 10.
    Any idea how to do this please?
    Thanks and regards,
    Yogesh Mahadnac

    Hi Dan,
    I have a program that manages hotel representatives.
    Each representative has a number of hotels that he is
    assigned to, and several agencies can be assigned to each hotel.
    We have around 350 hotels and around 1200 agencies in all.
    Take the worst case scenario (I've tested with much less than
    that and I got a JRUN Error).
    Let's say that 1 representative does ALL Agencies on ALL
    hotels.
    Therefore you need to loop each hotel and assign each agency
    to it so that you can record them.
    The code attached below shows the basic process that occurs.
    When I run it with more than 10 hotels, the program crashes.
    That's why I wanted to process it in batches of 10 i.e. process the
    1st 10 records, send a message to the user that the database is
    processing the request and then when it completes everything, he
    gets a message e.g. All records successfully saved and logged.
    What do you propose as an alternative solution to process all
    those records without causing too much performance degradation?
    Regards,
    Yogesh Mahadnac

  • At the time of Process order creation Batch determination

    Dear All,
    When i am creating process order at the time system not allowing me to execute batch determaination after release only it is allowing me to do.
    My requirement is At the time of order creation i want assign batches ( Execute Batch Detrmination)for the material.
    how to do this one, kindly hel me
    Regards,
    s.sakthivel

    Hi sakthivel 
    Go to OPKP (Production scheduling profile)  txn code and select in Batch management tab Automatic Batch creation at order creation (1) and check this profile is assigned to material in work scheduling view
    Regards

  • Parallel process define for batch job

    Hi,
    I would like to run a batch job with a few processes run parallel together. May I know where can i define it ? T-code ?
    Regards
    Lauran

    Hi Lauren,
    First of all there is no transaction code as such.
    First of all the report that  needs to be run in background should enable you to do parrallel processing. For that code has to be written accordingly.
    Check this link:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fa/096e92543b11d1898e0000e8322d00/content.htm
    It gives details of function modules needed for this purpose.
    After this you need to create a variant for the report and schedule it to run in background using either SE38 (dirrectly) or by creating a job explicitily- SM36.
    A standard report that has parallel processing feature available is RBDAPP01.
    Also check transactions like BD18. They also make use of parallel processing.
    Regards.
    Ruchit.

  • Auto batch detmn for components in Process Order selects batch in Q status.

    Hi Gurus,
    We have the following issue with automatic batch determination for component batches for a Process Order:
    Say for a Process Order it requires components A,B, and C.
    The issue is with component C. if the PO requires 100 Qty of C. the system is picking batch X having 80 qty  and picking 20 from another batch Y which is still in u201CQu201D status (due to some defects it is not cleared .  for which inspection should have completed 3 days before Process Order is released).
    Also there are only these two batches for this component in MMBE.
    What I understand is system adds GR date + GR processing days ( for inspection) and release component for production after that (ie., moves to Un restricted stock). Therefore system selects this batch as per the availability check (by calculating the GR+ GR processing date) even thoe it is not cleared yet.
    Also, I want to know If this is correct procedure, how can we make system to not to include batch with Q stock (batch which is having some defects).
    Thanks,
    N.

    Hi
    Use separate Checking Group(Availability Check) in MRP-3 view for comp C with the settings in OPJJ(Availability Check+Checking rule combination) with untick incl.quality insp stock. Idea is to select the un-restricted batch stock qty during Auto Batch determination for Components
    Regards
    Brahmaji

  • ESB Process reads a Batch file for a limited set of records only..?

    Dear All,
    I am having an ESB process that reads a Batch file (csv) that has around 10,000 Products information.
    I have another BPEL process that will create the Product in Oracle Apps through standard API (Main BPEL process that calls a child process for creating product).
    I am invoking the BPEL process from ESB, and that works fine.
    Now, the Issue is: I am able to create at a time around 10 Products (the main process calls the child process in a loop.). The main process instance is not getting created but the child process instance is getting created for a set of records, afterwards the child process instances get stops creating. The main process instance could not be found in the console. Not getting why the process is not getting visible as well it is not completing the process.
    What could be the problem for this... Am I need to change any environment configurations...?
    Please update...
    Many Thanks in advance...

    Does this apply to you?
    https://social.technet.microsoft.com/Forums/en-US/9ccd8e50-b0af-4f58-9787-6435834e4c52/dfsr-not-working-on-new-windows-2008r2-server
    Thanks for the link, but no - not the same scenario although the error is the same.   The RGs I'm working with are all in sync and communication is working, it's just getting the backlog reported correctly.
    To reiterate, I can paste two versions of the exact command into the DOS window buffer; one copied from OneNote and one copied from my batch file.  Executing the one from OneNote succeeds and reports the RG in sync and the one copied from the batch
    file fails.
    I can repeat the results by up arrow once to the command pasted into the buffer from the batch file and see it fail.  Then up arrow twice to retrieve the command pasted from OneNote into the buffer and it will report correctly (illustrated in the grahic).
    Let me add that the command in the batch file was originally copied from OneNote and pasted in to the batch file; as if going into the batch file somehow corrupts it.
    - a -

  • SM35 - manual processing of the batch input session

    Hello,
    In SM35 I see that some batch input sessions were processed by user XXX-XXXX (user type:System) (in our case INT-3528) in N mode. The question is: how to determine the exact user who has really processed that session? We need to stop that - I guess - automatic processing of the sessions and process them manually.
    Thanks for help,
    Slawek

    Hi,
    also, you can check the logs directly in SM35. So if any documents were posted (or anyting updated in the system) information about what happened should be shown there.
    If there were acounting documents (table BKPF), I think the user name will be the same system user "who" has processed the sessions.
    I think that your basis team has set up the system in a way that batch input sessions are processed automatically. This is simialr when scheduled jobs are running under a pseudo user name (system user, IT user, not a real person behind). You can ask the basis team to switch off this automatic processing competely or only for selected sessions.
    Hope that helps, points welcome
    Csaba

  • Get work process table in batch mode

    I need to get the content of sm50 periodically in a shell script using dpmon. Is there any way to run dpmon in batch mode to get the work process table ?  The dpmon utility provides an inactive way to get the work process table, dpmon ->m ->p but don't see a way to run this in a shell script.
    Does anyone a transparent table (exists in oracle)  in sap, which has the work process information ?
    Jay

    Hi Jay,
    Could you let us know how your issue was solved?
    Because I am facing the same issue..I want to get the output of dpmon in batch form, using scripts...
    When I tried to check the reply "echo "q" | /sapmnt/$/exe/dpmon pf=/sapmnt/$/profile/$_$_$ p", I found that ultimately the cursor does not come out of the interactive mode...This is my main issue...How to come out of the interactive mode of dpmon...Could anyone help me with this?
    Thanks & Regards,
    Kunal Patel

  • Creating Process Orders using batch processing

    Hi :
    I am creating process orders automatically by using batch processing.I have a custom T.code and custom table.The batch program should be build based on custom table.From where will i get the data for batch processing? from custom table? if so how can i prepare a file for that.
    I have to submit this batch program to the custom T.Code so that it creates Process Orders automatically.
    Can u guide how to procede in this.
    Thx.
    Raghu

    Hi Raghu,
      What i think is u have a custom program which creates Process Orders using some user data. this user data is posted to a custom tabel.
    Now if i am right then u want to create a batch program around this custom program so as to achieve benifits of batch processing.
    yopu can check these links to better understand how to create a BDCprogram.
    http://www.sapdevelopment.co.uk/bdc/bdchome.htm
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://www.sappoint.com/abap/bdcconcept.pdf
    http://www.sappoint.com/abap/bdcconcept.pdf
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/fa/097022543b11d1898e0000e8322d00/frameset.htm
    http://www.planetsap.com/bdc_main_page.htm
    http://searchsap.techtarget.com/ateQuestionNResponse/0,289625,sid21_gci1068429_tax293481,00.html
    Hope this helps.
    Award rewar points if its useful.

  • Processing Record by batch

    Hi Experts,
    I have an scenario, In the internal table suppose If I  have a 50,000 records ( fifty thousand records) , suposse I want to process the records in the batch of 5000 ( five thousand ) , I need to process 10 times to compelete this 50,000 records.
    or if I need to process 50,000 records in  the batch of 2000 then ,I need to process it 25 times...
    The number of records per batch will be given by the user ...
    But how to calculate the iterations and process all the records in ABAP langauage...
    Thanks in Advance...
    Regards,
    IFF
    Edited by: IFF on Feb 18, 2008 6:15 PM
    First Iteration : 1-5000
    Second Iteration : 5001-10000
    Last iteration:45001-5000
    The batch size may be directly given by the user
    Regards,
    IFF

    hi
    after the user inputs the no. of records per batch..
    using usual code send those number of records to the batch and delete it from the internal table..
    as u put it in the loop, the process continues until all the records are processed (that is the internal table become empty).
    Regards,
    K.Tharani.

  • Attach/Dettach 412-e process happen after batch determination,

    Hi, Experts,
    We are using here MTO scenarion, After production , Stock availble against one Sales order(Exa- X1), After that i have create one delivery document agsint SO -X1, & batch determination also done, Only PGI is pending,
    But after that user can do attch/dettach process (movement 412-e-T.code MB1B) X1 SO stock to another SO X2, So i want to restirct atttach/dettach process after createion of delivery agsinst SO- X1,
    Can anybody suggest me for this validation, I think standard validation available but i am not aware of this validation,
    Thanks a lot in adavance,
    Regards:
    Happy

    Dear ayethebing  Sir,
    As per your suggestion,
    I have maintained - Dynamic availability check for goods movement -  B& F also
    Checking Rule for Availability Check - Maintain as a - B
    & then I have created one SO & created delivery docuemnt against that SO(PGI only pending), After that i have created new SO, then try to do for MB1B- 413 -E , System is allowing me for posting,
    Request you to inform me other solution, Given solution not working,
    Once again Thanks for your prompt response,
    Regard:
    Happy

  • Mark T/R items with the 'Processed' Indicator in batches

    Hi, guys,
    I need to mark a great bulk of transfer request(non or partial processed items) with 'Processed' Indicator, is there any way can get it done in batches? Thanks...
    Best regards
    Michael

    No mass transaction exists for this purpose...try trx LL01...or LSMW...
    Edited by: Csaba Szommer on May 18, 2009 2:38 PM

  • Problems processing a large batch of data within a Weblogic 5.1 cluster

    I have about exhausted my sources of information on this, so I ask the
              experts:
              The project I am involved with is attempting to build a scheduled
              process on a 5.1 cluster which will retrieve hundreds to thousands of
              database rows from a small group of Oracle tables and then submit them
              into a legacy system for processing. The problems we face are:
              1. We cannot have duplicate data submitted from startup classes on
              different servers in the cluster
              2. We need the process to run if even only one machine in the cluster is
              available and therefore do not want to tie the process to a single
              machine
              3. We would prefer to distribute the workload across all servers
              currently available in the cluster, but this is not mandatory.
              One solution is to retrieve each record as an Entity bean, attempting to
              update it to "in process" and rejecting any failures thus utilizing
              database locking, but due to the large number of records being processed
              this is much too resource intensive as well as time consuming.
              We have looked into JMS based solutions, but it appears that JMS under
              5.1 is tied to a specific server (failing case 2).
              One acceptable approach that we have yet to find a way of implementing
              is to have a "singleton" session bean, only one of which exists on the
              cluster (though it may exist anywhere on the cluster). I have run
              across a number of other applications for just this sort of EJB, but is
              it possible to implement?
              Sadly, Weblogic 6.0 cannot be part of the solution as our company will
              not be adopting it until well after this project's delivery date.
              Are we missing something obvious?
              Many thanks!
              -Steve
              

    You have to have all the servers in the cluster polling for work out of the
              database. Use the database as a scheduling / routing mechanism. Use timers
              on each server in the cluster to kick off a "find me one thing to do"
              process every n minutes or seconds.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "Steven Wicklund" <[email protected]> wrote in message
              news:[email protected]...
              > I have about exhausted my sources of information on this, so I ask the
              > experts:
              > The project I am involved with is attempting to build a scheduled
              > process on a 5.1 cluster which will retrieve hundreds to thousands of
              > database rows from a small group of Oracle tables and then submit them
              > into a legacy system for processing. The problems we face are:
              > 1. We cannot have duplicate data submitted from startup classes on
              > different servers in the cluster
              > 2. We need the process to run if even only one machine in the cluster is
              > available and therefore do not want to tie the process to a single
              > machine
              > 3. We would prefer to distribute the workload across all servers
              > currently available in the cluster, but this is not mandatory.
              >
              > One solution is to retrieve each record as an Entity bean, attempting to
              > update it to "in process" and rejecting any failures thus utilizing
              > database locking, but due to the large number of records being processed
              > this is much too resource intensive as well as time consuming.
              >
              > We have looked into JMS based solutions, but it appears that JMS under
              > 5.1 is tied to a specific server (failing case 2).
              >
              > One acceptable approach that we have yet to find a way of implementing
              > is to have a "singleton" session bean, only one of which exists on the
              > cluster (though it may exist anywhere on the cluster). I have run
              > across a number of other applications for just this sort of EJB, but is
              > it possible to implement?
              >
              > Sadly, Weblogic 6.0 cannot be part of the solution as our company will
              > not be adopting it until well after this project's delivery date.
              >
              > Are we missing something obvious?
              > Many thanks!
              > -Steve
              >
              

Maybe you are looking for

  • The iPod "iPod" could not be restored because it is busy

    My 20g ipod started giving me trouble a few weeks ago after I loaded some post-Christmas purchases. It wouldn't load the last few songs, and it was half-empty, so capacity wasn't an issue. I next tried to restore the iPod, but my mac mini then seized

  • Edit in Photoshop option grayed out ?

    Hello, Just upgraded from Lightroom V4.4 to V5.  After this upgrade I find that I can no longer select the option "Edit in Photoshop", the option is grayed out and is not selectable. I have Photoshop CS6 currently installed and don't have plans to up

  • Sample OLAP client application causes Oracle service to crash!

    I have a very simple Java application that establishes a connection to an Oracle9i (R9.2) database having the OLAP extension installed. After creating the connection it creates a new MdmSchema object: MdmSchema root = mp.getRootSchema(); At this mome

  • Texts

    hi all In the selection screen i want put text name instead of field names . how to do that?

  • Itunes 7 stops responding while updating library iTunes for windows

    itunes 7 stops responding while updating library iTunes for windows. it get about 75 percent done then, freezes, task manager says itunes has stopped responding. any help out there?