How can I retrieve all row information from a database table.

I have a jsp file which calls info from columns in a table. My question, is how can I edit it so that it retrieves all the rows?
I tried using resultset SalesInfo.next() which only retrieves the last row value and resultset SalesInfo.first() which only retrieves the first row value.
Here is my code
public ResultSet SalesInfo;
public void getSalesInfo()
          try
               Statement stmt = db.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
               SalesInfo = stmt.executeQuery("SELECT sales_id,cust_id,product_id, quantity from sales;");
               SalesInfo.first();
               setCartsales_id (SalesInfo.getString("sales_id"));
               setCartcust_id (SalesInfo.getString("cust_id"));
               setCartProduct_id(SalesInfo.getString("product_id"));
               setCartquantity (SalesInfo.getString("quantity"));
          catch(SQLException e )
               setCartsales_id(e.toString());
               e.printStackTrace();
Also I apologise for not having the proper code format as I had a problem with my keyboard.

     public class SalesDB{
    public static synchronized Vector getSalesDetail(Connection connection) throws SQLException{
        String query = "SELECT * from Sales;"
       Statement statement = connection.createStatement();
        ResultSet results = statement.executeQuery(query);
        Vector sale_details = new Vector();
        while(results.next() == true){
     SaleInfo saleInfo = new    SaleInfo(results.getString("sales_id"),results.getDouble("cust_id"),results.getString("product_id"));
            sale_details.add(saleInfo);
        results.close();
        statement.close();
        return sale_details;
}

Similar Messages

  • How can we retrieve the Payload information from B2B

    Hello,
    We are trying to send the payload information back to the client for a failed BPEL Transaction from B2B's b2b_instancemessage view. We are enqueing messages to IP_OUT_QUEUE using BPEL. We see the payload coming correctly in the B2B Business Message Reports. But we don't see the payload coming in the b2b_instancemessage view for failed B2B transactions. How can we see the payload in b2b_instancemessage view for failed B2B transactions as well? or How can we retrieve the Payload information from B2B?
    Any help is greatly appreciated! Thanks. - Sam.
    Edited by: user12049162 on Dec 4, 2009 2:04 PM

    I am not sure about the PDK API to get the group name. But using LDAP API its easy to get the User Group.
    If you find the answer to get the group name using PDK API, Please update in forum. It will really help others.
    --Balaji S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How can we retrieve all rows following a particular records in a table.

    Hi all,
    i've to fetch all records following a particular rcord in a table..
    for ex. we have 4 rows :
    col1 col2 col3
    A A1 A2
    B B1 B2
    C C1 C2
    D D1 D2
    How can i retrieve rows following B record. plz. help me
    Thx.

    It depends what you mean by "following". Tables don't have an innate ordering. If you selected all the rows from this table they wouldn't necessarily turn up in that order.
    All you can do is create a query ordering by one or more of the columns (in this case you appear to want lexical order) and then select on the basis that the column values exceed a set of values.
    For example, with your data this happens to work:
    select * from yourtable where col1 > 'B' order by co1;But I very much doubt that this is what you actually need to do, and it is VERY important that you grasp that tables do not have any innate ordering.

  • How can I transfer all my information from iphone 4 to iphone 5

    I tried to transfer the information but a window was open that required a password, I wrote my itunes password but it says incorrect.
    I need to transfers everything: apps, contacts, music.
    Please help me

    Do you have a computer with all this information on?
    Just sync your iPhone 5 with that computer and activate your icloud on the device and you should be fine

  • How can i import all my information from my IPad into a new install of Itunes... i'm getting a notice of the Ipad sync'd with another Itunes library...that laptop is gone an cannot be returned

    my laptop that i had my origional Itunes on has been lost.  I have an Ipad2 and want to sync the apps, music, photos, contacts etc to a new Itunes installation.  I can only find a way to sync that wants to wipe my ipad which has all my info on it.  I want to reverse the sycn and put all the data on my itunes.  What do you suggest?  find a third party app to explore and try to copy the info?  Please advise.
    J

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • HT201269 How can I retrieve my sync information from my Iphone 4?

    I was back up my Iphone and it reach a point it doesn't want to activate after the back up and sync....

    iTunes includes an option to transfer iTunes content from an iPod or iOS device that was purchased/downloaded from the iTunes store.
    First you need to authorize your new computer with your iTunes account or Apple ID with iTunes if you haven't already done so.
    With your iPhone connected and without syncing, at the iTunes menu bar go to file and select transfer purchases from – the name of your iPhone.

  • My iPhone was stolen last night and I'm trying to recover all my photos from that phone and get them on my mac laptop. The iCloud photo stream only imported 1,000 photos from my stolen phone. How can I retrieve all of my other photos?

    my iPhone was stolen last night and I'm trying to recover all my photos from that phone and get them on my mac laptop. The iCloud photo stream only imported 1,000 photos from my stolen phone. How can I retrieve all of my other photos?

    You have to reset the device to Factory Settings in order to restore it from an iCloud backup. You probably want to back it up as is before you do this.
    To do the reset after you have backed up the current device, go to Settings>Reset>Reset all Content & Settings. This will erase the device. If you are signed onto iCloud with Find My iPhone turned on, go to Settings>iCloud and scroll to the bottom to sign out of iCloud before you do the reset.
    Once you have reset your device, you will set it up like a new phone. When it asks if you want to restore it from an iCloud backup, select the backup you want to restore it from.
    Cheers,
    GB

  • I deleted all my emails from inbox and trash, but the mail "file" has 2GB. How can I permantely delete this information from my iphone4?

    How can I permantely delete email information from my iphone4?
    I deleted all my emails from inbox and trash, but the Mail "file" still has 2GB...

    Does anyone have an answer to this problem? It's been 4 or 5 days now and iCloud still says I have 0kb of 5GB available, and 6.1GB of mail on iCloud. I guess that's better than yesterday when it said I had 8.3GB of mail. Does anyone know if it simply takes Apple a week to actually empty a mailbox?
    thanks in advance, hopefully tomorrow it says I have only 4GB of non-existent mail and I can start using it again...

  • How can I retrieve all texts from lost iPhone 6 plus left in lost mode?

    How can I retrieve all new texts going to my  lost iPhone 6 plus left in lost mode, through a browser or my wifi iPad ?

    Not through a browser.  If iMessage, set iPad to receive messages sent to your cell number:
    Settings > Messages > Send & Receive > You can be reached by iMessage at >
    SMS/MMS - no

  • How can I move all my bookmarks from different Firefox profiles into one area to organize them and then place them into the different Firefox profiles?

    How can I move all my bookmarks from different Firefox profiles (would like to move whole bookmark folders at once if possible) into one area to organize them and then place them into the different Firefox profiles? This is all under one window user account, I am using windows 8.1. Even if you have information on how to do it on a different windows, it may still be helpful. Thanks for any input you have.

    Just a note about the difference between these two things:
    * "export" and "import" use an ancient HTML document format that all browsers can understand. When you import bookmarks, Firefox may place them into an Imported Bookmarks folder, or into Unsorted Bookmarks. This does not displace existing bookmarks, and Firefox does not automatically remove duplicates.
    * "backup" and "restore" use a more comprehensive JSON data file, which contains extra information about your bookmarks (such as tags) not contained in the traditional export file. HOWEVER, a restore completely replaces all existing bookmarks, so the restore feature cannot be used to merge in a set of additional bookmarks.
    Related support articles:
    * [[Export Firefox bookmarks to an HTML file to back up or transfer bookmarks]]
    * [[Import Bookmarks from a HTML file]]
    * [[Restore bookmarks from backup or move them to another computer]]
    Some users find the disk-based Windows Favorites folder a convenient way to organize bookmarks. If you do, too, and you do not need to preserve tags on your bookmarks, you could export each profile's bookmarks to HTML and import them all into IE11. Organize them in the Windows Favorites folder, then export from IE11 to HTML and import that file into each Firefox profile. See: [http://windows.microsoft.com/en-us/internet-explorer/add-view-organize-favorites].

  • How can i remove all PC authorizations from iTunes account?

    How can i remove all PC authorizations from iTunes account?

    Removing a credit card from an account - iTunes Store: Changing Account Information - http://support.apple.com/kb/HT1918 - More information at: https://discussions.apple.com/message/15891166

  • Hi...i bought the new iphone 4 and would like to ask how can i transfer all my data from my old iphone to the new one?  If I will do "synchronization" through itunes with the old phone and the plug in the new one will that be the case?

    Hi...i bought the new iphone 4 and would like to ask how can i transfer all my data from my old iphone to the new one?  If I will do "synchronization" through itunes with the old phone and the plug in the new one will that be the case?

    Follow the instructions in this article to transfer your info: iPhone: Transferring information from your current iPhone to a new iPhone

  • I got the new iPhone5 back in Dec, I hooked it up to my computer for the 1st time this wk.  It deleted all new data added since Dec (notes,contacts,texts,pics, info in apps) and reverted back to all my old data.  How can I retrieve all the lost data??

    I got the new iPhone5 back in Dec, I hooked it up to my computer for the 1st time this wk.  It deleted all new data added since Dec (notes,contacts,texts,pics, info added to apps) and reverted back to all my old data (literally uploaded all of my old texts and 1400 old pics and deleted anything new).  How can I retrieve all the lost data?? Please help!!

    SkyDaughter29 wrote:
    My current situation: I have soooo many texts on my iphone and I haven't deleted many because I need the information contained in them for future reference and for legal purposes.  I would really like to find a means and way to save them other than on the phone itself. I've done searches for various apps yet I'm not finding what I think I would need.  It appears Apple does not sync the texts between the iphone and my MacBook Pro.
    Try the computer apps PhoneView (Mac) or TouchCopy (Mac & PC):
    http://www.ecamm.com/mac/phoneview/
    http://www.wideanglesoftware.com/touchcopy/index.php
    Best of luck.

  • My computer crashed and I lost everything. It was the only computer with Sync on it and I cannot get my recovery key: how can I get all my bookmarks from that Sync account?

    My computer crashed and I lost everything. It was the only computer with Sync on it and I cannot get my recovery key: how can I get all my bookmarks from that Sync account? I have a ton of bookmarks/saved password and the only way to get on sync is create a new recovery key and lose all of my information.
    Is there any way to get my stuff back without creating a new recovery key and losing all my old stuff?

    It has always been very basic to always maintain a  backup copy of your computer for just such an occasion.
    Use your backup copy to put everything back.

  • HT4847 How do I delete all my information from the I-Cloud?

    How do I delete all my information from the I-Cloud?

    Greetings austinfromdellslow,
    Welcome to the Apple Support Communities!
    I understand that you would like to store your purchases movies on an external hard drive. To do this, first you will need to download your purchased content from the cloud to the iTunes library on your computer. 
    Download past purchases - Apple Support
    Once your media folder is complete with the downloaded content, you can move that iTunes media folder to your external hard drive using the information in the attached article below. 
    Move your iTunes Media folder on a Windows PC - Apple Support
    Cheers,
    Joe

Maybe you are looking for