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.

Similar Messages

  • How can I make more than one account with chat on clubwpt?

    I can't make more than one account with chat on clubwpt? i know several players that has made as many as 20 accounts with chat.I can make accounts but clubwpt will not give me chat,they must have my IP address ,because their response is " you r allowed one account with chat only." But as I have said several players have several accounts with chat. Can anyone help me? Are there any programs or plugins that can do this?Any help at all will be greatly appreciate.

    Open another iCloud account for the other user.

  • How can i select more than one record in a LOV

    I want to select more than one record in a LOV and put them together before to display them in an item.

    This is not possible with a default LOV, so you'll need to create your own. There are a number of ways to select multiple records:
    a) you can use a tree and set Multi-Selection to Yes
    2) you can use a normal block with a checkbox on each row for the user to select records
    three) with the [SYSTEM.MOUSE_BUTTON_MODIFIERS|http://www.oracle.com/webapps/online-help/forms/10g/topics/designing_forms/mouse/at0604.html?tp=true] variable you can allow users to ctrl+click to select many records in a block. set the background colour to indicate a record has been selected
    iv) there is a pjc in the [demo code section|http://download.oracle.com/otndocs/demos/Forms_Demos_10gr2.zip] which lets you select many rows in a poplist

  • How can I DISPLAY MORE THAN ONE ROW OF PHOTOS WHEN CREATING A BOOK?

    Can I display more than A SINGLE ROW of ohotos on the right side of the page when I am creating a photo book? I have 500 pics and this single bar is ridiculous.

    Command (right) - click on a photo in the Photo tray and select Small Photo from the contextual menu:
    This will give you two columns of photos.
    To reduce the number of photos to select from one can select only Unplaced Photos to be displayed in the tray.
    Happy Holidays

  • How can I display more than one value in Calendar ?

    Hi,
    the standard (example) script allows for the display of one value only (as I understood). How can I display two or three values, from the very same table ? Students of mine during an HTMLDB workshop in Leipzig did ask that question.
    Do we have a more detailed docum. on the use of the calendar ?
    pls kindly advise. TIA.
    Bernhard

    my solution:
    Source fo the calendar starts:
    snip>
    declare
    q varchar(32767) := null;
    begin
    q := 'select "ETA", <--- Date Field and concatination of fields as follows:
    "SCHIFFSNAME"|| "ETA_TIME"|| "TERMINAL"||''(br*)'',
    null,
    null,
    null,
    null
    from "#OWNER#"."SCHEDULE"'; . . . . . . .
    snip>
    comment on (br*) - you have to use "<" and ">" instead of "( " and ")" to have the "break/new line effect"
    brgds
    Bernhard

  • 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 display more than one value in Calendar ? (2)

    Hi,
    I came across the "Calendar - Activity Monitor by month" in the HTMLDB admin section. This is exactly the view I like to develop asked earlier (the proposal was to work with concatination of fields). Can you provide for the source code used for the a.m. calendar displaying four columns per day ? TIA - Bernhard

    if you're talking about the "Calendar of Views by Day" available in the administration section of any workspace (HTML DB Home >> Administration >> Monitor >> Calendar of Views by Day) or the "Calendar of Page Views" in the instance administration interface (HTML DB Administration >> Monitoring >> Calendar of Page Views), they're both implemented as htmldb calendar regions where the multiple values displayed per day are concatenated together with '
    ' strings between them.
    hope this helps,
    raj

  • How can I delete more than one email with DROID Turbo

    New DROID Turbo. Don't know how to delete all emails (no select all option?)

        Thanks for the reply, wrkeen. If you're using the native email application on your Turbo, you should be able to press and hold one email in your inbox then the option to select multiple emails will become available. Comcast also has a special application, Xfinity Connect, for their emails. If you're using their application, please reach out to Comcast directly for email assistance.
    JenniferH_VZW
    Follow us on Twitter www.twitter.com/vzwsupport

  • How to display more than one column with for each

    Hi guys,
    how to display more than one column with for each like below?
    for each
    Item1
    Item2
    Item3
    Item4
    Item5
    Item6
    Item7
    Item8
    Item9
    Item10
    End for each
    for each          
    Item1     Item2     Item3
    Item4     Item5     Item6
    Item7     Item8     Item9
    Item10          
    End for each

    Take a look at this to see if the solution provided would work for you: https://blogs.oracle.com/xmlpublisher/entry/multi_column_row_woes
    Won't you have more than 10 records in your data file ? If you are going to have only 10 items then you may be able to use position() function to limit it to 3 each..
    Take a look at this: https://blogs.oracle.com/xmlpublisher/entry/turning_rows_into_columns
    Thanks,
    Bipuser

  • How can I add more than one same spry menu (eg. collapsible menu)  with in different styles (font size, color, background, etc) on current page?

    How can I add more than one same spry menu (eg. collapsible menu)  with in different styles (font size, color, background, etc) on current page?

    Hi Nancy,
    This screenshot was only for imagination. A part of the code (not all) is below.  In the code there are some background images but they are not seem in live mode.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="css/my_site.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css"/>
    <link href="SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
    <style>
    #CollapsiblePanel1 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-color: #003366;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel1 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        line-height: 52px;
    #CollapsiblePanel1 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        line-height: 52px;
    #CollapsiblePanel2 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/international.jpg);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel2 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel2 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel2 .CollapsiblePanelContent {
        background-color: blue;
    #CollapsiblePanel3 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel3 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel3 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel4 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel4 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel4 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel5 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel5 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel5 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    </style>

  • How can I buy more than one item at a time?

    How can I buy more than one item at a time i iPhote fx a book and a calander? It would be nice to place one order and only pay for the shipping once!

    You can't.
    Regards
    TD

  • How can I pass more than one parameters in PDK-URL services?

    Hi all,
    How can I pass more than one parameters in PDK-URL service? All samples on Portal Center shows just one parameter passing.
    <inputParameter class="oracle.portal.provider.v1.URLPortletParameter">
    <name>csz</name>
    <isMandatory>false</isMandatory>
    <displayName>What location do you want a map for (City, State or Zip)?</displayName>
    </inputParameter>
    How can I write the privider.xml file for passing multiple parameters?

    I answer to my question. I've got the answer.
    I repeatly write down the <inputParameter> tags, and it works.

  • How can I select more than one song from the search results?

    I want to create playlists based on certain words in the song title. For example, I may want to create a playlist of all my songs with LOVE in the title.
    Doing the search is easy, but I can't select more than one song at a time. Is there any way in iTunes 12 for Windows to do this? I found an answer in iTunes for Mac, and it basically says to "un-check "Search Entire Library." " but I don't see that option in iTunes for Windows.
    Here is the link to that question: how can i select more than one song from drop down search bar
    I hope some Windows user can help me out.

    Found the "Search Entire Library" option - click on the small (VERY small for my eyesight) down arrow next to the magnifying glass. Also need to select "Filter by: Songs", and then the songs in the main window show the results.
    I'm going to leave this up on the board because 1) in case someone else has this question, and 2) I don't know how to delete it anyway.

  • How can I maintain more than one contact person for a supplier

    Hi
    As per our business requirement , How can I maintain more than one contact person for a single supplier in SRM?
    How these contact persons are supposed to log in to a portal with different user id and passwords and access the bids for same supplier.
    we are in SRM 7, and currently we are creating contact person throug customised BDC.
    please advice.
    Thanks & Regards
    NITIN
    Edited by: nitinkk on Sep 9, 2011 10:22 AM

    Dear Yaniv,
    Thanks for your information,
    I am able to create  users But my problem is How these contact persons are supposed to log in to a portal with different user id and passwords and access the bids for same supplier ? Is there any kind of maping is available for the user/ contact person to the supplier no.??
    Thanks & Regard
    NITIN

  • How can I get more than one firewre port ?

    Hello,
    how can I get more than one firewire port ? I'd like to be able to connect my canon HV30 camera as well as my firewire external HD at the same time so I can use firewire to upload the videos I've taken. Is this possible?
    TIA

    Hi ginestre-
    Many FireWire hard drives have 2 firewire ports so that you can daisy-chain devices and connect the camera that way.
    Daisy-chaining is not the most reliable method, but it works, so you could buy a FireWire hub.
    Luck-
    -DP

Maybe you are looking for

  • Mouse hover drop down menu not shown

    recently (about few months ago), i found the profile drop down menu on www.zhihu.com no longer works. i also noticed that other mouse over funtions are disabled too. oddly, the problem only seems to appear on firefox on my laptop. other browsers on t

  • Firefox doesn't work with Net Nanny. What to do?

    Firefox will not go to any website (other than homepage - MSN), when program Net Nanny is enabled. I have to disable Net Nanny for Firefox to go to other websites. Do not have this issue with IE or Chrome. Solutions? Thanks

  • What is the benefit of using Firefox over Safari?

    I am a long time PC user who just ran through her 5th laptop, 1 toshiba, 2 panasonics, and 2 dells. Finally decided to buy my first Apple product, MacBook Pro. Purchased yesterday and trying to learn the new system. My question is, what is 'wrong' wi

  • Telephone Number for customer service

    I need to speak with someone on the telephone

  • How to use  myfaces  TreeModel.

    I want to create a Tree view using tomhawk t:tree component. This component has a value attribute . I want to know 1-How to use the TreeModel for value binding. 2-Whether we have to use only TreeModel for value binding or any other wrapper class. Tha