Storing more than one value in a bean

HI everyone
I am writing a web appln where i validate a user against a database in LoginServlet .
If he is valid then i want all his records present in AddressBook and AccountDetails stored in a bean corresponding to the records and store them in a bean and then pass on to mainmenu.jsp
But the question is i can set attributes in respective bean corresponding only to one record So how do i solve this problem
Help appreciated
Thanks
Mumtaz

hi!
Use arraylist or vector in your bean. Put all ur records in arraylist or vector and set that to your bean. In you jsp, get that and display using a for loop..

Similar Messages

  • Html check box pass more than one value into bean

    Hi all'
    I have group of check box in html , I need to pass more than one value
    into bean an ddisplay in jsp
    what do i do wrong
    private Vector select =new Vector();
      private String mybox =null;
      public download() {
         again(); 
      /* Accessor Methods */
    private void addmybox(String name){
        select.addElement(name);}
    public void setMybox(String name) {
         mybox = name;
    public String[] getMybox() {
         String[] s = new String[select.size()];
         select.copyInto(s);
         return s;
            in my htmli have <%
         String[] mybox= format.getMybox();
         for (int i=0; i<Mybox.length; i++) {
             <%= format.getMybox%>
    %>
    i got error at <%= format.getMybox[i]%>

    Hi ram,
    thank you, I don't have ideal in my mide .
    in my jsp I have
    <td>  <input type=checkbox name=mybox value=<%= link.getNewNum()%>></td>in my servlet I have something like
    String[] checked = request.getParameterValues("mybox");
            try {
            conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433","A#$","RE@89");
            conn.setCatalog("sequences");  
          stmt = conn.createStatement();  
           for(int i=0; i<checked.length; i++){
                   String select=checked;
    String Sql=" select NewNum, Name, Length, Segment, Sequence";
    Sql+=" from Sec04";
    Sql+=" where NewNum='"+select+"'";
    Sql+=" union";
    Sql+=" select NewNum, Name, Length, Segment, Sequence";
    Sql+=" from MySec";
    Sql+=" where NewNum='"+select+"'";
    Sql+=" union";
    Sql+=" select NewNum, Name, Length, Segment, Sequence";
    Sql+=" from Sec03";
    Sql+=" where NewNum='"+select+"'";
    Sql+=" union";
    Sql+=" select NewNum, Name, Length, Segment, Sequence";
    Sql+=" from Sec02";
    Sql+=" where NewNum='"+select+"'";
    Sql+=" union";
    Sql+=" select NewNum, Name, Length, Segment, Sequence";
    Sql+=" from Sec01";
    Sql+=" where NewNum='"+select+"'";
    rs = stmt.executeQuery (Sql);
    while(rs.next()) {              
    String Name = rs.getString("Name");
    String Segment =rs.getString("Segment");
    String Length = rs.getString("Length");
    String Sequence = storeSequenceData(rs.getString("Sequence"));
    String SContent = Name + " ," Segment ", "+ Length + "\n" +Sequence  ;
    now I want
    String SContent = Name + " ," +Segment + ", "+ Length +  "\n" +Sequence  +"\n" + Name+"Segment+","+length+"+"\n" +Name......untill the end
    it sees like I need to look st on shipp car. is that right??
    Thank you !!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to pass more than one value for one column in procedure

    hi
    select id, name from col_tab where dept_name in ('ECE','CIVIL');
    when i was running this it is working well.
    CREATE OR REPLACE PACKAGE pack_str
    AS
    TYPE type_refcur IS REF CURSOR;
    PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur);
    END pack_str;
    CREATE OR REPLACE PACKAGE BODY pack_str
    AS
    PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur)
    IS
    BEGIN
    OPEN ans FOR
    select id,name from col_tab where dept_name in char_in ;
    END str;
    END pack_str;
    the package was created.
    my doubt is
    1.how to pass more than one value for char_in (e.g ('ECE','CIVIL'))
    2. when i was storing the value in string like val = 'ECE,CIVIL' ,
    how to get the id,name for ECE and CIVIL.
    plz help me

    Hi Rebekh ,
    I am recreating your packages for the desired output.
    CREATE OR REPLACE PACKAGE pack_str
    AS
         TYPE type_refcur IS REF CURSOR;
         PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur);
    END pack_str;
    CREATE OR REPLACE PACKAGE BODY pack_str
    AS
         PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur)
         IS
              lv_t varchar2(200);
         BEGIN
              lv_t := REPLACE(char_in,',',''',''');
              lv_t := 'select id,name from col_tab where dept_name in (''' || lv_t || ''')' ;
              OPEN ans FOR lv_t;
         END str;
    END pack_str;
    Note:-
    Input Parameter char_in is a comma seperated value for dept_name
    -Debamalya

  • Subquery returned more than one value

    Hi,
    I have this statement which has been working fine - not I get a 'Subquery returned more than one value" error:
    SELECT
    'WAS3' AS 'Rec ID',
    E.EecEEID AS 'Emp ID',
    eepNameFirst AS 'First Name',
    eepNameLast AS 'Last Name',
    EecDateOfOriginalHire AS 'Service Date',
    (SELECT DATEDIFF(YEAR, EecDateOfOriginalHire, getdate()) from empcomp EC WHERE EC.EecEEID = E.EECEEID) as 'Yrs of Serv'
    FROM
    EmpPers
    JOIN EmpComp E
    ON E.eecEEID = eepEEID
    JOIN Company
    ON eecCoID = cmpCoID
    WHERE
    EecDateOfTermination IS NOT NULL
    AND EXISTS
    (SELECT 1
    FROM EmpComp e2
    WHERE e2.EecEEID = E.EecEEID
    --AND e2.eecEmplStatus <> 'A')-- changed to <> ...this WAS/is to filter out anyone that was termed then re-hired
    --AND E.EecTermReason NOT IN ('I01','I02','I03','I14','I22','V05','V07','V09','V12','V22','V13', 'TRO')
    AND E.eecDateOfTermination
    IN (SELECT (EC.eecDateOfTermination)
    FROM EMPCOMP EC
    WHERE EC.EecEEID = E.EECEEID
    AND EC.eecDateOfTermination IS NOT NULL
    AND eC.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0)
    AND EC.eecDateOfTermination <=DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6)
    AND e.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0)
    AND E.eecDateOfTermination <= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6)))
    --AND eC.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,('12/30/2007')),0)
    -- AND EC.eecDateOfTermination <=DATEADD(wk,DATEDIFF(wk,0,('12/30/2007')),6)
    -- AND e.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,('12/30/2007')),0)
    -- AND E.eecDateOfTermination <= DATEADD(wk,DATEDIFF(wk,0,('12/30/2007')),6)
    -- AND E.eecDateOfTermination IS NOT NULL ))
    --added below per Paul Cottle to exclude employeess less than four years
    AND E.eecdateoforiginalhire >=dateadd(year,-4, CURRENT_TIMESTAMP)
    qeqw

    Check this, if it works:
    SELECT
    'WAS3' AS 'Rec ID',
    E.EecEEID AS 'Emp ID',
    eepNameFirst AS 'First Name',
    eepNameLast AS 'Last Name',
    EecDateOfOriginalHire AS 'Service Date',
    DATEDIFF(YEAR, EecDateOfOriginalHire, getdate()) as 'Yrs of Serv'
    FROM EmpPers
    JOIN EmpComp E ON E.eecEEID = eepEEID
    JOIN Company ON eecCoID = cmpCoID
    WHERE EecDateOfTermination IS NOT NULL
    AND EXISTS
    (SELECT 1
    FROM EmpComp e2
    WHERE e2.EecEEID = E.EecEEID
    AND E.eecDateOfTermination
    IN (SELECT (EC.eecDateOfTermination)
    FROM EMPCOMP EC
    WHERE EC.EecEEID = E.EECEEID
    AND EC.eecDateOfTermination IS NOT NULL
    AND eC.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0)
    AND EC.eecDateOfTermination <=DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6)
    AND e.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0)
    AND E.eecDateOfTermination <= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6)))
    AND E.eecdateoforiginalhire >=dateadd(year,-4, CURRENT_TIMESTAMP)
    If this post answers your query, please click "Mark As Answer" or "Vote as Helpful".

  • Select more than one value at a time from an LOV?

    Is it possible to configure an LOV-based text field so more than one value at a time can be chosen from the drop-down LOV list? This is a user requirement for specifying multiple values in an SQL WHERE clause.

    Rather several select fields because single returned value is a functional limitation of <select>.

  • URGENT: passing more than one value at the same parameter

    Hello friends at www.oracle.com,
    if I have a Forms program that sends some parameters to a Report, how can I send more than one value at the same parameter that is being sent?
    For example: the Reports parameter P_CODE should receive (from Forms) and print the values 1, 2, 3 and 4, each one in a different page. But, only 4 is being printed, and these values aren't saved at a database, so I have to pass the other three values too. How can I solve this problem?
    This is quite urgent and I need help on this.
    Best regards,
    Franklin Gongalves Jr.
    [email protected]

    Thanks to Oracle Reports Team for answering! I'm sure this will work.
    Best regards,
    Franklin Gongalves Jr.
    [email protected]
    hello,
    on the forms side, you will have to build the list for this parameter by e.g. string concat.
    on the reports side you will have to "decode" this parameter according to how you built it in forms.
    e.g. if you pass the list like this "10~20~30" you might use a where-clause in the query
    ... where instr(myCol, :myParam) >0
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

  • More than one Value for a Category

    Hello,
    it is possible to assign more than one value of a category to a document by assigning the category once more. Is it a bug or a feature?
    If it is not a bug, I wonder why it is not possible to search for a document with two values of one category set? And why isn't it possible to combine category values with "OR" in my search query?
    Best regards,
    Christian

    Only one video role, only one audio roll, per clip.  Only one as these are "Media Stems", and when you work with Stems, only one roll per asset video, one per asset audio.

  • Select more than one value in a query

    Hi,
    since V7.0 we have a problem in the selection screen to select more than one value in a easy way.
    How can I select e.g. 20 BuisinessPartner with one selection?
    To create a variant isn't possible, because every user needs different values.
    Thanks

    Hi,
    Go for "Selection Options " instead of Multiple single values ..
    With this option u can get single values, multiple single values & ranges also..
    Can u please explain clearly regarding that function of whole excel sheet into a variable??
    Regards,
    Vijay
    Edited by: vijaya kumar on May 22, 2009 6:15 PM

  • Can Function Return more than One Values ??

    Hi Experts,
    I would like to ask you Can Function Return more than one values. I Used Function with Out and In out parameter and its working Fine..
    1. what is harm using Out and In out parameter in function
    2. if we can use Out and In out parameter in Function so what is deffernce between procedure and Function.
    3. Is there any Other Way Though which we can return more the One values in Function.
    Please advice me...
    Thanks
    Umesh Goel

    Yes/No.
    You can return multiple value from function. But, in PL/SQL and not in a SQL.
    The following examples demonstrate that -
    SQL*Plus: Release 9.2.0.1.0 - Production on Wed Mar 28 17:41:15 2007
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> create or replace package glob
      2  as
      3    b varchar2(20);
      4    c varchar2(20);
      5  end;
      6  /
    Package created.
    SQL>
    SQL> create or replace function test_mul_out(a in number)
      2  return number
      3  is
      4    cursor c1(eno in number)
      5    is
      6      select ename,job,sal
      7   from emp
      8   where empno = eno;
      9  
    10    rec c1%rowtype;
    11    d  number(10);
    12  begin
    13    open c1(a);
    14    loop
    15      fetch c1 into rec;
    16      exit when c1%notfound;
    17       glob.b:= rec.ename;
    18    glob.c:= rec.job;
    19    d:= rec.sal;
    20    end loop;
    21    close c1;
    22    return d;
    23  end;
    24  /
    Function created.
    SQL> set serveroutput on
    SQL>
    SQL> declare
      2    zz  number(10);
      3  begin
      4    select test_mul_out(7777)
      5    into zz
      6    from dual;
      7    
      8    dbms_output.put_line('Ename: '||glob.b);
      9    dbms_output.put_line('Job: '||glob.c);
    10    dbms_output.put_line('Sal: '||zz);
    11  end;
    12  /
    Ename: Avik
    Job: CLERK
    Sal: 3456
    PL/SQL procedure successfully completed.
    SQL> Regards.
    Satyaki De.

  • TableView - Filter more than one value in same column

    Hi folks,
    I faced a problem on <b>filtering a field more than one value</b>.
    Does it possible solution for us to bring out filtering function while user try to enter few values in the SAME filter field?
    Thank you.
    First, i need to clarify my exact problem.
    --> I have created one tableView with filter = "server". Then i want to allow my user to enter few filter values in same field column.
    Example 1:
    Before
    COL1 COL2 COL3 COL4
    l--II--
    l-filter1I--I--
    *filter1 = AAA, BBB
    AAA AAA AAA AAA
    BBB BBB BBB BBB
    CCC CCC CCC CCC
    DDD DDD DDD DDD
    EEE EEE EEE EEE
    After
    COL1 COL2 COL3 COL4
    l--II--
    l-filter1I--I--
    *filter1 = AAA, BBB
    AAA AAA AAA AAA
    BBB BBB BBB BBB
    Is that any good suggestions to solve my doubt?
    Message was edited by:
            GP Poh

    check out this work around. in this sample currency column supports multiple values and multiple values in the filter column should be enter with comma as separater.
    <u><b>page attribute:</b></u>
    filtertab     TYPE     RSELOPTION
    filter_wa     TYPE     RSDSSELOPT
    itab     TYPE     FLIGHTTAB
    <u><b>layout</b></u>
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title=" " >
        <htmlb:form>
        <htmlb:textView id ="tex"
                        text = "Filter on Currency Column support multiple values, they can be entered with comma as separater like 'usd,DEM'"/>
          <htmlb:tableView id                  = "tv1"
                           design              = "ALTERNATING"
                           table               = "<%= itab %>"
                           filter              = "APPLICATION"
                           columnHeaderVisible = "true"
                           sort                = "SERVER" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    <u><b>oninitialization</b></u>
    select * from sflight into table itab where currency in filtertab .
    <u><b>oninputprocessing</b></u>
    * event handler for checking and processing user input and
    * for defining navigation
    DATA: table           TYPE REF TO cl_htmlb_tableview .
    DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
    DATA: filter_value TYPE string .
    DATA: fil_val TYPE STANDARD TABLE OF string ,
          fil_val_wa TYPE string .
    REFRESH filtertab .
    table ?= cl_htmlb_manager=>get_data( request = request
                                               name    = 'tableView'
                                               id      = 'tv1' ).
    IF table IS NOT INITIAL .
      tv_data = table->data .
      IF NOT tv_data IS INITIAL .
        CALL METHOD tv_data->get_row_filter_value
          EXPORTING
            column_index = 6
          RECEIVING
            value        = filter_value.
        IF NOT filter_value IS INITIAL .
          TRANSLATE filter_value TO UPPER CASE .
          REFRESH fil_val .
          SPLIT filter_value AT ',' INTO TABLE fil_val .
          CLEAR fil_val_wa .
          LOOP AT fil_val INTO fil_val_wa .
            filter_wa-sign = 'I' .
            filter_wa-option = 'EQ' .
            filter_wa-low = fil_val_wa .
            APPEND filter_wa TO filtertab .
          ENDLOOP .
        ELSE .
          REFRESH filtertab .
        ENDIF .
      ENDIF .
    ENDIF .
    Regards
    Raja

  • How to pass a variable more than one values?

    How to pass a variable more than one values?

    You can't.
    During 1 session, 1 ODI variable can have only 1 value at a time.
    If you need more than 1 value, you will have to do somethink like a loop inside your package, and refresh the variable value each time.

  • Can I store more than One value in HashMap using Same kay?

    Hi,
    I want to store more than one value in HashMap using same key................. is it possible?
    If yes, then please give me source code for that.....
    Thankx in Adv.......

    I want to store more than one value in HashMap using >same key................. is it possible?I don't think so
    Message was edited by:
    manuel.leiria

  • BDC: To Include more than one value in one field.

    Hi All,
    I want to include more than one value in a particular filed, while its running in back ground.
    The requirement is like this
      perform bdc_field       using 'PNPABKRS-LOW'
                                     '01'.
    01 is a filed on employee payroll type : management staff.
    02 - Filed staff
    03 - work men
    How can i include 02 and 03 also for the perform.
    it has to check whether the employee  can belongs to any of the above three.
    Thanks in Advance,
    Points Rewarded for Help full answer.

    Hi, Ramesh,
    You can not use all the 3 fields at the same time, instead you can pass on one variable in that perform.
    eg.
    take all your staff value in one internal table and use the following code
    loop at i_tab into wa_tab.
    data : l_variable type string.
    perform bdc_field using 'PNPABKRS-LOW'  wa_tab-staff.
    endloop.
    in first run of loop it will take value '01', in second '02' and so on.
    regards,
    vikas
    plz reward if helpful.

  • Possible to return more than one value?

    If I have a somethign like this:
    public int test()
    return 5;
    }Is it possible to have test() return more than one value? And if it can, can you post an example showing how?

    Could you post an example of how to do this?If you do not know how to define a class, you need to start from the very beginning.
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.
    James Gosling's The Java Programming Language. Gosling is
    the creator of Java. It doesn't get much more authoratative than this.

  • LOV Return more than one value to differenent items on page

    New to express. I need to returm more than one value from list of LOV. For example: LOV => select a, b, c from testtable
    I would then like to
    a to populate item1 => with submit
    b to populate item2 => hidden
    c to pupulate item3 => hidden
    as items on my page
    when a user chooses a (with submit) in item1 b and c would populate also, b and c are hidden to the user. Any advice?

    Dear Frank
    I did it as like as the following link lead me:
    http://www.oracle.com/technology/obe/obe11jdev/11/adfbc_new_features/adfbc.html
    The problem has been appeared when I attached the "Create" button and when press on it to create new record, then the "LOV" couldn't work correctly.
    Thanks for your reply

Maybe you are looking for

  • PO receipt due date / transhipment/ regular / express order

    Dear Experts, Can anyone please let me know where i can find or which field, for the following in a Purchase order? 1. receipt due date 2. whether PO is a transhipment order or regular order or express order. Regards

  • How to install Google's chrome browser safely on MacBook Pro-retina?

    Hello, I've arrived to a crossway which I need (don't want to) install Google's chrome browser or Firefox on my MacBook Pro. Yes, I don't want to, I hate it running on a Mac. I know it's the best browsing experience in a 'Chromebook', but in "Rome be

  • Printing Borderless Envelopes

    Hello, I can print 8.5 x 11 borderless (HP PhotoSmart 2610) but can't seem to figure out how to do borderless envelopes. Is this dependent on my printer or some setting in Illustrator? The print dialog box for #10 envelope gives a print area with mar

  • What is Infopackage Group

    Hi all, What is Infopackage Groups and what are the settings in side thanks in advance regards

  • Target Disk Mode no longer working

    I've never had any problems connecting my PB G4 to my desktop G4 in target disk mode until today. The PB simply starts up in the Mac OS and doesn't appear on the host computer. I haven't changed anything. I checked the firewire cable on another devic