• 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

Getting data stored in an Oracle database into HTML SELECT Control

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to get the data stored in my database (Oracle) to be displayed in the HTML Form - Select Control (Combo Box) when the form is loaded.

In short, when the HTML Form is displayed the Select Control in the form should have the data that is in the database. I m using JSP.
How can I do this?

Please help me out.......
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assume xyz.jsp has a select control as a HTML form component.
Write a separate business component(class file)through which retrieve the values from database.
In jsp file , inbetween the jsp tags(<% %> , access the class method which returns the values and populate it in select control.
So, when you access the jsp page in browser , inturn it invokes the method which returns the values in the form of vector/arraylist. They will be formated and loaded in Select Control.

Thanks and Regards
David Menfields
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Shailesh,
Welcome to JavaRanch!

The first step is to write a SQL query to get the data from the Oracle database. Then you can use JDBC to retrieve the data.
 
rubbery bacon. crispy tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic