I want to diaplay my records from the databasewith 10 records per page. i l

i want to diaplay my records from the databasewith 10 records per page. i learned that it can be done through pagination . Please can anyone there help me and give me the code of how to page my records in my jsp pages
I have small code ,but its not working....
below is the code....
public ResultSet codeResult(int i){
if(dataSource!= null){
     try {
                         con=dataSource.getConnection();
     stmt=con.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
     int maxRows=stmt.getMaxRows();
     System.out.println("the maxRows is:"+maxRows);
     System.out.println("the I value is:"+i);
     if((i < 0) || (i > maxRows)){
          i=0;
     stmt.setFetchSize(i);
     long t = System.currentTimeMillis();
     rs=stmt.executeQuery("select asc_code,countrycode,asc_name,asc_address1,asc_address2,asc_city,asc_country,asc_region,asc_contact_person,asc_contact_no,asc_email_id,asc_fax_no,nso_incharge,nso_email,ar_ap_code from asc_master order by asc_code asc");
but,its giving all records...
any one help me on this........
Thank you,
D.Nagireddy.                    
                    } catch (SQLException e) {
                         e.printStackTrace();
          return rs;
          }

hey, here my code for paging. hope it helps...
     public void DueRecordInfo(int page,int MAX_PER_PAGE)
          con = new DBConnection().getConnection();
         try
                 Statement stmt = con.createStatement();
                 String sqlcount = "SELECT COUNT(*) FROM INFO WHERE TO_DATE(DATEUPDATED,'Month DD, YYYY') < ADD_MONTHS(SYSDATE,-6) AND OBSOLETE LIKE 'No'";
                 ResultSet rscount = stmt.executeQuery(sqlcount);     
                rscount.next();
                total_row_count = rscount.getInt(1);
              lowerbound = (page * MAX_PER_PAGE - (MAX_PER_PAGE))+1;
              upperbound = lowerbound - 1 + MAX_PER_PAGE;
              String sql = "Select * from "+
                                "(SELECT row_number() over(ORDER BY TO_DATE(DATEUPDATED,'Month DD, YYYY') DESC) AS RN,ID,SPECNO,REVISEDNO,DATEREVISED,TITLE,ORIGINATOR,DCBNUMBER,DCBLOCATION,OBSOLETE,DATEOBSOLETE,WORDFILE,PDFFILE,DATEUPDATED FROM INFO WHERE TO_DATE(DATEUPDATED,'Month DD, YYYY') < ADD_MONTHS(SYSDATE,-6) AND OBSOLETE LIKE 'No') " +
                                "WHERE RN BETWEEN "+ lowerbound + " AND " +upperbound;
               ResultSet rs = stmt.executeQuery(sql);
              while (rs.next())
                     id.add(num, rs.getString("ID"));
                     specno.add(num, rs.getString("SPECNO"));
                     revisedno.add(num, rs.getString("REVISEDNO"));
                   daterevised.add(num, rs.getString("DATEREVISED"));
                   title.add(num, rs.getString("TITLE"));
                   originator.add(num, rs.getString("ORIGINATOR"));
                   dcbnumber.add(num, rs.getString("DCBNUMBER"));
                   dcblocation.add(num, rs.getString("DCBLOCATION"));
                   obsolete.add(num, rs.getString("OBSOLETE"));
                   dateobsolete.add(num, rs.getString("DATEOBSOLETE"));
                   wordfile.add(num, rs.getString("WORDFILE"));
                   pdffile.add(num, rs.getString("PDFFILE"));
                   dateupdated.add(num, rs.getString("DATEUPDATED"));
                     num++;
               con.close();
               rscount.close();
               rs.close();
               stmt.close();
         }

Similar Messages

  • I HAVE A SOURCE TABLE WITH 10 RECORDS AND TARGET TABLE 15 RECORDS. MY WUESTION IS USING WITH THE TABLE COMPARISON TRANSFORM I WANT TO DELETE UNMATCHED RECORDS FROM THE TARGET TABLE ??

    I HAVE A SOURCE TABLE WITH 10 RECORDS AND TARGET TABLE 15 RECORDS. MY QUESTION IS USING WITH THE TABLE COMPARISON TRANSFORM .I WANT TO DELETE UNMATCHED RECORDS FROM THE TARGET TABLE ?? HOW IT IS ??

    Hi Kishore,
    First identify deleted records by selecting "Detect deleted rows from comparison table" feature in Table Comparison
    Then Use Map Operation with Input row type as "delete" and output row type as "delete" to delete records from target table.

  • Delete record from the form and from the database

    hi,
    i want delete record from the form and the database ,but the record is only delete from the from !!!
    this is my code :
    if //condition then
    delete_record;
    commit;
    end if ;
    Any solutions ??
    thnx

    You have unique key field(s) on the table you are trying to insert which actually restricts you from inserting the same value again.
    When you are deleting the record and issue commit there is a record to be inserted in the table which is a duplicate that's why you are getting this unique error.
    As oracle is not able to insert your commit fails and stops your deletion of record from table

  • How to delete the single record from the  ODS

    HI,
       I want to DELETE  the particular record from ODS.. how to delete that..
    plz give me the solution.. it's urgent..
    with regards
    @jay

    Hi Prakash,
        You can delete a particular record from ODS by specifying the key field name in Selective deletion button available in Contents tab in the manage screen of ODS. But it will only delete the record from the active data table and not from the Change log and new data table . You should be very carefull if you are doing in Production system as there is chance of deleting other records accidentally.
    Go to Selective deletion button - > Click on delete selection -> Enter the key field values of the record you want to delete-> Press save button to save as Variant -> Go back and click on selection button -> Chosse the background job type -> Click on start button.
    Regards,
    Prakash

  • How to get first 10 records from the database using JSP

    i want ot get first 10 records from the database and then after clicking the next button in the page,it must show the next precceding 10 records from the database.i am getting the first 10 records .but how to post to the same page to get another preceeding 10 record.

    Search the forums - this has been asked a lot. I usually recommend experimenting with tops and order bys until you're satisfied.
    Kind regards,
      Levi

  • Refresh page with data from the Next Record in the Table through a Button

    Scenario: Record of a table “prototype” is made up of 8 columns,
    key_col,
    text_col,
    label1_col, label2_col, label3_col,
    check1_col, check2_col, check3_col,
    I have created the following items on a page:
    a) A Display Only item that is populated through a SQL query
    “SELECT text_col from prototype where rownum=key_seq.NEXTVAL “.
    b) Hidden item for the database columns “label1_col, label2_col, label3_col”
    Source type for the hidden items is of type SQL query, Source expression is:
    Select label1_col from prototype where rownum=key_seq.NEXTVAL ;
    Select label2_col from prototype where rownum=key_seq.NEXTVAL ;
    Select label3_col from prototype where rownum=key_seq.NEXTVAL ;
    (key_seq is a sequence).
    c) Checkbox item for the database columns “ check1_col, check2_col,check3_col"
    d) The labels for the above checkbox items are &label1_col. , &label2_col. , &label3_col.
    I have created a Save button to save the state of the checkboxes; (STATIC:;1 )
    I want the page to be refreshed with the data from the next record (Fields text_col, label1_col, label2_col, label3_col) through a “ Next” Button.
    Can I please know how I can achieve this?
    Thanks in advance

    If you need the value that is entered in the textbox as the email body, then try this..
    <html>
    <HEAD>
    <title>WebForm1</title>
    <script language="javascript">
    function mailHTML() {
    var content=document.getElementById('textBox').value;
    location.href="mailto:?body="+encodeURI(content);
    </script>
    </head>
    <body>
    <form name="theform" id="theform">
    <div name="body1"/>
    <input type="text" value="Test" id="textBox"/>
    <input type="button" value="Send Email" onClick="mailHTML()"/>
    </div>
    </form>
    </body>
    </html>

  • Deleting records from the Custom Objects

    Hello all,
    We want to delete all records from a custom object and as there is no 'Batch Delete' functionality on it, we are thinking of other ways to delete all the records. One of the possibilities is to delete all the records by hand, which will be very time consuming, but this might become the best option. Another option is to use webservices to delete the records, but to do so, you will have to write a kind of program that will query for the records and then deletes them. Does anyone have another option or does anyone have written such a tool that I can use to delete the records from the Custom Object?
    Kind regards,
    Niels Rekers

    Hi, To my knowledge WS is the way to do it. We are a system integrator and can help you out in doing this by providing a WS program. If interested you can write to [email protected]
    -- Venky CRMIT

  • Can I create a Depart Date for a record, from the Arrive Date in the next record?

    I have a Customer database with the tables tblCustomers and tblAddress. The tblCustomers has the following fields; CustomerID, CustomerName. The tblAddress has the following fields; CustomerID, Address, Town, County, ArriveDate. When a customer calls us
    we start a new record with the CustomerID, CustomerName, Address, Town, County. The ArriveDate is left blank. When my service guy calls to the customer he fills in the ArriveDate field. We do not have a LeaveDate field. He could be there from 1 day up
    to 5 days. Each day he is is there he adds another record with all the above data, including the date in the ArriveDate field. If he finishes on a Friday he will take Saturday and Sunday off. On Monday he moves to the next customer, he has a new
    customer/location record waiting for him, as before he fills in the ArriveDate and starts working. If he finishes with a customer midweek he will go straight to the next customer where there is a new customer/location record waiting for him to fill in
    the ArriveDate. It looks something along these lines;
    CustomerID    CustomerName    Address              Town               County            
     ArriveDate
    5437              Mr.A                    123 Main St       
    Nenagh            Tipperary          01/01/2015
    5437              Mr. A                   123 Main St.       Nenagh           
    Tipperary          02/01/2015
    5437              Mr. A                   123 Main St.       Nenagh            Tipperary          03/01/2015
    off Saturday and Sunday
    7890              Mr. B                   77 The Avenue    Tralee              Kerry               
    06/01/2015   
    7890              Mr. B                   77 The Avenue    Tralee             Kerry                
    07/01/2015
    I want to generate a DepartDate which will be generated when the Address, County and/or Town fields change from the previous record. The Depart Date should be equal to the last of the Arrive Dates before the Address, Town and County fields change to
    the new customer/address.
    Is this possible to do, i would appreciate any help with this.              

    Hi NewAccessLearner,
    For the results of the query, I think you accord the logic below to find the DepartDate, but the sql query would be much complex.
    Take the 123A to make a simple demo:
    #1 check the ArriveDate of the next date whether it exist in the ArriveDate
    DepartDate
    Expr1000
    t1.CustomerID
    t2.CustomerID
    Address
    Town
    County
    ArriveDate
    1/2/2015
    5437
    5437
    123 Main St
    Nenagh
    Tipperary
    1/1/2015
    1/3/2015
    5437
    5437
    123 Main St
    Nenagh
    Tipperary
    1/2/2015
    1/4/2015
    5437
    5437
    123 Main St
    Nenagh
    Tipperary
    1/3/2015
    1/8/2015
    5437
    5437
    123 Main St
    Nenagh
    Tipperary
    1/7/2015
    6/2/2015
    7890
    7890
    77 The Avenue
    Tralee
    Kerry
    6/1/2015
    In the first column the “1/4/2015” is not in the ArriveDate, and then the “1/3/2015” would be the date for DepartDate.
    I am not familiar with sql query, I think you need to ask the sql experts for help.
    Best Regards,
    Leo

  • Can not delete record from the master block ,frm-40202 field must be entere

    hi ,
    i have built a form which contain master and details blocks
    the problem is
    when i try to delete a record from the master block it gives me new serial for the transaction and when i try to save it, it says
    >frm-40202 field must be entered
    where this field is required and i cant save it
    although in another form when i delete from the master it gives me the previous record and it works properly
    if any one has any ideas pls help me
    thank u
    ------- the master block has a trigger when-create-recoder
    Declare>v_dummy number;
    Begin
    Select nvl(max(ERNT_NO),0) + 1 >Into v_dummy
    From LM_RENT_EXPNMST >Where cmp_no = :LM_RENT_EXPNMST.cmp_no
    And brn_no = :LM_RENT_EXPNMST.brn_no>and fiscal_yr = :LM_RENT_EXPNMST.fiscal_yr;
    >:LM_RENT_EXPNMST.ERNT_NO := v_dummy;
    END;
    IF :PARAMETER.RNT_NO IS NOT NULL THEN
         :LM_RENT_EXPNMST.RNT_NO:=:PARAMETER.RNT_NO;
              :LM_RENT_EXPNMST.RNT_YR:=:PARAMETER.RNT_YR;
         :LM_RENT_EXPNMST.CUST_DESC:=:PARAMETER.RNT_ADESC;
    END IF;Edited by: ayadsufyan on May 8, 2013 2:03 PM

    If this is a FORMS question you should mark this one ANSWERED and repost your question in the FORMS forum
    Forms

  • Incomplete Data on report (report does not show all records from the table)

    Hello,
    I have problem with CR XI, I'm running the same report on the same data with simple select all records from the table (no sorting, no grouping, no filters)
    Sometimes report shows me all records sometimes not. Mostly not all records on the report. When report incomplete sometimes it shows different number of records.
    I'm using CR XI runtime on Windows Server 2003
    Any help appreciated
    Thanks!

    Sorry Alexander. I missed the last line where you clearly say it is runtime.
    A few more questions:
    - Which CR SDK are you using? The Report Designer Component or the CR assemblies for .NET?
    - What is the exact version of CR you are using (from help | about)
    - What CR Service Pack are you on?
    And a troubleshooting suggestion:
    Since this works on some machines, it will be a good idea to compare all the runtime (both CR and non CR) being loaded on a working and non working machines.
    Download the modules utility from here:
    https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip
    and follow the steps as described in this thread:
    https://forums.sdn.sap.com/click.jspa?searchID=18424085&messageID=6186767
    The download also includes instructions on how to use modules.
    Ludek

  • I bought an iPad and an iTunes card, I want to buy an application from the Apps store but it only gives me the option of credit card.  How can I buy Pages with my iTunes card to my iPad? thank you

    I bought an iPad and an iTunes card, I want to buy an application from the Apps store but it only gives me the option of credit card.  How can I buy Pages with my iTunes card to my iPad? thank you

    Have you redeemed your iTunes card to an account associated with an Apple ID?
    Once you have your iPad associated with an Apple ID AND you have an account with a credit card associated with the same Apple ID AND you have some 'store credit' (from redeeming your iTunes card) then purchases use the store credit before they charge the credit card, so you should be ok!
    Personally, I use 'store credit' as a way to monitor whether or not there have been any 'unauthorised' purchases because as soon as the store credit is zero, the security code from the credit card is needed for further purchases!  It does mean that I have sometimes to top up store credit before making a purchase, but 'better safe than sorry'! 

  • My iTunes says I owe $5.25 for songs that I have already paid for and am not going to pay for again but I want to get some apps from the store and now there's a hold on my account. Who do I talk to get the hold taken off

    I explained it most in my question but I am getting charged double for songs that I have already paid for and am not going to pay for twice because that is messed up. But I want to get some apps from the store and it wont let me because of $5.25. Who can I talk to about resolving this issue?

    You're right, it would have been covered under warranty. But because of the user damage, chances are there's a 200-something dollar fee . If you explain to them that it had a defect previously, they might replace it for you at no charge. **MIGHT**. But they would have to believe that it had a defect previously.

  • How to delete the child record from the database

    how to delete a parent and child record from the database can we do it in the servlet and my database is oracle

    I'm not sure I understand the question but you could certainly use the JDBC API from within your servlet to access and modify a DB. You could also use an EJB layer to access your DB and accomplish the same tasks.

  • How to find out top 10 records from the R/3 using Java code (WD Program)

    Hi Experts,
    I have used Java Web Dynpro program to fetch records from the backend. Following code helps me and fetches record. As per the customer reqirement, we have to fetch only top 10 records (Actual Cost) from the backend. So I have to modify the Java code. How I can do so? Please help.
              wdContext.nodeGraphData().invalidate();
              IPublicCostcnt.IGraphDataElement categoryElement;
                   for (int i = 0; i < wdContext.nodeItab_Final1().size(); i++) {
                   categoryElement = wdContext.createGraphDataElement();
                   categoryElement.setCostElement(""+ wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getDescription());
                   categoryElement.setActualCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getActual_Cost().toString());
                   categoryElement.setPlannedCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getPlan_Cost().toString());
                   wdContext.nodeGraphData().addElement(categoryElement);
    Regards,
    Gary

    Dear SDN Users,
    This is how I resolved the issue.
    1) Requested ABAPer to provide me sorted data. The data has been sorted in descending order of actual_cost.
    2) After that I used following code. This resolved the issue.
         if (wdContext.nodeItab_Final1().size()>10){
         IPublicCostcnt.IGraphDataElement categoryElement;
              for (int i = 0; i < 10; i++) {
              categoryElement = wdContext.createGraphDataElement();
              categoryElement.setCostElement(""+ wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getDescription());
              categoryElement.setActualCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getActual_Cost().toString());
              categoryElement.setPlannedCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getPlan_Cost().toString());
              wdContext.nodeGraphData().addElement(categoryElement);
         if (wdContext.nodeItab_Final1().size()<=10){
         if (wdContext.nodeItab_Final1().size()>0){
         IPublicCostcnt.IGraphDataElement categoryElement;
              for (int i = 0; i < wdContext.nodeItab_Final1().size(); i++) {
              categoryElement = wdContext.createGraphDataElement();
              categoryElement.setCostElement(""+ wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getDescription());
              categoryElement.setActualCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getActual_Cost().toString());
              categoryElement.setPlannedCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getPlan_Cost().toString());
              wdContext.nodeGraphData().addElement(categoryElement);
    Regards,
    Gary

  • How to fetch records from the database into a combo box?

    Hi:
    I&acute;m really new with ABLBPM and I&acute;m trying to fetch records from the database to display them into a combo box as valid values for a presentation but I&acute;m using a dynamic method with this code:
    <em>for each row in SELECT campo1, campo2 from TABLE</em>
    <em>do</em>
    <em>solicitudes[] = [row.campo1, row.campo2]</em>
    <em>end</em>
    <em>return solicitudes
    </em>And the debugger says that SQL instructions can be used only in fuctions and procedures that are executed on the server.
    Do you know another way to do it?
    P.D. Sorry for my terrible english
    Greetings

    Hi Steve,
    Thank you, your idea is perfect, but when I try to run the screenflow where the combo should be filled I get this error:
    fuego.lang.ComponentExecutionException: No se ha podido ejecutar correctamente la tarea.
    Motivo: 'java.lang.NullPointerException'.
         at fuego.web.execution.InteractiveExecution.setExecutionError(InteractiveExecution.java:307)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:166)
         at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
         at fuego.webdebugger.servlet.DebuggerServlet.redirect(DebuggerServlet.java:136)
         at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:85)
         at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at fuego.web.execution.servlet.ServletExternalContext.forwardInternal(ServletExternalContext.java:197)
         at fuego.web.execution.servlet.ServletExternalContext.processAction(ServletExternalContext.java:110)
         at fuego.webdebugger.servlet.DebuggerExecution.dispatchComponentExecution(DebuggerExecution.java:64)
         at fuego.web.execution.InteractiveExecution.invokePrepare(InteractiveExecution.java:351)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:192)
         at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:223)
         at fuego.webdebugger.servlet.DebuggerServlet.doDebug(DebuggerServlet.java:148)
         at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:82)
         at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    Any ideas??
    Thanks and greetings

Maybe you are looking for

  • How to get the specified serarch term from the complete url? - Help

    Hello, I have a table in which some columns. One of the column is storing the complete url for the search given by the user. For Example: 1. I give search like "oracle" on the Google, the column will store the complete url as "http://www.google.com/s

  • Maverick install is asking for an admin password which I never set up to begin with.

    Maverick is asking for an admin password which was never set in the beginning.  I have tried all help suggestions to no avail  Help

  • [ Server applet ] Problem :  Can't instantiate socket

    Hy guys ! i'm having a problem getting my tcp server applet on it's feet, the problem is that it doesn't get past instantiating a socket, if i instatiate it with port nr 80 it throws an exception ( Address already in use: JVM_Bind ), with other ports

  • Check model existence in Oracle11g

    How can I check the model existence in Oracle11g using jena adapter 2. I want my application to display specific error message if the model is not exists in the database. For example I already have Cardiovascular and Pediatric model in the database.

  • Setting Up Personal Domain

    Hi Everyone, I wasn't noob at this before, but I guess I fall back into this category. I recently purchased and install Mac OS X 10.5.2 Server, and I am trying to set everything up. I understand most of the basics, but I want to use my personal domai