File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes in dropdown problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "in dropdown problem" Watch "in dropdown problem" New topic

in dropdown problem

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 265
Hello Ranchers

I'm doing a program in jsp-oracle.. and when a jsp page is called the combo box in that page has to display a particular field in the database
now.. in my program i can see the fields in the drop down..
the problem comes next
the combobox now have the employee ids (100 nos)
so when ever i click one from the combo
i want to get the emp name, and details in the text box..

for that can i call another query for that
or can i do that using java scripts

please help me ranchers
Jherald Lacambra
Ranch Hand

Joined: Feb 02, 2005
Posts: 129
can you elaborate your question

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 265
my question is this
i'm doing a project in jsp - oracle using the webserver tomcat.. ok

now the module i'm developing is salary details of the employees
for that in the page there is one combo box and three text boxes

combo box referes to employee id
text box1 refers to employee name
text box2 refers to employee details
text box3 refers to salary

in the combo box i've connected it to the database oracle
so when the page is loading it will shows all the 100 employee id
when we select any one from the combobox the details corresponding to the employee number should display in the text boxes

for egs:
if i select the employee number : 45
name = Aravind Prasad
details = Project student
salary = 5000

like wise

for getting the values in the combo box i use the jdbc connection
the query is like this
select * from table1;
while (
{ String name = rs.getString(1);
but for onChange() function in combo box i've to use java scripts

so again in inside the function
do i want to write the whole jdbc code..

please help me ranchers

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

You should not do all the DB stuff in the JSP view.
Do it in a module controlled by a servlet.
Set all the necessary information into a bean, and use it in the jsp view.

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: in dropdown problem
It's not a secret anymore!