Results 1 to 1 of 1

Thread: select query based on the selection made on the listbox

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2004
    Posts
    20

    Resolved select query based on the selection made on the listbox

    I have a Multiple Select listbox with values for eg: a, b, c, d, e etc. If I select a,b,c from the listbox, I should be able to make a select query based on that. Like this: select a,b,c from table.

    what should I do to collect the values from the listbox and reproduce them to the select query?

    I am able to collect the values using a for loop and I am not sure whether to add that in a vector or something to reproduce in the select query.

    Code I have wriiten so far:
    Mcol_lst is the name of the listbox.
    String[] sele = request.getParameterValues("Mcol_lst");
    if(sele !=null) {
    for(int i=0;i<sele.length;i++) {
    System.out.println("dffdsfsdf"+i);
    vec.add(params[i]);
    }
    }

    rs=st.executeQuery("Select ["+request.getParameterValues("Mcol_lst")+"] from [Base Inventory Table]);

    There should be a "comma" after each item selected to do the select query, how should I get that?

    Please help,
    Thanks
    Last edited by nubee; Dec 6th, 2004 at 04:56 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width