Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting data stored in an Oracle database into HTML SELECT Control

 
Shailesh Pillai
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • 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.......
 
David Menfields
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic