Expert Member
combo in jsp
hi frineds
i want to use a jsp page, which connects to DB and retrieves info from it(say lastname).the retrieved info should be inserted into COMBOBOX
Please tell how can one do it!
Contributing Member
Re: combo in jsp
I think in jsp page you can also use html code. Checkout the following code.
<% = lastname(this what you getting from database) %>
------------------
suresh
Expert Member
Re: combo in jsp
hi suresh
but it will return more than one row from DB!
suppose it returns three rows!
i am storing these three names in array like
arr[]=rs.getString("lastname");
now i want to add it to combo box
????
how to solve this!
this is the scenario iam speaking about!
hoping answer soon!
:)
NEVER SAY DIE.
Reply With Quote
03-19-2007
#4
pramod.reddy
View Profile
View Forum Posts
Private Message
Junior Member
Join Date Mar 2007
Answers 1
Re: combo in jsp
Hi ,
I dont know whether u r using any framework or following any architecture. If u r not using any framework or CustomTags , u can adapt the procedure given below.
If u have a collection or an array of objects iterate them using a loop and add these values to a combobox.
You can write a Scriplet to do this.
for wg:- if you have an array names of size 10 i.e., names[10] then u can iterate u r array in this way
<%
for(int i=0,n=names.length[];i
%>
<% = names[i] %>
<%
}
%>
Last edited by pramod.reddy; 03-19-2007 at 05:04 AM .
Expert Member
Re: combo in jsp
thanks pramod!Though i got the solution that day itself, i forgot to write here!
But still too much thanks! Hope you will help me in other problems too(as i come across)!
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules