• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

in dropdown problem

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you elaborate your question
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello!!
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 (rs.next())
{ String name = rs.getString(1);
%>
<option><%=namme%></option>
<%
}
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


 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic